How to handle exception in task that is asynchronous - service task? I have tried with try and catch but it doesn’t work. I assume that job executor handles the exception but how can I see the stack trace because I need somehow to debug and read the exception message?
P.S. I have also checked the ACT_HI_JOB_LOG table and it’s empty.
@aravindhrs how can I create incident? When I surround my all code in try and catch the service never ends in catch block but it tries to retry the previous service delegate.
if the service task is marked as async, then job executor will retry for number of retries configured in bpmn. after all the retry attempts completed with unsuccessful, it will log exception if the exception caught in catch block
It should be possible to create and resolve incidents through public API.
* RuntimeService API
runtimeService.createIncident(String incidentType, String executionId, String activityId, String configuration) runtimeService.resolveIncident(String incidentId)
* DelegateExecution
execution.createIncident(String incidentType, String configuration) execution.resolveIncident(String incidentId)
* REST api enhancements
create resolve / incidents through REST api as well.
@thorben that’s what I’m trying to solve. After few analysis I saw that job executor has default wait timeout to 5 minutes and after that it fails (retries again), so my exception wouldn’t be called (I don’t know why). I have increased wait timeout to 15 minutes and that solve my problem.