cancel
Showing results for 
Search instead for 
Did you mean: 

How to pause a running process through API

xjshangguan
Champ in-the-making
Champ in-the-making
Hi,

We are still relatively new with Activiti. And currently we have a requirement to pause/resume/stop activiti process through API. Do you guys have any good way to do it. 

Also the process variables seem not to be persisted into database before the process completes. Do I have configuration not right? 

Regards,

Sean
5 REPLIES 5

jbarrez
Star Contributor
Star Contributor
We are still relatively new with Activiti. And currently we have a requirement to pause/resume/stop activiti process through API. Do you guys have any good way to do it.

We've added that to Activiti 5.11, which is planned to be released 5th of December

Also the process variables seem not to be persisted into database before the process completes. Do I have configuration not right?

Process variables are persisted when your process arrives in a wait state. For example a user task. If you only have automatic steps, indeed the process variables will be persisted at the end of the transaction.

xjshangguan
Champ in-the-making
Champ in-the-making
Thanks for the info.  Looking forward to trying it in a few days.

xjshangguan
Champ in-the-making
Champ in-the-making
Joram,

I have read your blog posted on 12/11 regarding suspending a process. One of the main feature we have to have is to pause/resume a running process.   I feel the following methods should do the work. 

void suspendProcessInstanceById(String processInstanceId);
void activateProcessInstanceById(String processInstanceId);

But you also mentioned when a process instance is suspended, "The process instance is simply halted where it is and it cannot be continued in any way."  Does "activivateProcessInstanceById" wake up the suspended process instance; otherwise, "suspendProcessInstanceById" is just like a process instance killer.

Your help is very much appreciated.

Regards,

Sean

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Sorry to sound rude, but did you try? But yes that is what it is supposed to do…

xjshangguan
Champ in-the-making
Champ in-the-making
Not rude at all.  The first time I read your blog, I did not watch the video.  After I viewed the video, I know they should do the work.  Thanks for advising.