cancel
Showing results for 
Search instead for 
Did you mean: 

simulating receivetask + signal activiti (step)

workflowuser2
Champ in-the-making
Champ in-the-making
Goal: to be able to run multiple instances of a call-activiti or subprocess is a separate java thread.

Hi,

I observed the following issue with async-continuation + call-activiti loop:

start -> serviceTask1 -> loop Call-Activiti -> end

The above does not result into "multiple-threads" when call-activiti has more than one instances.

workarounds:
1- if I remove serviceTask1: async-continuation (multithreading) works as expected where each instance of call-activiti is executed is a separate thread2
2- if I insert a wait state (eg receive task) "before" call-activiti such as: start -> serviceTask1 -> receiveTask -> loop Call-Activiti -> end    ===> async-continuation (multithreading) works as expected

Now, I cannot use the first workaround.
For the second workaround, is there a way to automatically add a wait state e.g. receiveTask + signal in front of a call-activiti? Can I achieve this, for example, using custom Bpmn parser or using listener?

Thoughts, comments appreciated.

thanks
pdt
2 REPLIES 2

trademak
Star Contributor
Star Contributor
Hi,

Automatically adding a wait state would be something you could do in a custom pre or post BpmnParseListener.
For an example you can look at the HistoryParseListener implementation, in the Activiti Engine source code.

Best regards,

workflowuser2
Champ in-the-making
Champ in-the-making
Hi trademark

thanks for the reply.
I looked at the HistoryParseListener  and saw that we can attach Execution Listeners to the activities.

Could you explain a bit more on how to "add" a new step (activiti) in a custom parse listener. Since wait state is not in the process bpmn20.xml definition file, how can we automatically add it thorugh parse listener or execution listener?

thanks
pdt
Hi,

Automatically adding a wait state would be something you could do in a custom pre or post BpmnParseListener.
For an example you can look at the HistoryParseListener implementation, in the Activiti Engine source code.

Best regards,