Examples of SetProcessDefinitionVersionCmd


Examples of org.activiti.engine.impl.cmd.SetProcessDefinitionVersionCmd

  private static final String TEST_PROCESS_USER_TASK_V2 = "org/activiti/engine/test/db/ProcessInstanceMigrationTest.testSetProcessDefinitionVersionWithTaskV2.bpmn20.xml";
  private static final String TEST_PROCESS_NESTED_SUB_EXECUTIONS = "org/activiti/engine/test/db/ProcessInstanceMigrationTest.testSetProcessDefinitionVersionSubExecutionsNested.bpmn20.xml";

  public void testSetProcessDefinitionVersionEmptyArguments() {
    try {
      new SetProcessDefinitionVersionCmd(null, 23);   
      fail("ActivitiException expected");
    } catch (ActivitiIllegalArgumentException ae) {
      assertTextPresent("The process instance id is mandatory, but 'null' has been provided.", ae.getMessage());
    }

    try {
      new SetProcessDefinitionVersionCmd("", 23);   
      fail("ActivitiException expected");
    } catch (ActivitiIllegalArgumentException ae) {
      assertTextPresent("The process instance id is mandatory, but '' has been provided.", ae.getMessage());
    }

    try {
      new SetProcessDefinitionVersionCmd("42", null);   
      fail("ActivitiException expected");
    } catch (ActivitiIllegalArgumentException ae) {
      assertTextPresent("The process definition version is mandatory, but 'null' has been provided.", ae.getMessage());
    }

    try {
      new SetProcessDefinitionVersionCmd("42", -1);   
      fail("ActivitiException expected");
    } catch (ActivitiIllegalArgumentException ae) {
      assertTextPresent("The process definition version must be positive, but '-1' has been provided.", ae.getMessage());
    }
  }
View Full Code Here

Examples of org.activiti.engine.impl.cmd.SetProcessDefinitionVersionCmd

  }

  public void testSetProcessDefinitionVersionNonExistingPI() {
    CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutor();
    try {
      commandExecutor.execute(new SetProcessDefinitionVersionCmd("42", 23));   
      fail("ActivitiException expected");
    } catch (ActivitiObjectNotFoundException ae) {
      assertTextPresent("No process instance found for id = '42'.", ae.getMessage());
      assertEquals(ProcessInstance.class, ae.getObjectClass());
    }
View Full Code Here

Examples of org.activiti.engine.impl.cmd.SetProcessDefinitionVersionCmd

    Execution execution = runtimeService.createExecutionQuery()
      .activityId("receivePayment")
      .singleResult();
    CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutor();
    SetProcessDefinitionVersionCmd command = new SetProcessDefinitionVersionCmd(execution.getId(), 1);
    try {
      commandExecutor.execute(command);
      fail("ActivitiException expected");
    } catch (ActivitiException ae) {
      assertTextPresent("A process instance id is required, but the provided id '"+execution.getId()+"' points to a child execution of process instance '"+pi.getId()+"'. Please invoke the "+command.getClass().getSimpleName()+" with a root execution id.", ae.getMessage());
    }
  }
View Full Code Here

Examples of org.activiti.engine.impl.cmd.SetProcessDefinitionVersionCmd

    // start process instance
    ProcessInstance pi = runtimeService.startProcessInstanceByKey("receiveTask");

    CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutor();
    try {
      commandExecutor.execute(new SetProcessDefinitionVersionCmd(pi.getId(), 23));   
      fail("ActivitiException expected");
    } catch (ActivitiObjectNotFoundException ae) {
      assertTextPresent("no processes deployed with key = 'receiveTask' and version = '23'", ae.getMessage());
      assertEquals(ProcessDefinition.class, ae.getObjectClass());
    }
View Full Code Here

Examples of org.activiti.engine.impl.cmd.SetProcessDefinitionVersionCmd

      .deploy();
    assertEquals(2, repositoryService.createProcessDefinitionQuery().count());

    // migrate process instance to new process definition version
    CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutor();
    SetProcessDefinitionVersionCmd setProcessDefinitionVersionCmd = new SetProcessDefinitionVersionCmd(pi.getId(), 2);
    try {
      commandExecutor.execute(setProcessDefinitionVersionCmd);
      fail("ActivitiException expected");
    } catch (ActivitiException ae) {
      assertTextPresent("The new process definition (key = 'receiveTask') does not contain the current activity (id = 'waitState1') of the process instance (id = '", ae.getMessage());
View Full Code Here

Examples of org.activiti.engine.impl.cmd.SetProcessDefinitionVersionCmd

      .deploy();
    assertEquals(2, repositoryService.createProcessDefinitionQuery().count());

    // migrate process instance to new process definition version
    CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutor();
    commandExecutor.execute(new SetProcessDefinitionVersionCmd(pi.getId(), 2));

    // signal process instance
    runtimeService.signal(execution.getId());

    // check that the instance now uses the new process definition version
View Full Code Here

Examples of org.activiti.engine.impl.cmd.SetProcessDefinitionVersionCmd

      .deploy();
    assertEquals(2, repositoryService.createProcessDefinitionQuery().count());

    // migrate process instance to new process definition version
    CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutor();
    commandExecutor.execute(new SetProcessDefinitionVersionCmd(pi.getId(), 2));

    // check that all executions of the instance now use the new process definition version
    ProcessDefinition newProcessDefinition = repositoryService
      .createProcessDefinitionQuery()
      .processDefinitionVersion(2)
View Full Code Here

Examples of org.activiti.engine.impl.cmd.SetProcessDefinitionVersionCmd

      .deploy();
    assertEquals(2, repositoryService.createProcessDefinitionQuery().processDefinitionKey("parentProcess").count());

    // migrate process instance to new process definition version
    CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutor();
    commandExecutor.execute(new SetProcessDefinitionVersionCmd(pi.getId(), 2));

    // signal process instance
    runtimeService.signal(execution.getId());

    // should be finished now
View Full Code Here

Examples of org.activiti.engine.impl.cmd.SetProcessDefinitionVersionCmd

    assertEquals(2, repositoryService.createProcessDefinitionQuery().processDefinitionKey("userTask").count());
   
    ProcessDefinition newProcessDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionKey("userTask").processDefinitionVersion(2).singleResult();

    // migrate process instance to new process definition version
    processEngineConfiguration.getCommandExecutor().execute(new SetProcessDefinitionVersionCmd(pi.getId(), 2));
   
    // check UserTask
    Task task = taskService.createTaskQuery().processInstanceId(pi.getId()).singleResult();
    assertEquals(newProcessDefinition.getId(), task.getProcessDefinitionId());
    assertEquals("testFormKey", formService.getTaskFormData(task.getId()).getFormKey());
View Full Code Here

Examples of org.activiti.engine.impl.cmd.SetProcessDefinitionVersionCmd

            .deploy();
    assertEquals(2, repositoryService.createProcessDefinitionQuery().count());

    // migrate process instance to new process definition version
    CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutor();
    commandExecutor.execute(new SetProcessDefinitionVersionCmd(pi.getId(), 2));

    // check that all executions of the instance now use the new process definition version
    ProcessDefinition newProcessDefinition = repositoryService
            .createProcessDefinitionQuery()
            .processDefinitionVersion(2)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.