Hi,
We are in the process of migrating from C7 to C8. For service task execution, in C7, we can use Java delegates and have an abstract way to call the DelgateExecution execute method and can have implementation of Service tasks seperately.
In case of zeebe Job worker execution, we need to have a type definition name and @JobWorker annotation for service task execution, is there any way which we can abstract this execution, like there will be generic abstract class or interface, which a class will write the implementation for the Job Worker. Based on class name or some other parameter, can we invoke the right implementation?
Basically I want to have a single place for invoking the job workers, instead of having @Jobworker annotation and type associated with it.
Hey @Naveen_KS,
the only thing which comes to my mind is to create a “central” job worker, who is fetching every job which is being created by the engine. By setting the right variables you could than route it from there to the right piece of business logic.
Though I think this is far away from being a good practice…
Why do you want to have a single place for invoking the job workers? Wouldn’t an Access Layer implementation for Camunda, which contains all the required worker, do the trick?
Best,
Thomas
Hi @Hafflgav , We are building a library to orchestrate the business processes using camunda, so wanted all the interactions to camunda inside our library, clients who are using the library should have interaction or dependency to our library instead of zeebe. So we wanted to expose an interface for this, based on the client implementation(Say the class name), library should be able to delegate the Job worker execution to the client’s implementation
Hi @Naveen_KS,
for easy migration from Camunda 7 to Camunda 8 you can use this adapter: camunda-7-to-8-migration/camunda-7-adapter at main · camunda-community-hub/camunda-7-to-8-migration · GitHub
You can convert your process models with this converter: camunda-7-to-8-migration/backend-diagram-converter/cli at main · camunda-community-hub/camunda-7-to-8-migration · GitHub.
As @Hafflgav mentioned, you should have a look at the amount of tasks and delegate classes that you combine with the adapter. In case the number is huge, it’s worth to split it.
Hope this helps, Ingo
1 Like
I have checked camunda 7-8 migration tool and this adapter works fine, but this will rely on C7 and execution of service tasks is based on C7 Java delagates.
I wanted to achieve similar behaviour in C8 Job workers
Hi @Naveen_KS,
You can write one generic Camunda 8 worker and provide different configuration to the BPMN diagrams placed in extension properties for this task. In the worker, you have the full control of the values. The adapter may serve as an example for this.
It takes the class from the extension property and invokes it in the delegate code. It can also invoke the interface that you design in your code.
Hope this helps, Ingo