Question

I am looking at Activiti BPMN processes and how they would best interface with Spring Integration EIP message flows. Specifically, I would like to know what is the cleanest or best way to trigger an activiti BPMN process to execute at the end of a Spring Integration message flow.

e.g. Should I trigger a message start event for the BPMN process from a final service-activator method in my EIP flow?

runtimeService.startProcessInstanceByMessage(messageName, processVariables);

e.g. Should I trigger a none start event for the BPMN process from a final service-activator method in my EIP flow?

runtimeService.startProcessInstanceById(processDefinitionId, variables);

e.g. Any other more appropriate interfacing methods?

Thanks in advance, PM.

Was it helpful?

Solution

we use Activiti/Spring with spring-integration and AMQP messaging. To start the process we use the second approach on calling runtimeService().startProcessInstanceByKey() to be sure to launch the expected workflow (only one).

So your choice depends on what you like to have... If you have one-2-one relation between message and workflow to be started use the second approach.

When you trigger a message to activity engine (first approach) this can potentially start more than one workflow depending on how your workflows are designed and on what messages they listen. Think of having two workflows listening to the same message. They will both be started. But maybe this is exactly what you want (i don't know).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top