Hello,
We are migrating to Camunda 8 and we would like to add a global incident handler.
Here is what we did in V7 :
@Component
public class CustomIncidentConfiguration extends AbstractProcessEnginePlugin {
private final TestService testService ;
public CustomIncidentConfiguration(TestService testService ) {
this.testService = testService ;
}
@Override
public void preInit(ProcessEngineConfigurationImpl processEngineConfiguration) {
processEngineConfiguration.setCustomIncidentHandlers(List.of(new TestIncidentHandler(testService )));
}
}
public class TestIncidentHandler extends DefaultIncidentHandler {
private final TestService testService ;
public TestIncidentHandler(TestService testService ) {
super(Incident.FAILED_JOB_HANDLER_TYPE);
this.testService = testService ;
}
@Override
public Incident handleIncident(IncidentContext incidentContext, String message) {
ExecutionEntity execution = Context.getCommandContext().getExecutionManager().findExecutionById(incidentContext.getExecutionId());
// Business code
return createIncident(incidentContext, message);
}
}
What is the equivalent in v8 ?
Thx