Hello,
When i’m in External Task, could i acces to the process cycle, exemple i want to obtain the current process instance and create an incident.
client.subscribe("myExtTsk")
.lockDuration(1000)
.handler((externalTask, externalTaskService) -> {
System.out.println("The External Task is started ");
try {
// if no problem i complete task
externalTaskService.complete(externalTask);
}catch(Exception e){
// if there is problem i want to create an incident and throw error
/*
THIS IS WHAT I WANT TO DO BUT COULD NOT :
externalTask.getProcessInstance().createIncident("10","a problem is occured");
*/
throw new BpmnError("Problem while executing service");
}
System.out.println("The External Task is completed");
}).open();
Thanks
Samir