2 years ago
#36303
stphngrtz
Error / Exception handling in AbstractBpmnActivityBehavior.signal()
Errpr / Exception handling in AbstractBpmnActivityBehavior.signal()
is not the same as in AbstractBpmnActivityBehavior.execute()
. An exception being thrown in execute()
is properly handled by creating an incident (task with async-before). For signal()
this is not the case.
public class Example extends AbstractBpmnActivityBehavior {
@Override
public void execute(ActivityExecution execution) {
throw new RuntimeException(); // creates an incident
}
@Override
public void signal(ActivityExecution execution, String signalName, Object signalData) throws Exception {
throw new RuntimeException(); // doesn't create an incident
}
}
I think the reason is that while in execute()
a job exists for execution.getId()
but in signal()
it doesn't. This has been checked with the following query.
Context.getProcessEngineConfiguration().getManagementService().createJobQuery().executionId(execution.getId()).list()
Am I doing something wrong or is it just not possible to automatically create a failedJob incident by throwing an exception in signal()
?
bpmn
camunda
0 Answers
Your Answer