Package org.jbpm.graph.def

Examples of org.jbpm.graph.def.ProcessDefinition


      assignable.setPooledActors(new String[]{"me", "you", "them"});
    }
  }

  public void testMultiActorTaskAssignment() {
    ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
      "<process-definition>" +
      "  <start-state>" +
      "    <transition to='a' />" +
      "  </start-state>" +
      "  <task-node name='a'>" +
View Full Code Here


    public void assign(Assignable assignable, ExecutionContext executionContext) throws Exception {
    }
  }
 
  public void testAssignmentHandlerContext() {
    ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
      "<process-definition>" +
      "  <start-state>" +
      "    <transition to='a' />" +
      "  </start-state>" +
      "  <task-node name='a'>" +
View Full Code Here

    assertNull(changeNappy.getActorId());
    assertNull(changeNappy.getPooledActors());
  }
 
  public void testStartTaskSwimlaneAssignmentTest() {
    ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
      "<process-definition>" +
      "  <swimlane name='initiator' />" +
      "  <start-state>" +
      "    <task name='start this process' swimlane='initiator' />" +
      "    <transition to='wait' />" +
View Full Code Here

    assertNotNull(swimlaneInstance);
    assertEquals("cookie monster", swimlaneInstance.getActorId());
  }

  public void testActorId() {
    ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
      "<process-definition>" +
      "  <start-state>" +
      "    <transition to='a' />" +
      "  </start-state>" +
      "  <task-node name='a'>" +
View Full Code Here

    assertEquals("me", changeNappy.getActorId());
    assertNull(changeNappy.getPooledActors());
  }

  public void testPooledActors() {
    ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
      "<process-definition>" +
      "  <start-state>" +
      "    <transition to='a' />" +
      "  </start-state>" +
      "  <task-node name='a'>" +
View Full Code Here

    assertEquals( expectedPooledActors, assignedPooledActors );
  }

  public void testActorIdsAndPooledActors() {
    ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
      "<process-definition>" +
      "  <start-state>" +
      "    <transition to='a' />" +
      "  </start-state>" +
      "  <task-node name='a'>" +
View Full Code Here

    assertEquals("4", element.element("id").getTextTrim() );
    assertEquals("aloha", element.element("greeting").getTextTrim() );
  }

  public void testWriteReferenceAction() throws Exception {
    ProcessDefinition processDefinition = new ProcessDefinition();

    // add a global action with name 'pina colada'
    Delegation instantiatableDelegate = new Delegation();
    instantiatableDelegate.setClassName("com.foo.Fighting");
    instantiatableDelegate.setConfigType("bean");
    instantiatableDelegate.setConfiguration("<id>4</id><greeting>aloha</greeting>");
    Action action = new Action();
    action.setName("pina colada");
    action.setActionDelegation(instantiatableDelegate);
    processDefinition.addAction(action);
   
    // now create a reference to it from event node-enter on state 'a'
    State state = (State) processDefinition.addNode( new State() );
    Action refAction = new Action();
    refAction.setReferencedAction(action);
    state.addEvent(new Event(Event.EVENTTYPE_NODE_ENTER)).addAction(refAction);
   
    AbstractXmlTestCase.toXmlAndParse( processDefinition, "/process-definition/state[1]/event[1]/action[1]" );
View Full Code Here

import org.jbpm.scheduler.impl.SchedulerThread;

public class SchedulerAndAsyncDbTest extends AbstractDbTestCase {

  public void testTimerInCombinationWithAsyncNode() throws Exception {
    ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
      "<process-definition>" +
      "  <start-state name='start'>" +
      "    <transition to='timed'/>" +
      "  </start-state>" +
      "  <state name='timed'>" +
View Full Code Here

    addEntry(zipOutputStream, "processdefinition.xml", "org/jbpm/jpdl/par/deployableprocess.xml");
    zipOutputStream.close();

    // deploy the saved process file
    ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(fileName));
    ProcessDefinition processDefinition = ProcessDefinition.parseParZipInputStream(zipInputStream);
    jbpmContext.deployProcessDefinition(processDefinition);

    newTransaction();

    List allProcessDefinitions = graphSession.findAllProcessDefinitions();
    assertEquals(1, allProcessDefinitions.size());
    processDefinition = (ProcessDefinition) allProcessDefinitions.get(0);
    assertEquals("the deployable process", processDefinition.getName());
  }
View Full Code Here

    addEntry(zipOutputStream, "classes/org/jbpm/jpdl/par/ProcessArchiveDeploymentDbTest.class", "org/jbpm/jpdl/par/ProcessArchiveDeploymentDbTest.class");
    zipOutputStream.close();

    // deploy the saved process file
    ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(fileName));
    ProcessDefinition processDefinition = ProcessDefinition.parseParZipInputStream(zipInputStream);
    jbpmContext.deployProcessDefinition(processDefinition);

    newTransaction();

    List allProcessDefinitions = graphSession.findAllProcessDefinitions();
    assertEquals(1, allProcessDefinitions.size());
    processDefinition = (ProcessDefinition) allProcessDefinitions.get(0);
    byte[] processBytes = processDefinition.getFileDefinition().getBytes("classes/org/jbpm/jpdl/par/ProcessArchiveDeploymentDbTest.class");
    byte[] expectedBytes = IoUtil.readBytes(ClassLoaderUtil.getStream("org/jbpm/jpdl/par/ProcessArchiveDeploymentDbTest.class"));

    assertTrue(Arrays.equals(expectedBytes, processBytes));
  }
View Full Code Here

TOP

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

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.