String fromNodeId = loop.getFromNode().getId();
if (fromNodeId != null) {
INodeInstance enteringNodeInstance = (INodeInstance) wfElementInstanceMap.get(fromNodeId);
if (enteringNodeInstance != null) {
enteringNodeInstance.addLeavingLoopInstance(loopInstance);
loopInstance.setEnteringNodeInstance(enteringNodeInstance);
}
}
String toNodeId = loop.getToNode().getId();