Red Hat Bugzilla – Bug 1015221
Generated process which has an escalation definition uses the 'ID' attribute not the 'errorCode' to identify it in an event.
Last modified: 2016-09-20 01:04:57 EDT
Description of problem:
See linked issue.
Marco, it seems you changed the escalation handler to make sure escalations are referenced by escalationCode, not id. I believe that may be incorrect, as escalationCode is just a string type, that would mean the type of escalationRef doesn't match. I believe escalationRef in escalationEventDefinition probably needs to point to the id anyway.
It used to be like that, but you recently changed it:
I couldn't find a lot of examples, ended up bumping on one of yours even, which I believe is correct:
Would you mind taking a look at table 8.42 in the BPMN2 spec? It looks like your initial implementation was incorrect, which was why I changed it.
I also just looked in Silver's BPMN Method & Style (v2) and it says this, on page 232:
"errorCode and escalationCode are simple strings to match throw-catch pairs. Throwing events must provide it, but it is optional for boundary events."
"An Error boundaryEvent will catch any error signal with matching errorCode thrown from a child level event, and similarly for Escalation."
Unfortunately, we don't yet support "general" error and escalation boundary events because there's no way to determine the origin of a thrown error or escalation event in the jbpm engine code (and wheyther or not it's from a child level event). Ironically, this is a very similar problem what we have with compensation.
In any case, it seems pretty clear to me that escalationCode is the proper attribute to refer to the Escalation being caught.
Waiting on Kris to confirm or deny that my comments above on the spec.
I think the explanations above do make sense, and they refer to the behaviour of these nodes at runtime, but I don't think that they have any implications on the XML level that the errorCode must be used in references.
I do understand that different event nodes (throwing and catching escalation) are "paired" by using the same errorCode for both of them. However, this imho doesn't implicate that the escalationRef (that an escalationEventDefinition uses to reference its escalation element, which contains the escalationCode) must be the escalationCode, and not the id of the escalation. I believe that references must always use the id, an escalationCode simply is not unique so cannot be used for this purpose really.
So to have a paired throwing and catching escalation event, I believe either
* both events have an escalationEventDefinition referring to the same escalation (by id, so same id for both) and therefore share the same escalationCode
* both events have an escalationEventDefinition referring to a different escalation (by id, so each having a different id to refer to their specific escalation element), but these two escalations have the same escalationCode
Verified on ER5.