cancel
Showing results for 
Search instead for 
Did you mean: 

Persisting Service Tasks in ACT_RU_EXECUTION

workflowuser2
Champ in-the-making
Champ in-the-making
Hi,

I have processes comprised of long-running service tasks (Java Delegates). In order to support fail-over, I would like to persist state before each service task.

Based on my understanding, only receive/user and other wait tasks are flushed to the table.

Is there a workaround (by using ParserListener?, chaging Service Task Activiti behavior?) by which I can flush service tasks into ACT_RU_EXECUTION before they are kicked-off?

I am a newbie and your help is appreciated. Thank you.

workflowuser2
4 REPLIES 4

frederikherema1
Star Contributor
Star Contributor
Read the chapter in our user guide about Asycn continuations: http://activiti.org/userguide/index.html#asyncContinuations

Basically, by marking your service-task as async, the process state will be persisted and the service-task will be executed in a job-executor thread, the calling thread's control will be returned.


<serviceTask id="service1" name="Generate Invoice" activiti:class="my.custom.Delegate" activiti:async="true" />

workflowuser2
Champ in-the-making
Champ in-the-making
Thank you, workflowuser2, for the quick reply.

My sample process is:
start -> service task1 -> service task2 -> service task3 -> end

here i would like the service tasks to be processed "in order".

Now if I put "async=true" in "each" service task, would activiti engine guarantee the order?

I was trying to see if I can somehow decorate service tasks (or create my own service task) with wait semantics so that process state is flushed before each service task.

thanks again for the help.


Read the chapter in our user guide about Asycn continuations: http://activiti.org/userguide/index.html#asyncContinuations

Basically, by marking your service-task as async, the process state will be persisted and the service-task will be executed in a job-executor thread, the calling thread's control will be returned.


<serviceTask id="service1" name="Generate Invoice" activiti:class="my.custom.Delegate" activiti:async="true" />

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Now if I put "async=true" in "each" service task, would activiti engine guarantee the order?

Yes, because that is the order in which you modeled them. (You did not model them in parallel)

workflowuser2
Champ in-the-making
Champ in-the-making
Thanks.