Search in sources :

Example 36 with HistoricActivityInstance

use of org.camunda.bpm.engine.history.HistoricActivityInstance in project camunda-bpm-platform by camunda.

the class HistoricActivityInstanceStateTest method testEndTerminateEventCancelWithSubprocess.

@Deployment
public void testEndTerminateEventCancelWithSubprocess() {
    ProcessInstance processInstance = startProcess();
    runtimeService.correlateMessage("continue");
    assertProcessEnded(processInstance.getId());
    List<HistoricActivityInstance> allInstances = getAllActivityInstances();
    assertIsCanceledActivityInstances(allInstances, "subprocess", 1);
    assertNonCompletingActivityInstance(allInstances, "subprocess");
    assertIsCanceledActivityInstances(allInstances, "userTask", 1);
    assertNonCompletingActivityInstance(allInstances, "userTask");
    assertNonCanceledActivityInstance(allInstances, "terminateEnd");
    assertIsCompletingActivityInstances(allInstances, "terminateEnd", 1);
}
Also used : ProcessInstance(org.camunda.bpm.engine.runtime.ProcessInstance) HistoricActivityInstance(org.camunda.bpm.engine.history.HistoricActivityInstance) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 37 with HistoricActivityInstance

use of org.camunda.bpm.engine.history.HistoricActivityInstance in project camunda-bpm-platform by camunda.

the class HistoricActivityInstanceStateTest method testEventSubprocessErrorCancel.

@Deployment
public void testEventSubprocessErrorCancel() {
    ProcessInstance processInstance = startProcess();
    runtimeService.correlateMessage("continue");
    assertProcessEnded(processInstance.getId());
    List<HistoricActivityInstance> allInstances = getAllActivityInstances();
    assertIsCanceledActivityInstances(allInstances, "userTask", 1);
    assertNonCompletingActivityInstance(allInstances, "userTask");
    assertIsCanceledActivityInstances(allInstances, "errorEnd", 1);
    assertNonCompletingActivityInstance(allInstances, "errorEnd");
    assertNonCanceledActivityInstance(allInstances, "eventSubprocessStart");
    assertNonCompletingActivityInstance(allInstances, "eventSubprocessStart");
    assertNonCanceledActivityInstance(allInstances, "eventSubprocessEnd");
    assertIsCompletingActivityInstances(allInstances, "eventSubprocessEnd", 1);
}
Also used : ProcessInstance(org.camunda.bpm.engine.runtime.ProcessInstance) HistoricActivityInstance(org.camunda.bpm.engine.history.HistoricActivityInstance) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 38 with HistoricActivityInstance

use of org.camunda.bpm.engine.history.HistoricActivityInstance in project camunda-bpm-platform by camunda.

the class HistoricActivityInstanceStateTest method testBoundaryErrorCancel.

@Deployment
public void testBoundaryErrorCancel() {
    ProcessInstance processInstance = startProcess();
    runtimeService.correlateMessage("continue");
    assertProcessEnded(processInstance.getId());
    List<HistoricActivityInstance> allInstances = getAllActivityInstances();
    assertNonCanceledActivityInstance(allInstances, "start");
    assertNonCompletingActivityInstance(allInstances, "start");
    assertNonCanceledActivityInstance(allInstances, "subprocessStart");
    assertNonCompletingActivityInstance(allInstances, "subprocessStart");
    assertNonCanceledActivityInstance(allInstances, "gtw");
    assertNonCompletingActivityInstance(allInstances, "gtw");
    assertIsCanceledActivityInstances(allInstances, "subprocess", 1);
    assertNonCompletingActivityInstance(allInstances, "subprocess");
    assertIsCanceledActivityInstances(allInstances, "errorSubprocessEnd", 1);
    assertNonCompletingActivityInstance(allInstances, "errorSubprocessEnd");
    assertIsCanceledActivityInstances(allInstances, "userTask", 1);
    assertNonCompletingActivityInstance(allInstances, "userTask");
    assertNonCanceledActivityInstance(allInstances, "subprocessBoundary");
    assertNonCompletingActivityInstance(allInstances, "subprocessBoundary");
    assertNonCanceledActivityInstance(allInstances, "endAfterBoundary");
    assertIsCompletingActivityInstances(allInstances, "endAfterBoundary", 1);
}
Also used : ProcessInstance(org.camunda.bpm.engine.runtime.ProcessInstance) HistoricActivityInstance(org.camunda.bpm.engine.history.HistoricActivityInstance) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 39 with HistoricActivityInstance

