Package org.fireflow.model.net

Examples of org.fireflow.model.net.Loop


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


        String fromNodeId = loopElement.attributeValue(FROM);
        String toNodeId = loopElement.attributeValue(TO);
        Synchronizer fromNode = (Synchronizer) wp.findWFElementById(fromNodeId);
        Synchronizer toNode = (Synchronizer) wp.findWFElementById(toNodeId);

        Loop loop = new Loop(wp,
                loopElement.attributeValue(NAME), fromNode,
                toNode);
        loop.setSn(UUID.randomUUID().toString());

        loop.setDisplayName(loopElement.attributeValue(DISPLAY_NAME));
        loop.setDescription(Util4Parser.elementAsString(loopElement,
                DESCRIPTION));
        Element conditionElement = Util4Parser.child(loopElement, CONDITION);
        loop.setCondition(conditionElement == null ? ""
                : conditionElement.getStringValue());

        // load extended attributes
        Map<String, String> extAttrs = loop.getExtendedAttributes();
        loadExtendedAttributes(extAttrs, Util4Parser.child(loopElement,
                EXTENDED_ATTRIBUTES));

        return loop;
    }
View Full Code Here

        loops.clear();

        Iterator<Element> iter = loopElementList.iterator();
        while (iter.hasNext()) {
            Element loopElement = iter.next();
            Loop loop = createLoop(wp, loopElement);
            loops.add(loop);



            Synchronizer fromNode = (Synchronizer)loop.getFromNode();
            Synchronizer toNode = (Synchronizer)loop.getToNode();

            fromNode.getLeavingLoops().add(loop);
            toNode.getEnteringLoops().add(loop);
        }
     }
View Full Code Here

        Element transitionsElement = Util4Serializer.addElement(parent,
                LOOPS);

        Iterator<Loop> iter = loops.iterator();
        while (iter.hasNext()) {
            Loop loop = iter.next();

            Element loopElement = Util4Serializer.addElement(transitionsElement,
                    LOOP);

            loopElement.addAttribute(ID, loop.getId());
            loopElement.addAttribute(FROM, loop.getFromNode().getId());
            loopElement.addAttribute(TO, loop.getToNode().getId());

            loopElement.addAttribute(NAME, loop.getName());
            loopElement.addAttribute(DISPLAY_NAME, loop.getDisplayName());

            Util4Serializer.addElement(loopElement, CONDITION, loop.getCondition());

            writeExtendedAttributes(loop.getExtendedAttributes(),
                    loopElement);
        }
    }
View Full Code Here

        Element transitionsElement = Util4JAXPSerializer.addElement(document, parent,
                LOOPS);

        Iterator<Loop> iter = loops.iterator();
        while (iter.hasNext()) {
            Loop loop = iter.next();

            Element loopElement = Util4JAXPSerializer.addElement(document, transitionsElement,
                    LOOP);

            loopElement.setAttribute(ID, loop.getId());
            loopElement.setAttribute(FROM, loop.getFromNode().getId());
            loopElement.setAttribute(TO, loop.getToNode().getId());

            loopElement.setAttribute(NAME, loop.getName());
            loopElement.setAttribute(DISPLAY_NAME, loop.getDisplayName());

            Util4JAXPSerializer.addElement(document, loopElement, CONDITION, loop.getCondition());

            writeExtendedAttributes(loop.getExtendedAttributes(),
                    loopElement, document);
        }
    }
View Full Code Here

      }
    }

    List<Loop> loopList = this.getLoops();
    for (int i = 0; i < loopList.size(); i++) {
      Loop loop = loopList.get(i);
      if (loop.getId().equals(id)) {
        return loop;
      }
    }
    return null;
  }
View Full Code Here

        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;
    }
View Full Code Here

        loops.clear();

        Iterator<Element> iter = loopElementList.iterator();
        while (iter.hasNext()) {
            Element loopElement =  iter.next();
            Loop loop = createLoop(wp, loopElement);
            loops.add(loop);

            Synchronizer fromNode = (Synchronizer) loop.getFromNode();
            Synchronizer toNode = (Synchronizer) loop.getToNode();

            fromNode.getLeavingLoops().add(loop);
            toNode.getEnteringLoops().add(loop);
        }
    }
View Full Code Here

        assertNotNull(result);

        assertEquals(1, result.getLoops().size());

        Loop loop = (Loop)result.getLoops().get(0);
        assertNotNull(loop.getCondition());

        Synchronizer sync1 = (Synchronizer)result.findWFElementById(synchronizer1Id);
        assertEquals(1,sync1.getEnteringLoops().size());
        assertEquals(0,sync1.getLeavingLoops().size());
View Full Code Here

        assertNotNull(result);

        assertEquals(1, result.getLoops().size());

        Loop loop = (Loop)result.getLoops().get(0);
        assertNotNull(loop.getCondition());

        Synchronizer sync1 = (Synchronizer)result.findWFElementById(synchronizer1Id);
        assertEquals(1,sync1.getEnteringLoops().size());
        assertEquals(0,sync1.getLeavingLoops().size());
View Full Code Here

TOP

Related Classes of org.fireflow.model.net.Loop

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.