Hello
I have a JavaDelegate which can throw different kinds of exceptions. When that happens and there is no error boundary event in the BPMN model capturing it, an incident is created. So far so good.
When I try to resolve the incident by executing the corresponding job and a different exception is thrown in the JavaDelegate, I would like the incident to be replaced with the new error. But what happens is that the REST call which executes the job returns with the new error. I assume this is because the transaction executing the job is not committed. Is there any way to influence that behavior? The service task has async, asyncBefore and asyncAfter set. I’ve tried to delete the incident before executing the job which resulted in the error “Cannot resolve an incident of type failedJob”.
Thanks!
Yves
edit: I have found a workaround that kind of works. If I set the retries of the job to 1 the incident disappears and the job executor picks the job up again. It’s a bit slower since I don’t trigger the job directly. Is this a valid way of dealing with an incident?