Spring Boot Adapter to re-use Java Delegates, Delegate Expressions, Expressions or External Tasks from Camunda Platform 7 in Camunda Platform 8
This library allows to reuse Java delegates, Delegate Expressions, Expressions or External Tasks from process solutions developed for Camunda Platform 7 (with Spring/Spring Boot) within Camunda Platform 8.
The adapter requires to use Spring Boot.
Details on how service tasks are adapted are described in this migration guide.
Important note:* This adapter does not aim to cover every possible situation, but it might work out-of-the-box for some cases or give you jump-start to extend it to suite your needs.
Add the dependency to the adapter library (double-check for the latest version):
<dependency>
<groupId>org.camunda.community.migration</groupId>
<artifactId>camunda-7-adapter</artifactId>
<version>0.4.4</version>
</dependency>
Import the adapter into your Spring Boot application as shown in the example application:
@SpringBootApplication
@EnableZeebeClient
@EnableCamunda7Adapter
@ZeebeDeployment(resources = "classpath:*.bpmn")
public class Application {
// start off here
}
This will start a job worker that subscribes to camunda-7-adapter
as well as
workers for each @ExternalTaskSubscription
with Zeebe Task Type equal to
External Task Topic Name.
To use that worker, add the taskType="camunda-7-adapter"
to your service task
and add task headers for a java delegate class, delegate expression or
expression, e.g.:
<bpmn:serviceTask id="task1" name="Java Delegate">
<bpmn:extensionElements>
<zeebe:taskDefinition type="camunda-7-adapter"/>
<zeebe:taskHeaders>
<zeebe:header key="class" value="org.camunda.community.migration.example.SampleJavaDelegate"/>
</zeebe:taskHeaders>
</bpmn:extensionElements>
</bpmn:serviceTask>
<bpmn:serviceTask id="task2" name="Delegate Expression">
<bpmn:extensionElements>
<zeebe:taskDefinition type="camunda-7-adapter"/>
<zeebe:taskHeaders>
<zeebe:header key="delegateExpression" value="${myAwesomeJavaDelegateBean}"/>
</zeebe:taskHeaders>
</bpmn:extensionElements>
</bpmn:serviceTask>
<bpmn:serviceTask id="task3" name="Expression">
<bpmn:extensionElements>
<zeebe:taskDefinition type="camunda-7-adapter"/>
<zeebe:taskHeaders>
<zeebe:header key="expression" value="${someBean.awesomeMethod(execution, someVar)}"/>
</zeebe:taskHeaders>
</bpmn:extensionElements>
</bpmn:serviceTask>
The external task workers can be mapped by using the taskType
and insert the
topicName
there.
<bpmn:serviceTask id="task4" name="External Task Worker">
<bpmn:extensionElements>
<zeebe:taskDefinition type="my-awesome-topic"/>
</bpmn:extensionElements>
</bpmn:serviceTask>
Check out the full example for more details.