Camunda & Robot Framework
Introducing robotframework-camunda library.
We believe in open source technology, especially relying for automation on Robot Framework. We had focused on test automation, but practice RPA since 2 years. One challenge in every process automation is transparency to the original process owner. We believe, we found in Camunda an opportunity to share a process with RPA developers and process owners alike.
If you are Camunda user, you probably wonder: What is Robot Framework?
Robot Framework is an open source automation framework for task automation. Among other features, it offers a customizable domain language for developing tasks. It was originally developed for test automation providing the unique advantage making human readable test description executable. But most importantly: it comes with the enormous api universe from python. Meaning any python library can be integrated in to your automation.
If you are Robot Framework user, you probably wonder: What is Camunda?
2 sentences won’t do Camunda justice, just as the above summary about Robot Framework. In their words:
Camunda is a collection of “open source workflow and decision automation tools [to] enable thousands of developers to automate business processes and gain the agility, visibility and scale that is needed to achieve digital transformation”.
As Robot Framework enables testers around the world automating their test cases by simply describing them, Camunda enables process designers to automate processes by describing them in BPMN. You might summerize their power with the slogan: Automation by documentation Both might look like low code, but still offer the full power for developers to enhance their ecosystem.
Integrating Camunda and Python
Camunda is primarily built for Java developers, yet implemented the External Task Pattern enabling developers from all programming languages integrating with Camunda through the very well documented Camunda REST API. For Robot Framework, all you need is implementing a few keywords for convenience wrapping requests to endpoints from Camunda REST API. Now you’d only need to package your library, publish it on pypi.org and there you go: the robotframework-camunda library.
As of November 2020, the robotframework-camunda library is in beta.
However, it is already that useful for us that we could not keep this to ourselves.
The library currently consist of only 5 keywords. Due to the vast amount of endpoints and use cases for the Camunda REST API there are much more keywords expected to be implemented. Therefore, the library is structured in sub libraries:
Everybody is welcome to report issues and to provide merge requests at the repository on Gitlab.
Deployment.Deploy model from file
This keyword simply take a bpmn file created with the Camunda Modeler and uploads it to a Camunda instance configured in your library:
This keyword is very convenient when running Camunda for integration tests in a pipeline. You may upload your process model to a temporary Camunda instance and run your tests.
This keyword starts a process.
Creating variables for a process is a bit inconvenient. Fixing it is on our list.
ExternalTask.Fetch and lock workloads
This keyword fetches work items from a certain topic of a process in Camunda:
Variables of workloads are typed as dictionaries:
Right now, this keyword only fetches at max 1 work item from Camunda. Fixing it is on our list
You cannot provide more options for fetching, yet, like for instance locking duration.
Only fetching a work item is not worth anything when you do not inform Camunda about the result. You do that using this keyword:
The library caches the process instance that provided the variables. This cached process instance is automatically used when calling complete task so you don't have to deal with it.