cancel
Showing results for 
Search instead for 
Did you mean: 

Resuming workflow

kanchan
Champ in-the-making
Champ in-the-making
Hi,

We are currently exploring activiti to use in our project. Out of which one of the topic is how saved workflows are resumed in activiti.
My scenario is service task1 -> catchTimerEvent->Service task2. In this case if the engine crashes in between say after catchTimerEven What happens to the process instance? Does the process Instance get saved in table? If so which table? And how that process instance is resumed ? After resuming does it start from the beginning(in above case service task1) or from the crash point?
Need your Assistance.
Thanks in advance.

-Kanchan.
17 REPLIES 17

hardik_kaji
Champ in-the-making
Champ in-the-making
Hi Kanchan,

Can you share activiti diagram or Unit test case for same?

kanchan
Champ in-the-making
Champ in-the-making
Thanks for the reply..
In above scenario I could resume the process instance from timer event. Now I want to know what will happen in case there is script task or any other task instead of timer(wait state) and engine stops or crashes while executing script task. Will it resume from crash state or from begining in next run ? Which will be the safe state for this ?
Earlier my workflow was ->

start event -> service task -> Timer -> script task -> end event

Now I want to know about this scenario ->

start event -> service task -> script task -> script task -> end event


Many thanks in advance Smiley Happy

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Kanchan,

let's say that  start event is None Start Event and process is started by
runtimeService.startProcessInstanceByKey….
and there is no asynchronous task between start -> script.
In that case method call will throw an exception.

Regards
Martin

kanchan
Champ in-the-making
Champ in-the-making
Hi Martin,

Yes,I have the same workflow without any asynchronous task :
None start event -> script task -> service task1 -> script task -> end event

But I'm not getting any exception. My question is if engine is crashed/restarted at service task1 while executing some script, the next time when I rerun the workflow,from where this suspended workflow will get resumed? beginning i.e. start event or the crash point?

Thanks,
Kanchan

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Kanchan.

In the case when process is interrupted between two wait states (crash….) transaction is not committed and that's why process instance should be in the same state as it was before the transaction start.
more info:
http://www.activiti.org/userguide/#bpmnConcurrencyAndTransactions

Regards
Martin

kanchan
Champ in-the-making
Champ in-the-making
Hi Martin,

You mean the transaction will not be persisted until and unless it reaches to the wait state. If there is no wait state in workflow, the process will always resume from start point in case it's interrupted in between. Please correct me if I have misunderstood anything.

Thanks a lot,
Kanchan

trademak
Star Contributor
Star Contributor
Hi Kanchan,

That's correct. When an exception occurs and no wait state is reached to whole process instance will be rolled back until the starting point.

Best regards,

kanchan
Champ in-the-making
Champ in-the-making
Thanks all for the reply.
Please provide me the details on support cost that activiti team charges.

-Kanchan

kanchan
Champ in-the-making
Champ in-the-making
Hi,

I also want to know about How we can achieve Throttling for multi-instance constructs in activiti.

Thanks in advance,
Kanchan