Package org.jbpm.graph.node

Examples of org.jbpm.graph.node.StartState


    assertEquals("start", processDefinition.getStartState().getName());
  }

  public void testWriteStartState() throws Exception {
    ProcessDefinition processDefinition = new ProcessDefinition();
    processDefinition.setStartState( new StartState() );
    Element element = AbstractXmlTestCase.toXmlAndParse( processDefinition, "/process-definition/start-state[1]" );
    assertNotNull(element);
    assertEquals("start-state", element.getName());
    assertEquals(0, element.attributeCount());
  }
View Full Code Here


    assertEquals(0, element.attributeCount());
  }

  public void testWriteStartStateName() throws Exception {
    ProcessDefinition processDefinition = new ProcessDefinition();
    processDefinition.setStartState( new StartState("mystartstate") );
    Element element = AbstractXmlTestCase.toXmlAndParse( processDefinition, "/process-definition/start-state[1]" );
    assertEquals("start-state", element.getName());
    assertEquals(1, element.attributeCount());
    assertEquals("mystartstate", element.attributeValue("name"));
  }
View Full Code Here

    assertSupportedEvents(new ProcessState(), new String[] { "node-leave", "node-enter", "after-signal", "before-signal", "subprocess-created",
        "subprocess-end" });
  }

  public void testStartStateEvents() {
    assertSupportedEvents(new StartState(), new String[] { "node-leave", "after-signal" });
  }
View Full Code Here

    assertFalse(processDefinition.isTerminationImplicit());
  }

  public void testProcessDefinitionStartState() {
    ProcessDefinition processDefinition = new ProcessDefinition();
    processDefinition.setStartState(new StartState());

    processDefinition = saveAndReload(processDefinition);

    // the start state of a process definition is mapped as a node.
    // therefor the hibernate proxy will be a node
View Full Code Here

    assertTrue(StartState.class.isAssignableFrom(session.load(StartState.class, new Long(startState.getId())).getClass()))
  }

  public void testProcessDefinitionNodes() {
    ProcessDefinition processDefinition = new ProcessDefinition();
    processDefinition.setStartState(new StartState("s"));
    processDefinition.addNode(new Node("a"));
    processDefinition.addNode(new Node("b"));
    processDefinition.addNode(new Node("c"));
    processDefinition.addNode(new Node("d"));
View Full Code Here

      "</pageflow-definition>"
    );
    PageflowParser pageflowParser = new PageflowParser(stringReader);
    ProcessDefinition processDefinition = pageflowParser.readProcessDefinition();
   
    StartState start = (StartState) processDefinition.getStartState();
    Page confirm = (Page) processDefinition.getNode("confirm");
    Page complete = (Page) processDefinition.getNode("complete");
    Page cont = (Page) processDefinition.getNode("continue");
    assert confirm!=null;
    assert complete!=null;
    assert cont!=null;
   
    ProcessInstance processInstance = new ProcessInstance(processDefinition);
    Token token = processInstance.getRootToken();
    assert start.equals(token.getNode());
   
    processInstance.signal();
  }
View Full Code Here

      "    <end-conversation/>" +
      "  </page>" +
      "</pageflow-definition>"
    );
   
    StartState start = (StartState) pageflowDefinition.getStartState();
    Page confirm = (Page) pageflowDefinition.getNode("confirm");
    Page complete = (Page) pageflowDefinition.getNode("complete");
    Page cont = (Page) pageflowDefinition.getNode("continue");
    assert confirm!=null;
    assert complete!=null;
    assert cont!=null;
   
    ProcessInstance pageflowInstance = new ProcessInstance(pageflowDefinition);
    Token token = pageflowInstance.getRootToken();
    assert start.equals(token.getNode());
   
    pageflowInstance.signal();
  }
View Full Code Here

TOP

Related Classes of org.jbpm.graph.node.StartState

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.