How to throw an escalation with dynamic information?

Is there any facility or work around in Camunda to throw an escalation that contains some dynamic information that can be accessed by the catcher? For example, process A calls B calls C. C needs to throw an escalation named ERROR to be handled by A. C has a process variable with an error message it would like to communicate up to the catcher (A). The error message is dynamic and cannot be determined at design time. What is the best way to handle this situation? I thought of these two workarounds that I am not happy with.

  1. A (the catcher) can pass down his ERROR_executionID to B and eventually C. Before C raises an exception, he can write [ EscalationCode, ExecutionID, Message] to an external DB table called ESCALATION_MESSAGE . When A catches the ERROR, he can look in this ESCALATION_MESSAGE table to find the message. This solution tightly couples the throw and catcher which seems bad. Also, it requires cleanup of old records in ESCALATION_MESSAGE.

  2. If you can assume that escalations are completely processed before the engine would persist, you could follow strategy from #1 but use thread safe Java memory structures. This still requires tight coordination between the thrower and the catcher.

I am hoping there is a better solution.

Thanks,
Rob

Hi Rib,

I think you can use variables to achieve what you are looking for. You could set basically any value to a desired catching scope.

Cheers,
Askar.