List<Element> transitionElements = XmlUtil.elements(element, "transition");
ActivityImpl activity = parse.findObject(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")) {
String expr = conditionElement.getAttribute("expr");
String lang = XmlUtil.attribute(conditionElement, "expr-lang");
ExpressionEvaluatorDescriptor expressionDescriptor = new ExpressionEvaluatorDescriptor(expr, lang);
transition.setConditionDescriptor(expressionDescriptor);
} else if (conditionElement.hasAttribute("ref")) {
String expr = conditionElement.getAttribute("ref");
ReferenceDescriptor refDescriptor = new ReferenceDescriptor(expr);
transition.setConditionDescriptor(refDescriptor);
} else if (ObjectBinding.isObjectDescriptor(conditionElement)) {
ObjectDescriptor conditionDescriptor = (ObjectDescriptor) objectBinding.parse(conditionElement, parse, parser);
transition.setConditionDescriptor(conditionDescriptor);
}
}
}
if (hasConditions) {