Transition transition = transitions.get(i);
TransitionInstance transitionInstance = new TransitionInstance(transition);
String fromNodeId = transition.getFromNode().getId();
if (fromNodeId != null) {
INodeInstance enteringNodeInstance = (INodeInstance) wfElementInstanceMap.get(fromNodeId);
if (enteringNodeInstance != null) {
enteringNodeInstance.addLeavingTransitionInstance(transitionInstance);
transitionInstance.setEnteringNodeInstance(enteringNodeInstance);
}
}
String toNodeId = transition.getToNode().getId();
if (toNodeId != null) {
INodeInstance leavingNodeInstance = (INodeInstance) wfElementInstanceMap.get(toNodeId);
if (leavingNodeInstance != null) {
leavingNodeInstance.addEnteringTransitionInstance(transitionInstance);
transitionInstance.setLeavingNodeInstance(leavingNodeInstance);
}
}
extensionList = kenelExtensions.get(transitionInstance.getExtensionTargetName());
for (int j = 0; extensionList != null && j < extensionList.size(); j++) {
IKernelExtension extension = extensionList.get(j);
transitionInstance.registExtension(extension);
}
wfElementInstanceMap.put(transitionInstance.getId(), transitionInstance);
}
//循环线
List<Loop> loops = workflowProcess.getLoops();
for (int i = 0; i < loops.size(); i++) {
Loop loop = loops.get(i);
LoopInstance loopInstance = new LoopInstance(loop);
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();
if (toNodeId != null) {
INodeInstance leavingNodeInstance = (INodeInstance) wfElementInstanceMap.get(toNodeId);
if (leavingNodeInstance != null) {
leavingNodeInstance.addEnteringLoopInstance(loopInstance);
loopInstance.setLeavingNodeInstance(leavingNodeInstance);
}
}
extensionList = kenelExtensions.get(loopInstance.getExtensionTargetName());
for (int j = 0; extensionList != null && j < extensionList.size(); j++) {