BpmnError - code and message access, process variable mapping

Hi All,

I am throwing an BpmnError and catching with a BoundaryErrorEvent - working fine.

How can I access the errorCode/Message afterwards in the process?

In my understanding these values are lost/not accessible after the BoundaryErrorEvent.

It would be very useful, if they are mapped e.g. to process variables.

E.g. if I have a UserTask (with a Form), do some validation/calculation in a ScriptTask afterwards and throw an BpmnError (with a specific code/message) for error handling. I want to show the error cause to the user (transported by a process variable).

Workarounds:

  • I could use an exclusive gateway after the ScriptTask and do error handling with a string array written to a provess variable (con is i create the UserTask over and over in error cases). BpmnError does a rollback, which in my opinion in this case is preferrable.
  • I can throw an Exception other than BpmnError and catch outside the process

Any suggestions how to handle such a use case?

Regars, Andreas.