BpmnError from service task and output variables

Quick question–
I have BPMN with service task. This task has some input and output variables using expression variables set by service task.
When the task execution code throws BpmnError, I see its still trying to process output parameters and fails because it does not find some variables which would have been set if service task execution has been successful. Shouldn’t output variable processing be skipped if service task throws BpmnError?

Thanks.

Hi @pankaj,

this behavior is similar to the output mapping of call activities. It is implemented is this way because the error may be caught by a boundary event or event subprocess which requires the variables from the output mapping.

Best regards,
Philipp