cancel
Showing results for 
Search instead for 
Did you mean: 

Suspending a process

afshad
Champ in-the-making
Champ in-the-making
I have a process definition that contains only a sequence of serviceTask 's (no user taks or timers or anything else)
I would like to implement suspending and activating activiti so that when Activiti is resumed it continues with the next service task or last one where it left off.
I have tried both approaches shown below but neither work. When I try to activate activiti, nothing happens.

To suspend ive tried using both:
_runtimeService.suspendProcessInstanceById(processInstanceId);
_repositoryService.suspendProcessDefinitionById(_processDefinitionId);

To activate:
_runtimeService.activateProcessInstanceById(_processId);
_repositoryService.activateProcessDefinitionById(_processDefinitionId);

but neither of the above work.

Does anyone have any ideas on how to make this work.
Thank you.
1 REPLY 1

jbarrez
Star Contributor
Star Contributor
You won't be able to suspend the process when you're executing sequential steps of service tasks. The reason for this is that they all run in the same transaction.

However, you could introduce 'async steps' for your service tasks. In that case, the transaction will be committed, and the suspend should be honored.
However, I do think somebody filed an issue that suspending the process doesn't yet work fully when dealing with async steps, so it's possible we need to fix that asap.