Map<String, Escalation> escalations = (Map<String, Escalation>)
((ProcessBuildData) parser.getData()).getMetaData("Escalations");
if (escalations == null) {
throw new IllegalArgumentException("No escalations found");
}
Escalation escalation = escalations.get(escalationRef);
if (escalation == null) {
throw new IllegalArgumentException("Could not find escalation " + escalationRef);
}
String faultName = escalation.getEscalationCode();
actionNode.setAction(new DroolsConsequenceAction("java",
"org.drools.process.instance.context.exception.ExceptionScopeInstance scopeInstance = (org.drools.process.instance.context.exception.ExceptionScopeInstance) ((org.drools.workflow.instance.NodeInstance) kcontext.getNodeInstance()).resolveContextInstance(org.drools.process.core.context.exception.ExceptionScope.EXCEPTION_SCOPE, \"" + faultName + "\");" + EOL +
"if (scopeInstance != null) {" + EOL +
" scopeInstance.handleException(\"" + faultName + "\", null);" + EOL +
"} else {" + EOL +