use of org.camunda.bpm.engine.history.HistoricActivityInstance in project camunda-bpm-platform by camunda.

the class HistoricActivityInstanceStateTest method testCancelProcessWithParallelGateway.

@Deployment
public void testCancelProcessWithParallelGateway() {
    ProcessInstance processInstance = startProcess();
    runtimeService.deleteProcessInstance(processInstance.getId(), "test");
    List<HistoricActivityInstance> allInstances = getAllActivityInstances();
    assertIsCanceledActivityInstances(allInstances, "userTask1", 1);
    assertNonCompletingActivityInstance(allInstances, "userTask1");
    assertIsCanceledActivityInstances(allInstances, "userTask2", 1);
    assertNonCompletingActivityInstance(allInstances, "userTask2");
    assertIsCanceledActivityInstances(allInstances, "subprocess", 1);
    assertNonCompletingActivityInstance(allInstances, "subprocess");
}
Also used : ProcessInstance(org.camunda.bpm.engine.runtime.ProcessInstance) HistoricActivityInstance(org.camunda.bpm.engine.history.HistoricActivityInstance) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 40 with HistoricActivityInstance

use of org.camunda.bpm.engine.history.HistoricActivityInstance in project camunda-bpm-platform by camunda.

the class HistoricVariableInstanceScopeTest method testSetVariableLocalOnServiceTaskInsideParallelBranch.

@Deployment
public void testSetVariableLocalOnServiceTaskInsideParallelBranch() {
    ProcessInstance pi = runtimeService.startProcessInstanceByKey("process");
    HistoricActivityInstance serviceTask = historyService.createHistoricActivityInstanceQuery().activityId("serviceTask1").singleResult();
    assertNotNull(serviceTask);
    HistoricVariableInstanceQuery query = historyService.createHistoricVariableInstanceQuery();
    assertEquals(1, query.count());
    HistoricVariableInstance variable = query.singleResult();
    // the variable is in the service task scope
    assertEquals(serviceTask.getId(), variable.getActivityInstanceId());
    assertProcessEnded(pi.getId());
}
Also used : HistoricVariableInstanceQuery(org.camunda.bpm.engine.history.HistoricVariableInstanceQuery) ProcessInstance(org.camunda.bpm.engine.runtime.ProcessInstance) HistoricVariableInstance(org.camunda.bpm.engine.history.HistoricVariableInstance) HistoricActivityInstance(org.camunda.bpm.engine.history.HistoricActivityInstance) Deployment(org.camunda.bpm.engine.test.Deployment)

Aggregations

HistoricActivityInstance (org.camunda.bpm.engine.history.HistoricActivityInstance)80 Deployment (org.camunda.bpm.engine.test.Deployment)56 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)45 HistoricProcessInstance (org.camunda.bpm.engine.history.HistoricProcessInstance)24 Task (org.camunda.bpm.engine.task.Task)19 Test (org.junit.Test)17 HistoricActivityInstanceQuery (org.camunda.bpm.engine.history.HistoricActivityInstanceQuery)13 HashMap (java.util.HashMap)12 RequiredHistoryLevel (org.camunda.bpm.engine.test.RequiredHistoryLevel)8 ProcessDefinition (org.camunda.bpm.engine.repository.ProcessDefinition)6 Date (java.util.Date)5 HistoricDetail (org.camunda.bpm.engine.history.HistoricDetail)5 MigrationPlan (org.camunda.bpm.engine.migration.MigrationPlan)5 HistoricTaskInstance (org.camunda.bpm.engine.history.HistoricTaskInstance)4 ArrayList (java.util.ArrayList)3 HistoryService (org.camunda.bpm.engine.HistoryService)3 HistoricVariableUpdate (org.camunda.bpm.engine.history.HistoricVariableUpdate)3 Response (com.jayway.restassured.response.Response)2 HistoricVariableInstance (org.camunda.bpm.engine.history.HistoricVariableInstance)2 HistoricVariableInstanceQuery (org.camunda.bpm.engine.history.HistoricVariableInstanceQuery)2