}
Element handlerElement = XmlUtil.element(element, "handler");
if (handlerElement!=null) {
DecisionHandlerActivity decisionHandlerActivity = new DecisionHandlerActivity();
UserCodeReference decisionHandlerReference = parser.parseUserCodeReference(handlerElement, parse);
decisionHandlerActivity.setDecisionHandlerReference(decisionHandlerReference);
return decisionHandlerActivity;
}
boolean hasConditions = false;
List<Element> transitionElements = XmlUtil.elements(element, "transition");
ActivityImpl activity = parse.contextStackFind(ActivityImpl.class);
List<TransitionImpl> transitions = (List) activity.getOutgoingTransitions();
for (int i=0; i<transitionElements.size(); i++) {
TransitionImpl transition = transitions.get(i);
Element transitionElement = transitionElements.get(i);
Element conditionElement = XmlUtil.element(transitionElement, "condition");
if (conditionElement!=null) {
hasConditions = true;
if (conditionElement.hasAttribute("expr")) {
ExpressionCondition expressionCondition = new ExpressionCondition();
expressionCondition.setExpression(conditionElement.getAttribute("expr"));
expressionCondition.setLanguage(XmlUtil.attribute(conditionElement, "lang"));
transition.setCondition(expressionCondition);
} else {
Element conditionHandlerElement = XmlUtil.element(conditionElement, "handler");
if (handlerElement!=null) {
UserCodeCondition userCodeCondition = new UserCodeCondition();
UserCodeReference conditionReference = parser.parseUserCodeReference(conditionHandlerElement, parse);
userCodeCondition.setConditionReference(conditionReference);
transition.setCondition(userCodeCondition);
}
}