Do not integrate CamundaLibrary in Java
Camunda is proud to be developer friendly — meaning Java developers in particular. Although it is a huge island, the company must have realized that Java is not the only island out there and integrated the External Task pattern.
This pattern allows clients written in any language to interact with Camunda through its exhaustive REST API. Each implementation of a service task is its own program running separately from Camunda platform:
CamundaLibrary is implemented primarily for Robot Framework and written in Python. Therefore it can be used by any environment that supports Python. Unfortunately, the JVM is not one of them. There are edge cases where you can try to combine Robot Framework or Python with Java:
- Camel Spring Boot Starter for Robot Framework
- Jython and hope that you rely only on Robot libraries that still support legacy Python 2
But before you run in to battle, revisit the external task pattern: you should not need to fight for integrating python or Robot Framework in Java! The beauty of Microservice architecture is independence. Each service has a particular purpose. Depending on that purpose, you choose your programming language. But you don’t mix them within a service.
Python has a rich collection of libraries and is perfect for automation. It has more than 300.000 modules integrating all kind of real world interfaces: SFTP access, Web automation, Image recognition, Text recognition, AI, ML, IoT, Data Science in general… The list is almost endless.
Robot Framework simply makes Python more non-developer friendly and provides some implementation patterns. But for making Python more citizen-developer friendly, it requires Robot libraries that hide complexity of common python modules. And that is exactly what CamundaLibrary does: it hides the details of the REST API behind a set of one-liners:
You can even use those one liners in Python:
Java Frameworks often solve Java problems. Python and Robot Framework solve automation problems. If you have a service task that is a nightmare to be automated in Java, don’t try mixing Robot Framework. Simply install CamundaLibrary with pip install robotframework-camunda
and define a separate service task according to the external task pattern. That’s much more efficient than combining CamundaLibrary with Java.