Hello,
I am trying to do externalTaskService.handleBpmnError(externalTask, “error”),but i have org.camunda.bpm.client.exception.NotResumedException: TASK/CLIENT-01009 Exception while notifying a BPMN error: The corresponding process instance could not be resumed. Reason: status code: 500, reason phrase: {“type”:“ProcessEngineException”,“message”:"ENGINE-13033 Propagation of bpmn error error failed. "}
I am using workflow and subworkflows.When i used only one main workflow all works fine.
The camunda process starts, I get into the first task.
The error occurs during the execution of the second externalTask.
How should I change the schema so that the error is caught in the main workflow?
It is possible to throw an error in a subrocess and catch in the sorrounding process, i.e., it is possible to throw an error in “1 task” and catch it by the boundary event on the VALIDATION subprocess. You need to configure the boundary event according to the error that is thrown, i.e., when invoking externalTaskService.handleBpmnError(externalTask, “error”) “error” refers to your Error code. This needs to be matched by the event’s definition:
The following processes make use of this configuration: subprocess.bpmn (2.3 KB) superProcess.bpmn (5.9 KB)
The external Task worker is defined as follows:
import org.camunda.bpm.client.spring.annotation.ExternalTaskSubscription;
import org.camunda.bpm.client.task.ExternalTask;
import org.camunda.bpm.client.task.ExternalTaskHandler;
import org.camunda.bpm.client.task.ExternalTaskService;
import org.springframework.stereotype.Component;
@Component
@ExternalTaskSubscription("SERVICE_TASK") // create a subscription for this topic name
public class TaskClientThrowingError implements ExternalTaskHandler {
@Override
public void execute(ExternalTask externalTask, ExternalTaskService externalTaskService) {
externalTaskService.handleBpmnError(externalTask, "SubprocessError");
}
}
The subprocess throws an error, which is caught by the boundary event, which enables the user task handle error.
Thanks StephanHaarmann for you suggestion, but it’s will not work, because externalTaskService.handleBpmnError(externalTask, “SubprocessError”) ends with an error and the boundary event cannot catch this error. The problem is that boundary event does not catch this error.
If configured correctly, the error thrown via externalTaskService.handleBpmnError(externalTask, “SubprocessError”) will be caught by the boundary event. As demonstrated in my example.
Check whether the configuration matches. The following resources may be useful:
If this is not what you intended, please let me know.
Yes,but i can’t thrown via `externalTaskService.handleBpmnError because i have problem when make call externalTaskService.handleBpmnError - The corresponding process instance could not be resumed.
This error occurs if no matching “Error catch event” is found.
Do you also receive the error when executing my example? Can you provide your BPMN files?
I changed subProcess but i still have the same issue- rg.camunda.bpm.client.exception.NotResumedException: TASK/CLIENT-01009 Exception while notifying a BPMN error: The corresponding process instance could not be resumed. Reason: status code: 500, reason phrase: {“type”:“ProcessEngineException”,“message”:"ENGINE-13033 Propagation of bpmn error taskName failed. "} subProcess.bpmn (5.5 KB)
It’s my mistake - Instead of taskName, there should be either an error code (error) or a topicName name, they are the same for my implementation - rg.camunda.bpm.client.exception.NotResumedException: TASK/CLIENT-01009 Exception while notifying a BPMN error: The corresponding process instance could not be resumed. Reason: status code: 500, reason phrase: {“type”:“ProcessEngineException”,“message”:"ENGINE-13033 Propagation of bpmn error error failed. "}
An error that is thrown should be caught. In your example, “call-task” is an external task, that throws an error, which is caught by the boundary event of the enclosing subprocess. When the outgoing sequence-flow leads to an error end event, a new error is thrown, which in-turn should be caught - Solution 1: for example in your green subprocess.
Solution 2: If this is intended, you can even get rid of both error event on your uncolored subprocess and the error will be propagated to the green parent process, where it can be caught.
Let me walk you step-by-step through both solutions.
Solution 1: I recreated your two processes. I linked the two processes via the call activities:
Solution 2: I’m using the two bpmn files you provided earlier, so that “1 task” and “2 task” of the super process are calling the suprocess with “call task”. Therefore, I configured “1 task” as follows:
I simplified the mapping and conditions because I don’t know your data.
The external worker throws an error named “error”. To catch this error, I configured the boundary event of the green process as follows:
Thanks,It worked. For super process need added asynchronous after for task 1 and without error boundary event in subProcess it’s not worked.But second task work correctly without error boundary event in subProcess and without asynchronous. PartOfSuperProcess.bpmn (8.9 KB) subProcess.bpmn (5.6 KB)