Package org.fireflow.kernel

Examples of org.fireflow.kernel.INodeInstance


            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++) {
View Full Code Here


        for (int i = 0; this.eventListeners != null && i < this.eventListeners.size(); i++) {
            IEdgeInstanceEventListener listener =  this.eventListeners.get(i);
            listener.onEdgeInstanceEventFired(e); //调用TransitionInstanceExtension 来计算弧线上的条件表达式
        }

        INodeInstance nodeInst = this.getLeavingNodeInstance(); //获取到流向哪个节点
        token.setValue(this.getWeight());//获取到弧线上的权值
        boolean alive = token.isAlive();

        nodeInst.fire(token);//节点触发

        return alive;
    }
View Full Code Here

        if (!newAlive){//循环条件不满足,则恢复token的alive标示
            token.setAlive(oldAlive);
            return newAlive;
        }else{//否则流转到下一个节点

            INodeInstance nodeInst = this.getLeavingNodeInstance();

            token.setValue(this.getWeight());
            nodeInst.fire(token);//触发同步器节点
            return newAlive;
        }
    }
View Full Code Here

TOP

Related Classes of org.fireflow.kernel.INodeInstance

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.