cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to re-try or skip a Java Service Task?

rtitov1
Champ in-the-making
Champ in-the-making
Dear Activiti Gurus,

We're investigating a possibility of using Activiti in our corporate document handling system which has plenty of complex workflows. Those workflows consist of multiple steps that would be Java Service Tasks in Activiti. Most of the steps involve interacting with humans (our advanced analog of a User Task) and transferring data to other corporate systems. Sometimes workflows get stuck in a middle, e.g. due to data inconsistency. When this happens our engineers have to either re-try the stuck task once the problem is resolved or to skip the task and push workflow to the next step if the task was performed manually. In most of our cases re-starting process from the beginning in case of a problem isn't an option since multiple persons may have already approved it and asking them again for approval is not feasible. Therefore when an exception occurs the workflow has to be "suspended" on the errored task with an option of retrying or skipping it. Sometimes a task may even have to be retried if there was no exception altogether (for example, if we transfer data to an external system and the external system reports success but later we discover that somehow the receiver system didn't get data succesfully and we have to re-transfer it again).

Therefore, here is a question: is there a technical possibility to re-try or skip a Java Service Task in a middle of an Activiti process without having to re-start the process from scratch?

Thank you in advance for answering,
Slava
6 REPLIES 6

sapra
Champ in-the-making
Champ in-the-making
I too would like to know if it is possible.

Is it possible using JBPM 5 ? Workflow engines are not meant for such processing ?

Appreciate some pointers.
Thanks
Saprar

rtitov1
Champ in-the-making
Champ in-the-making
Dear Saprar,

I recon it must be possible since this is a very useful feature and we use it on daily basis. I know it is supported by the ActiveVOS engine and I believe it is supported also by Oracle BPM. We had it as early as in 90s with the Oracle Workflow engine (that one wasn't based on any standards)…

Slava

rtitov1
Champ in-the-making
Champ in-the-making
Can somebody of the Activiti developers please answer this question?

trademak
Star Contributor
Star Contributor
Hi,

Yes this is possible by using async continuations.
So if you set the async attribute to true on a service task the execution will be handled by the job executor.
When the service task fails, it's retried 3 times.
After 3 times the job is in a failed state, but you can still manually start it again.

Best regards,

Hi, may I know how can we start the service task manually if the job is in a failed state?

When the job is in a failed state you can use the JobQuery to retrieve these failed jobs and execute them manually via the ManagementService API.

Best regards,