if an activity throws a BpmnError, then an error boundary event can be attached to the activity to “catch” it and let the process continue at a specific path. Along with the error event, two data elements are passed: the error code and the error message.
But what if I want to pass more data with the error event? E.g. some complex java object? How would I do that?
My only idea so far has been the following: Just before throwing a BpmnError in the activity’s code, I’d set the data to pass along with the error as a process variable, e.g. via
execution.setVariable("myErrorInfo", errorData). Then the steps on the path starting with the error boundary event will be able to access that data via
Is this the recommended way? How do you do that?
Thank you for your insights.