Package org.fireflow.model.net

Examples of org.fireflow.model.net.Transition


            wfElementInstanceMap.put(endNode.getId(), endNodeInstance);
        }
        //转移线
        List<Transition> transitions = workflowProcess.getTransitions();
        for (int i = 0; i < transitions.size(); i++) {
            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);
View Full Code Here


            String condition = transInst.getTransition().getCondition();
           
            calculateTheAliveValue(token, condition);

            if (rtCtx.isEnableTrace() && token.isAlive()) {
                Transition transition = transInst.getTransition();
                IWFElement fromNode = transition.getFromNode();
                int minorNumber = 1;
                if (fromNode instanceof Activity){
                    minorNumber=2;
                }else{
                    minorNumber =1;
View Full Code Here

        transitions.clear();

        Iterator<Element> iter = elements.iterator();
        while (iter.hasNext()) {
            Element transitionElement =  iter.next();
            Transition transition = createTransition(wp, transitionElement);
            transitions.add(transition);
            Node fromNode = transition.getFromNode();
            Node toNode = transition.getToNode();
            if (fromNode != null && (fromNode instanceof Activity)) {
                ((Activity) fromNode).setLeavingTransition(transition);
            } else if (fromNode != null && (fromNode instanceof Synchronizer)) {
                ((Synchronizer) fromNode).getLeavingTransitions().add(
                        transition);
View Full Code Here

        String fromNodeId = element.attributeValue(FROM);
        String toNodeId = element.attributeValue(TO);
        Node fromNode = (Node) wp.findWFElementById(fromNodeId);
        Node toNode = (Node) wp.findWFElementById(toNodeId);

        Transition transition = new Transition(wp,
                element.attributeValue(NAME), fromNode,
                toNode);
        transition.setSn(UUID.randomUUID().toString());

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

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

        return transition;
    }
View Full Code Here

      }
    }

    List<Transition> transitionList = this.getTransitions();
    for (int i = 0; i < transitionList.size(); i++) {
      Transition transition = transitionList.get(i);
      if (transition.getId().equals(id)) {
        return transition;
      }
    }

    List<DataField> dataFieldList = this.getDataFields();
View Full Code Here

      }
    }

    List<Transition> transitions = this.getTransitions();
    for (int i = 0; i < transitions.size(); i++) {
      Transition transition = transitions.get(i);
      String theName = (transition.getDisplayName() == null || transition
          .getDisplayName().equals("")) ? transition.getName()
          : transition.getDisplayName();
      if (transition.getFromNode() == null) {
        return errHead + "transition[" + theName
            + "] must have from node.";

      }
      if (transition.getToNode() == null) {
        return errHead + "transition[" + theName
            + "] must have to node.";
      }
    }
View Full Code Here

  public List<Node> getReachableNodes(String nodeId) {
    List<Node> reachableNodesList = new ArrayList<Node>();
    Node node = (Node) this.findWFElementById(nodeId);
    if (node instanceof Activity) {
      Activity activity = (Activity) node;
      Transition leavingTransition = activity.getLeavingTransition();
      if (leavingTransition != null) {
        Node toNode = leavingTransition.getToNode();
        if (toNode != null) {
          reachableNodesList.add(toNode);
          reachableNodesList.addAll(getReachableNodes(toNode.getId()));
        }
      }
    } else if (node instanceof Synchronizer) {
      Synchronizer synchronizer = (Synchronizer) node;
      List<Transition> leavingTransitions = synchronizer.getLeavingTransitions();
      for (int i = 0; leavingTransitions != null
          && i < leavingTransitions.size(); i++) {
        Transition leavingTransition =  leavingTransitions.get(i);
        if (leavingTransition != null) {
          Node toNode = (Node) leavingTransition.getToNode();
          if (toNode != null) {
            reachableNodesList.add(toNode);
            reachableNodesList.addAll(getReachableNodes(toNode.getId()));
          }
View Full Code Here

  public List<Node> getEnterableNodes(String nodeId) {
    List<Node> enterableNodesList = new ArrayList<Node>();
    Node node = (Node) this.findWFElementById(nodeId);
    if (node instanceof Activity) {
      Activity activity = (Activity) node;
      Transition enteringTransition = activity.getEnteringTransition();
      if (enteringTransition != null) {
        Node fromNode = enteringTransition.getFromNode();
        if (fromNode != null) {
          enterableNodesList.add(fromNode);
          enterableNodesList.addAll(getEnterableNodes(fromNode.getId()));
        }
      }
    } else if (node instanceof Synchronizer) {
      Synchronizer synchronizer = (Synchronizer) node;
      List<Transition> enteringTransitions = synchronizer.getEnteringTransitions();
      for (int i = 0; enteringTransitions != null
          && i < enteringTransitions.size(); i++) {
        Transition enteringTransition =  enteringTransitions.get(i);
        if (enteringTransition != null) {
          Node fromNode = enteringTransition.getFromNode();
          if (fromNode != null) {
            enterableNodesList.add(fromNode);
            enterableNodesList.addAll(getEnterableNodes(fromNode.getId()));
          }
View Full Code Here

        transitions.clear();

        Iterator<Element> iter = elements.iterator();
        while (iter.hasNext()) {
            Element transitionElement = iter.next();
            Transition transition = createTransition(wp, transitionElement, nodeMap);
            transitions.add(transition);
            Node fromNode = transition.getFromNode();
            Node toNode = transition.getToNode();
            if (fromNode != null && (fromNode instanceof Activity)) {
                ((Activity) fromNode).setLeavingTransition(transition);
            } else if (fromNode != null && (fromNode instanceof Synchronizer)) {
                ((Synchronizer) fromNode).getLeavingTransitions().add(
                        transition);
View Full Code Here

        String fromNodeId = element.getAttribute(FROM);
        String toNodeId = element.getAttribute(TO);
        Node fromNode = nodeMap.get(fromNodeId);
        Node toNode = nodeMap.get(toNodeId);

        Transition transition = new Transition(wp,
                element.getAttribute(NAME), fromNode,
                toNode);
        transition.setSn(UUID.randomUUID().toString());

        transition.setDisplayName(element.getAttribute(DISPLAY_NAME));
        transition.setDescription(Util4JAXPParser.elementAsString(element,
                DESCRIPTION));
        Element conditionElement = Util4JAXPParser.child(element, CONDITION);
        transition.setCondition(conditionElement == null ? ""
                : conditionElement.getTextContent());

        // load extended attributes
        Map<String, String> extAttrs = transition.getExtendedAttributes();
        loadExtendedAttributes(extAttrs, Util4JAXPParser.child(element,
                EXTENDED_ATTRIBUTES));

        return transition;
    }
View Full Code Here

TOP

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

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.