Package org.jbpm.graph.def

Examples of org.jbpm.graph.def.Node


      String nodeName = nodeElement.getName();
      // get the node type
      Class nodeType = NodeTypes.getNodeType(nodeName);
      if (nodeType!=null) {

        Node node = null;
        try {
          // create a new instance
          node = (Node) nodeType.newInstance();
        } catch (Exception e) {
          log.error("couldn't instantiate node '"+nodeName+"', of type '"+nodeType.getName()+"'", e);
        }
       
        node.setProcessDefinition(processDefinition);
       
        // check for duplicate start-states
        if ( (node instanceof StartState)
             && (processDefinition.getStartState()!=null)
           ) {
          addError("max one start-state allowed in a process");
         
        } else {
          // read the common node parts of the element
          readNode(nodeElement, node, nodeCollection);
       
          // if the node is parsable
          // (meaning: if the node has special configuration to parse, other then the
          //  common node data)
          node.read(nodeElement, this);
        }
      }
    }
  }
View Full Code Here


  public void resolveTransitionDestinations() {
    Iterator iter = unresolvedTransitionDestinations.iterator();
    while (iter.hasNext()) {
      Object[] unresolvedTransition = (Object[]) iter.next();
      Element nodeElement = (Element) unresolvedTransition[0];
      Node node = (Node) unresolvedTransition[1];
      resolveTransitionDestinations(nodeElement.elements("transition"), node);
    }
  }
View Full Code Here

    // set destinationNode of the transition
    String toName = transitionElement.attributeValue("to");
    if (toName==null) {
      addWarning("node '"+node.getFullyQualifiedName()+"' has a transition without a 'to'-attribute to specify its destinationNode");
    } else {
      Node to = ((NodeCollection)node.getParent()).findNode(toName);
      if (to==null) {
        addWarning("transition to='"+toName+"' on node '"+node.getFullyQualifiedName()+"' cannot be resolved");
      } else {
        to.addArrivingTransition(transition);
      }
    }
   
    // read the actions
    readActions(transitionElement, transition, Event.EVENTTYPE_TRANSITION);
View Full Code Here

    }

    startCompositeLog(new SignalLog(transition));
    try {
      // fire the event before-signal
      Node signalNode = node;
      signalNode.fireEvent(Event.EVENTTYPE_BEFORE_SIGNAL, executionContext);
     
      // start calculating the next state
      node.leave(executionContext, transition);
     
      // if required, check if this token is implicitly terminated
      checkImplicitTermination();
     
      // fire the event after-signal
      signalNode.fireEvent(Event.EVENTTYPE_AFTER_SIGNAL, executionContext);
     
    } finally {
      endCompositeLog();
    }
  }
View Full Code Here

      pd.addNode( createNode( nodes[i] ) );
    }

    for ( int i = 0; i < transitions.length; i++ ) {
      String[] parsedTransition = cutTransitionText( transitions[i] );
      Node from = pd.getNode( parsedTransition[0] );
      Node to = pd.getNode( parsedTransition[2] );
      Transition t = new Transition( parsedTransition[1] );
      from.addLeavingTransition(t);
      to.addArrivingTransition(t);
    }
  }
View Full Code Here

   * @throws JbpmException if text is null.
   */
  public static Node createNode(String text) {
    if (text==null) throw new JbpmException("text is null");
   
    Node node = null;
   
    String typeName = null;
    String name = null;
   
    text = text.trim();
    int spaceIndex = text.indexOf(' ');
    if (spaceIndex!=-1) {
      typeName = text.substring(0, spaceIndex);
      name = text.substring(spaceIndex + 1);
    } else {
      typeName = text;
      name = null;
    }

    Class nodeType = NodeTypes.getNodeType(typeName);
    if ( nodeType==null ) throw new IllegalArgumentException("unknown node type name '" + typeName + "'");
    try {
      node = (Node) nodeType.newInstance();
      node.setName(name);
    } catch (Exception e) {
      throw new JbpmException("couldn't instantiate nodehandler for type '" + typeName + "'");
    }
    return node;
  }
View Full Code Here

    * Get the current Node of the pageflow.
    */
   public Node getNode()
   {
      if (processInstance==null) return null;
      Node node = getSubProcessInstance().getRootToken().getNode();
      if (node==null)
      {
         throw new IllegalStateException("pageflow has not yet started");
      }
      return node;
View Full Code Here

      if (processInstance==null)
      {
         throw new IllegalStateException("no pageflow in progress");
      }
      ProcessInstance subProcess = getSubProcessInstance();
      Node node = subProcess.getProcessDefinition().getNode(nodeName);
      if (node==null)
      {
         throw new IllegalArgumentException(
               "no node named: " + nodeName +
               " for pageflow: " + subProcess.getProcessDefinition().getName()
View Full Code Here

   /**
    * Get the current Page of the pageflow.
    */
   public Page getPage()
   {
      Node node = getNode();
      if ( node!=null && !(node instanceof Page) )
      {
         throw new IllegalStateException("pageflow is not currently at a <page> or <start-page> node (note that pageflows that begin during the RENDER_RESPONSE phase should use <start-page> instead of <start-state>)");
      }
      return (Page) node;
View Full Code Here

   }
  
   public String getNoConversationViewId(String pageflowName, String pageflowNodeName)
   {
      ProcessDefinition pageflowProcessDefinition = getPageflowProcessDefinition(pageflowName);
      Node node = pageflowProcessDefinition.getNode(pageflowNodeName);
      if (node!=null && node instanceof Page)
      {
         return ( (Page) node ).getNoConversationViewId();
      }
      else
View Full Code Here

TOP

Related Classes of org.jbpm.graph.def.Node

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.