cancel
Showing results for 
Search instead for 
Did you mean: 

Repeat Service Task

ad1
Champ in-the-making
Champ in-the-making
I have a process which does sequence of service tasks.

Start Process
->Service  Task 1
->Service Task 2
->Service Task 3
End Process

If any Service task processing fails (due to any data or other error), i want to restart/replay the Service task after the user fixes the data error.
How can this be done? How can i make the process wait and get back reprocessing the same service task?

Thanks,
ANDAT



1 REPLY 1

hari
Star Contributor
Star Contributor
Hi,

I did it like this. I've taken two process variables Path and Exception and in service task when I come across an exception, I set the values as below.
<code>
execution.setVariable("Path", "HandleException");
String exText = org.apache.commons.lang3.exception.ExceptionUtils.getStackTrace(ex.fillInStackTrace());
execution.setVariable("Exception", exText);
</code>

I'll  have two outgoing sequences from the service tasks, one of them will go to a user task and the other to the next service task/end. The one which goes to the user task will have a condition on the sequence flow where it checks if Path is HandleException. From the user task I have a sequence flow to an exclusive gateway which decides on the path to follow. Either to retry or to go to the next service task.