String fromNodeId = loopElement.getAttribute(FROM);
String toNodeId = loopElement.getAttribute(TO);
Synchronizer fromNode = (Synchronizer) wp.findWFElementById(fromNodeId);
Synchronizer toNode = (Synchronizer) wp.findWFElementById(toNodeId);
Loop loop = new Loop(wp,
loopElement.getAttribute(NAME), fromNode,
toNode);
loop.setSn(UUID.randomUUID().toString());
loop.setDisplayName(loopElement.getAttribute(DISPLAY_NAME));
loop.setDescription(Util4JAXPParser.elementAsString(loopElement,
DESCRIPTION));
Element conditionElement = Util4JAXPParser.child(loopElement, CONDITION);
loop.setCondition(conditionElement == null ? ""
: conditionElement.getTextContent());
// load extended attributes
Map<String, String> extAttrs = loop.getExtendedAttributes();
loadExtendedAttributes(extAttrs, Util4JAXPParser.child(loopElement,
EXTENDED_ATTRIBUTES));
return loop;
}