Package org.jbpm.graph.def

Examples of org.jbpm.graph.def.Node


      "  <start-state name='start' />" +
      "</process-definition>");
 
    processDefinition = saveAndReload(processDefinition);
 
    Node startState = processDefinition.getNode("start");
    assertEquals("start", startState.getName());
    assertSame(startState, processDefinition.getStartState());
  }
View Full Code Here


      "    </event>\n" +
      "  </state>\n" +
      "</process-definition>"
    );
   
    Node node = processDefinition.getNode("a");
    Event event = node.getEvent("node-enter");
    Action action = (Action) event.getActions().iterator().next();
    Delegation instantiatableDelegate = action.getActionDelegation();
    assertEquals("org.foo.Burps", instantiatableDelegate.getClassName());
    assertEquals("constructor", instantiatableDelegate.getConfigType());
    assertTrue(instantiatableDelegate.getConfiguration().indexOf("this text should be passed in the constructor")!=-1 );
View Full Code Here

      "  </state>" +
      "  <state name='b' />" +
      "</process-definition>"
    );
   
    Node node = processDefinition.getNode("a");
    assertEquals( 1, node.getLeavingTransitionsMap().size() );
    Transition transition = node.getDefaultLeavingTransition();
    Event event = transition.getEvent(Event.EVENTTYPE_TRANSITION);
    Action action = (Action) event.getActions().iterator().next();
    Delegation instantiatableDelegate = action.getActionDelegation();
    assertEquals("org.foo.Burps", instantiatableDelegate.getClassName());
  }
View Full Code Here

  catch(JpdlException je)
  {
    fail("XML did not pass validation as expected:\n" + je.toString());
  }
   
    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

      "    </script>" +
      "  </node>" +
      "</process-definition>"
    );
   
    Node node = processDefinition.getNode("a");
    Script script = (Script) node.getAction();
   
    assertEquals( 3, script.getVariableAccesses().size() );
    assertEquals("e = m * Math.pow(c,2);", script.getExpression() );
  }
View Full Code Here

  static List nodes = new ArrayList();
 
  public static class RecordNode implements ActionHandler {
    private static final long serialVersionUID = 1L;
    public void execute(ExecutionContext executionContext) throws Exception {
      Node node = executionContext.getNode();
      nodes.add(node.getName());
      node.leave(executionContext);
    }
View Full Code Here

    assertEquals("burps", burps.getName());
  }

  public void testWriteNodeActionName() throws Exception {
    ProcessDefinition processDefinition = new ProcessDefinition();
    Node node = processDefinition.addNode( new Node() );
    Delegation instantiatableDelegate = new Delegation();
    instantiatableDelegate.setClassName("com.foo.Fighting");
    node.setAction(new Action(instantiatableDelegate));
   
    Element actionElement = AbstractXmlTestCase.toXmlAndParse( processDefinition, "/process-definition/node/action" );
    assertNotNull(actionElement);
    assertEquals("action", actionElement.getName());
    assertEquals("com.foo.Fighting", actionElement.attributeValue("class"));
View Full Code Here

    assertEquals("org.foo.Burps", ((Action)processDefinition.getNode("a").getEvent("node-enter").getActions().get(0)).getActionDelegation().getClassName());
  }

  public void testWriteNodeEnterAction() throws Exception {
    ProcessDefinition processDefinition = new ProcessDefinition();
    Node node = processDefinition.addNode( new Node() );
    Delegation instantiatableDelegate = new Delegation();
    instantiatableDelegate.setClassName("com.foo.Fighting");
    node.addEvent(new Event("node-enter")).addAction(new Action(instantiatableDelegate));
    Element element = AbstractXmlTestCase.toXmlAndParse( processDefinition, "/process-definition/node[1]/event[1]" );
   
    assertNotNull(element);
    assertEquals("event", element.getName());
    assertEquals("node-enter", element.attributeValue("type"));
View Full Code Here

      "    </event>" +
      "  </state>" +
      "</process-definition>"
    );
   
    Node node = processDefinition.getNode("a");
    Event event = node.getEvent("node-enter");
    Action action = (Action) event.getActions().iterator().next();
    Delegation instantiatableDelegate = action.getActionDelegation();
    assertEquals("org.foo.Burps", instantiatableDelegate.getClassName());
    assertEquals("constructor-text", instantiatableDelegate.getConfigType());
    assertTrue(instantiatableDelegate.getConfiguration().indexOf("this text should be passed in the constructor")!=-1 );
View Full Code Here

      "  </state>" +
      "  <state name='b' />" +
      "</process-definition>"
    );
   
    Node node = processDefinition.getNode("a");
    assertEquals( 1, node.getLeavingTransitionsMap().size() );
    Transition transition = node.getDefaultLeavingTransition();
    Event event = transition.getEvent(Event.EVENTTYPE_TRANSITION);
    Action action = (Action) event.getActions().iterator().next();
    Delegation instantiatableDelegate = action.getActionDelegation();
    assertEquals("org.foo.Burps", instantiatableDelegate.getClassName());
  }
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.