I have a case where an external task is calling externalTaskService.complete but there is an end Listener registered on the service task as a delegate expression that executes a java class. That does in certain cases throw an BpmnError. This does not appear to work as the complete call fails with this exception.
org.camunda.bpm.client.exception.NotResumedException: TASK/CLIENT-01009 Exception while completing the external task: The corresponding process instance could not be resumed
The problem i’m trying to solve with this maybe slightly strange process is that I want to set proccess variables back to the camunda context from a external worker and also calling externalTaskService.handleBpmnError.
I can’t find a way to do this as this only appears to work with the complete method call.
That’s why I came up with the idea about throwing an BpmnError from the end listener…
Is there any other way of setting variable back in the camunda context from an external worker and at the same time throw an BPMN error?