CamundaLibrary — task automation for python

Markus Stahl
2 min readJun 2, 2021

--

CamundaLibrary provides keywords for Robot Framework in order to integrate your favorite task automation framework with your favorite process orchestration platform. If you do not use CamundaLibrary, you need to add Camunda’s REST endpoints individually.

But implementing plain REST calls is quite time consuming. During the day I crosspath so many different domains — REST is only on of them. What MIME type do I need? multipart/ something? Where do I define the file name? Thanks to stackoverflow those challenges can be solved. Every time. Again and again.

But we don’t need the repetitive challenge of remembering low level details of REST. Luckily, Camunda offers an openapi specification becoming richer with every release. If you use that openapi specification to generate your a client in your favorite programming language, you do not need to remember all low-code details of REST. If you use the openapi generator, you get real methods, hiding the ugly implementation details and even generate implementation guidelines! This is how I generated the generic-camunda-client. It is a python client auto generated from Camunda openapi specification and it comes with usage instructions.

But using a generated client is still ugly. REST details are hidden, but now you have to deal with DTOs and stuff. This is still overhead, since you mainly want to focus on automating a task. You certainly don’t want to deal with message transactions between your task and its orchestrator. That’s a time consuming no-brainer — and that’s where CamundaLibrary comes in to play.

CamundaLibrary hides the implementation details from the REST client and offers meaningful method such as:

  • fetch workload
  • complete task
  • start process

Although CamundaLibrary is aimed to Robot Framework users, the library can be used in any python project!

See the following process:

And the following python script that:

  • upload the model to Camunda platform
  • starts a process adding a variable with value 42
  • fetching the process instances
  • validate that the variable value is 42
  • completes the process instance

How would you accomplish the workflow with REST? With a generated client? Still too much work. With CamundaLibrary, each step in the enumeration above is just 1 line:

There you go. You execute a full process exclusively in python in roughly 7 lines of code. No MIME types, no DTOs — just simple functions. If Robot Framework is not “professional” enough for you, you can still benefit from CamundaLibrary. Use it as python module!

Try out the code yourself running, the no_robot.py example: https://github.com/Noordsestern/robotframework-camunda-user-support/tree/master/pure-python

If you like to use CamundaLibrary, simply install it as python module with pip:

pip install robotframework-camunda

CamundaLibrary is constantly extended with new functions making integrating of endpoints from Camunda platform easier. Check out the repository.

--

--

Markus Stahl
Markus Stahl

Written by Markus Stahl

Sustainable automation with open source technologies.

No responses yet