Catow is a small webservice based on fastapi. It checks, if a topic in Camunda BPMN platform as more than 0 tokens. If so, an HTTP-GET is triggered. In combination with robotframework webservice, this can trigger a robot task. When the robot tasks uses CamundaLibrary, it can consume the token provided by Camunda.
Camunda Topic Watcher is not yet available on pypi. But you can install it directly from github:
pip install git+https://github.com/Noordsestern/catow.git
python -m Catow.main -t <topic to be subsribed to> -r <url to be triggered>
You can also add:
-p
specifying the port Camunda Topic Watcher should run on (used later for heath checks) (default: 5003)-i
definying the polling interval in seconds (default: 3 seconds)-c
setting the url to Camunda (default:http://localhost:8080)
docker pull ghcr.io/noordsestern/catow:master
docker run -d --name catow --env CAMUNDA_TOPIC=<external task topic> --env DESTINATION_URL=<my-destination-rul> --env POLLING_INTERVAL=10 ghcr.io/noordsestern/catow:master
Catow is under development and currently in Alpha.
Catow helps you when running robotframework tasks with CamundaLibrary tomake sure that the task has actually tokens to fetch from Camunda:
Make sure you have python installed. Recommended is 3.9.
You already have Camunda platform running on http://localhost:8080
. You can find installation instractions at
Camunda Documentation.
Run
pip install robotframework-camunda
robotframework-camunda
will automatically pull the apropriate version of Robot Framework.
While having Camunda platform running, upload the model by running:
robot -d logs tests/demo_upload_model.robot
Produce a few demo process instances by running:
robot -d logs tests/demo_producer.robot
You can verify in Camunda cockpit that you now have demo tokens waiting in the process:
First install robotframework-webservice with pip
pip install robotframework-webservice
create a logs
folder:
mkdir logs
and start the webservice while providing the demo consumer:
python -m RobotFrameworkService.main -p 5004 -t tests/demo_consumer.robot
The last call starts the webservice listening on port 5004 and having tests/demo_consumer.robot ready to be executed.
Install Catow dependencies with:
pip install -r requirements.txt
Start catow with
python -m Catow.main
Catow should produce the following output:
INFO: Started server process [15228]
INFO: Waiting for application startup.
INFO: Application startup complete.
{"count":3}
Start Robot!
INFO: Uvicorn running on http://0.0.0.0:5003 (Press CTRL+C to quit)
{"count":2}
Start Robot!
{"count":1}
Start Robot!
{"count":0}
Nothing to do here.
You can see that the count
goes down for each time Catow triggers the robotframework webservice.
Once the count is at 0, it prints Nothing to do here.
every time the count is polled.
You can now re-run the demo_producer.robot
task in order to repeat the experiment.
Catow is a very simple service that shall make Robot tasks scalable: