How can we create a stateless bpmn service or workflow in camunda ? Please let us know about this

How can we create a stateless bpmn workflow in camunda ? Or how can we distinguish between statefull or stateless service in camunda ?

Thanks,
Kumar

Hi Kumar,

a workflow (i.e., process instance) has always a state. I assume that you want to have a stateless service task in your process, right?

For each service task, you have to specify the calling Java code, for example you can specify the Java delegate via class name or expression which can invoke a bean via CDI, Spring, etc. If you use a class name then a new instance of the Java Delegate is created each time the process arrives the service task. Otherwise, you have to deal with the instantiation, e.g., by defining the Spring bean. So in the end, it’s up to you how you build your services.

Does this help you?

Best regards,
Philipp

Hi Philip
I am using embedded at java and starting processes with runtimeService.startProcessInstanceByKey.
Is this way stateless?
if not stateless, what should I do for start my process with stateless?
thank you…

Hey Philip,
If I am calling a service task from multiple process, is the Delegate Thread Safe?