Hi,
I have a BPMN model which contains a user Task ( UT) with a taskListner ( called when UT is completed) .
.
public void notify(DelegateTask delegateTask) {
//a custom Java logic
do something ;
..........
}
The problem that my code (do something) can throw a exception, and I want in this case to reassign the task to the same user (Retry mechanism: require the user to try again to complete this task ).
How can I do that ? ( Knowing that notify() method doesn’t accept " throws Exception"
clause).
NB: I found a ugly method to do it,but i don’t like it !
public void notify(DelegateTask delegateTask) {
try{
//a custom Java logic
do something ;
..........
} catch (Exception e) {
taskService.setVariable(delegateTask.getId(), "result", "Exception);
logger.error(e.getMessage());
}