Package org.jbpm.graph.def

Examples of org.jbpm.graph.def.Node


      "  <node name='b' />" +
      "  <action name='scratch' class='com.itch.Scratch' />" +
      "</process-definition>"
    );
   
    Node node = processDefinition.getNode("a");
    Transition transition = node.getDefaultLeavingTransition();
    Event event = transition.getEvent(Event.EVENTTYPE_TRANSITION);
    Action transitionAction = (Action) event.getActions().iterator().next();
   
    Action processAction = processDefinition.getAction("scratch");
    assertEquals("scratch", processAction.getName());
View Full Code Here


   */
  public void end(String transitionName) {
    Transition leavingTransition = null;
   
    if (task!=null) {
      Node node = task.getTaskNode();
      if (node==null) {
        node = (Node) task.getParent();
      }

      if (node!=null) {
        leavingTransition = node.getLeavingTransition(transitionName);
      }
    }
    if (leavingTransition==null) {
      throw new NullPointerException("task node does not have leaving transition '"+transitionName+"'");
    }
View Full Code Here

    // pass the token over the selected transition
    token.getNode().leave(executionContext, nextTransition);
  }

  protected Collection getTransitionNames(Token token) {
    Node node = token.getNode();
    return node.getLeavingTransitionsMap().keySet();
  }
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 NullPointerException if text is null.
   */
  public static Node createNode(String text) {
    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

    graphSession.saveProcessDefinition(processDefinition);

    ProcessInstance processInstance = new ProcessInstance(processDefinition);
    processInstance = saveAndReload(processInstance);
   
    Node s = processInstance.getProcessDefinition().getStartState();
   
    assertSame(s , processInstance.getRootToken().getNode());
  }
View Full Code Here

    transitionLog = (TransitionLog) saveAndReload(transitionLog);
    assertNotNull(transitionLog.getTransition());
  }

  public void testTransitionLogSourceNode() {
    Node sourceNode = new Node();
    session.save(sourceNode);
   
    TransitionLog transitionLog = new TransitionLog(null, sourceNode);
    transitionLog = (TransitionLog) saveAndReload(transitionLog);
    assertNotNull(transitionLog.getSourceNode());
View Full Code Here

    transitionLog = (TransitionLog) saveAndReload(transitionLog);
    assertNotNull(transitionLog.getSourceNode());
  }

  public void testTransitionLogDestinationNode() {
    Node destinationNode = new Node();
    session.save(destinationNode);
   
    TransitionLog transitionLog = new TransitionLog(null, null);
    transitionLog.setDestinationNode(destinationNode);
    transitionLog = (TransitionLog) saveAndReload(transitionLog);
View Full Code Here

import org.jbpm.graph.def.Node;

public class NodeLogDbTest extends AbstractDbTestCase {

  public void testNodeLogNode() {
    Node node = new Node();
    session.save(node);
    NodeLog nodeLog = new NodeLog(node, new Date(), new Date());
   
    nodeLog = (NodeLog) saveAndReload(nodeLog);
    assertNotNull(nodeLog.getNode());
View Full Code Here

    nodeLog = (NodeLog) saveAndReload(nodeLog);
    assertNotNull(nodeLog.getNode());
  }

  public void testNodeLogEnterDate() {
    Node node = new Node();
    session.save(node);

    Date enter = new Date();
    Date leave = new Date(enter.getTime()+5);
    NodeLog nodeLog = new NodeLog(node, enter, leave);
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.