Package org.jbpm.graph.def

Examples of org.jbpm.graph.def.ProcessDefinition


    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();

    // deploy the saved process file again
View Full Code Here


    "  <bean name='jbpm.task.instance.factory' class='org.jbpm.taskmgmt.impl.DefaultTaskInstanceFactoryImpl' singleton='true' />" +
    "</jbpm-configuration>"
  );
 
  public void testTimerCreation() {
    ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
      "<process-definition>" +
      "  <start-state>" +
      "    <transition to='catch crooks' />" +
      "  </start-state>" +
      "  <state name='catch crooks'>" +
      "    <timer name='reminder' " +
      "           duedate='3 business hours' " +
      "           repeat='10 business minutes'" +
      "           transition='time-out-transition' >" +
      "      <action class='the-remainder-action-class-name' />" +
      "    </timer>" +
      "  </state>" +
      "</process-definition>"
    );

    JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
    try {
      TestSchedulerService testSchedulerService = (TestSchedulerService) jbpmContext.getServices().getSchedulerService();
     
      ProcessInstance processInstance = new ProcessInstance(processDefinition);
      processInstance.signal();
     
      assertEquals(1, testSchedulerService.createdTimers.size());
      Timer scheduledTimer = (Timer) testSchedulerService.createdTimers.get(0);
      assertEquals("reminder", scheduledTimer.name);
      assertEquals(processDefinition.getNode("catch crooks"), scheduledTimer.graphElement);
      System.out.println("due date: "+scheduledTimer.dueDate);
      assertNotNull(scheduledTimer.dueDate);
      assertEquals("10 business minutes", scheduledTimer.repeat);
      assertEquals("the-remainder-action-class-name", scheduledTimer.action.getActionDelegation().getClassName());
      assertSame(processInstance.getRootToken(), scheduledTimer.token);
View Full Code Here

      jbpmContext.close();
    }
  }

  public void testCreateTimerAction() {
    ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
      "<process-definition>" +
      "  <start-state>" +
      "    <transition to='catch crooks' />" +
      "  </start-state>" +
      "  <state name='catch crooks'>" +
      "    <event type='node-enter'>" +
      "      <create-timer name='reminder' " +
      "                    duedate='3 business hours' " +
      "                    repeat='10 business minutes'" +
      "                    transition='time-out-transition' >" +
      "        <action class='the-remainder-action-class-name' />" +
      "      </create-timer>" +
      "    </event>" +
      "    <transition to='end'/>" +
      "  </state>" +
      "  <end-state name='end'/>" +
      "</process-definition>"
    );
   
    JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
    try {
      TestSchedulerService testSchedulerService = (TestSchedulerService) jbpmContext.getServices().getSchedulerService();
     
      ProcessInstance processInstance = new ProcessInstance(processDefinition);
      processInstance.signal();
     
      assertEquals(1, testSchedulerService.createdTimers.size());
      Timer scheduledTimer = (Timer) testSchedulerService.createdTimers.get(0);
      assertEquals("reminder", scheduledTimer.name);
      assertEquals(processDefinition.getNode("catch crooks"), scheduledTimer.graphElement);
      System.out.println("due date: "+scheduledTimer.dueDate);
      assertNotNull(scheduledTimer.dueDate);
      assertEquals("10 business minutes", scheduledTimer.repeat);
      assertEquals("the-remainder-action-class-name", scheduledTimer.action.getActionDelegation().getClassName());
      assertSame(processInstance.getRootToken(), scheduledTimer.token);
View Full Code Here

      jbpmContext.close();
    }
  }

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

    public void execute(ExecutionContext executionContext) throws Exception {
      timer = executionContext.getTimer();
    }
  }
  public void testTimerEvent() {
    ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
      "<process-definition>" +
      "  <start-state>" +
      "    <transition to='catch crooks' />" +
      "  </start-state>" +
      "  <state name='catch crooks'>" +
View Full Code Here

      jbpmContext.close();
    }
  }

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

    Token resumedToken = (Token) testSchedulerService.resumedTimerTokens.get(0);
    assertSame(processInstance.getRootToken(), resumedToken);
  }

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

      // OK
    }
  }

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

      isCustomized = true;
    }
  }

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

import org.jbpm.taskmgmt.def.TaskController;

public class TaskControllerXmlTest extends TestCase {

  public void testTaskControllerWithVariableAccesses() {
    ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
      "<process-definition>" +
      "  <task-node name='t'>" +
      "    <task name='clean ceiling'>" +
      "      <controller>" +
      "        <variable name='a' access='read,write' mapped-name='x' />" +
      "        <variable name='b' access='read,write' mapped-name='y' />" +
      "        <variable name='c' access='read,write' />" +
      "      </controller>" +
      "    </task>" +
      "  </task-node>" +
      "</process-definition>"
    );
    TaskNode taskNode = (TaskNode) processDefinition.getNode("t");
    Task task = taskNode.getTask("clean ceiling");
    TaskController taskController = task.getTaskController();
    assertNotNull(taskController);
    assertNull(taskController.getTaskControllerDelegation());
    List variableAccesses = taskController.getVariableAccesses();
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.