Pass BPMN Error Variables between two external tasks

HI

I am throwing a BPMN errror from the External tasks line mentioned Below
new BPMNError(“error1”,“error2”) and my catch boundary event is matched and moves on to Next External Service tasks
but i am not able to pass the value error1 to the new tasks which is called after the error boundary event , what variable can i use to get the value ? what i am trying to do is based on the value i would like to route it

Any help is appreciated

Vish

In the error boundary event, you should set the property “Error Code Variable”. This is the name under which the engine will save the code of the BpmnError in the process data, i.e. in the following steps you can read it as a variable of type String.

BTW: This is only necessary if your boundary error event catches many codes. If it only catches one particular code then you don’t have any variance at this place.