Persisting Service Tasks in ACT_RU_EXECUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2012 02:29 AM
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
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
Labels:
- Labels:
-
Archive
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2012 02:40 AM
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.
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" />
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2012 11:51 AM
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.
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" />
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2012 02:32 PM
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)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2012 02:23 PM
Thanks.
