Search in sources :

Example 51 with HistoricActivityInstanceQuery

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

the class HistoricActivityInstanceSequenceCounterTest method testInterruptingBoundaryEvent.

@Deployment(resources = { "org/camunda/bpm/engine/test/standalone/entity/ExecutionSequenceCounterTest.testInterruptingBoundaryEvent.bpmn20.xml" })
public void testInterruptingBoundaryEvent() {
    // given
    HistoricActivityInstanceQuery query = historyService.createHistoricActivityInstanceQuery().orderPartiallyByOccurrence().asc();
    // when
    String processInstanceId = runtimeService.startProcessInstanceByKey("process").getId();
    runtimeService.correlateMessage("newMessage");
    // then
    verifyOrder(query, "theStart", "theService1", "theTask", "messageBoundary", "theServiceAfterMessage", "theEnd2");
    query.executionId(processInstanceId);
    verifyOrder(query, "theStart", "theService1", "messageBoundary", "theServiceAfterMessage", "theEnd2");
    String taskExecutionId = historyService.createHistoricActivityInstanceQuery().activityId("theTask").singleResult().getExecutionId();
    query.executionId(taskExecutionId);
    verifyOrder(query, "theTask");
}
Also used : HistoricActivityInstanceQuery(org.camunda.bpm.engine.history.HistoricActivityInstanceQuery) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 52 with HistoricActivityInstanceQuery

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

the class HistoricActivityInstanceSequenceCounterTest method testFork.

@Deployment(resources = { "org/camunda/bpm/engine/test/standalone/entity/ExecutionSequenceCounterTest.testForkSameSequenceLengthWithoutWaitStates.bpmn20.xml" })
public void testFork() {
    // given
    String processInstanceId = runtimeService.startProcessInstanceByKey("process").getId();
    HistoricActivityInstanceQuery query = historyService.createHistoricActivityInstanceQuery().orderPartiallyByOccurrence().asc();
    // when
    // then
    query.executionId(processInstanceId);
    verifyOrder(query, "theStart", "theService", "fork", "theService2", "theEnd2");
    String firstExecutionId = historyService.createHistoricActivityInstanceQuery().activityId("theService1").singleResult().getExecutionId();
    query.executionId(firstExecutionId);
    verifyOrder(query, "theService1", "theEnd1");
    query = historyService.createHistoricActivityInstanceQuery().orderPartiallyByOccurrence().asc();
    verifyOrder(query, "theStart", "theService", "fork", "theService1", "theEnd1", "theService2", "theEnd2");
}
Also used : HistoricActivityInstanceQuery(org.camunda.bpm.engine.history.HistoricActivityInstanceQuery) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 53 with HistoricActivityInstanceQuery

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

the class HistoricActivityInstanceSequenceCounterTest method testForkAndJoin.

@Deployment(resources = { "org/camunda/bpm/engine/test/standalone/entity/ExecutionSequenceCounterTest.testForkAndJoinDifferentSequenceLength.bpmn20.xml" })
public void testForkAndJoin() {
    // given
    HistoricActivityInstanceQuery query = historyService.createHistoricActivityInstanceQuery().orderPartiallyByOccurrence().asc();
    // when
    String processInstanceId = runtimeService.startProcessInstanceByKey("process").getId();
    // then
    query.executionId(processInstanceId);
    verifyOrder(query, "theStart", "theService", "fork", "join", "theService4", "theEnd");
    String firstExecutionId = historyService.createHistoricActivityInstanceQuery().activityId("theService1").singleResult().getExecutionId();
    String secondExecutionId = historyService.createHistoricActivityInstanceQuery().activityId("theService2").singleResult().getExecutionId();
    query.executionId(firstExecutionId);
    verifyOrder(query, "theService1", "join");
    query.executionId(secondExecutionId);
    verifyOrder(query, "theService2", "theService3");
    query = historyService.createHistoricActivityInstanceQuery().orderPartiallyByOccurrence().asc().orderByActivityId().asc();
    verifyOrder(query, "theStart", "theService", "fork", "theService1", "theService2", "join", "theService3", "join", "theService4", "theEnd");
}
Also used : HistoricActivityInstanceQuery(org.camunda.bpm.engine.history.HistoricActivityInstanceQuery) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 54 with HistoricActivityInstanceQuery

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

the class HistoricActivityInstanceSequenceCounterTest method testSequentialMultiInstance.

@Deployment(resources = { "org/camunda/bpm/engine/test/standalone/entity/ExecutionSequenceCounterTest.testSequentialMultiInstance.bpmn20.xml" })
public void testSequentialMultiInstance() {
    // given
    HistoricActivityInstanceQuery query = historyService.createHistoricActivityInstanceQuery().orderPartiallyByOccurrence().asc();
    // when
    String processInstanceId = runtimeService.startProcessInstanceByKey("process").getId();
    // then
    query.executionId(processInstanceId);
    verifyOrder(query, "theStart", "theService1", "theService3", "theEnd");
    String taskExecutionId = historyService.createHistoricActivityInstanceQuery().activityId("theService2").list().get(0).getExecutionId();
    query.executionId(taskExecutionId);
    verifyOrder(query, "theService2#multiInstanceBody", "theService2", "theService2");
    query = historyService.createHistoricActivityInstanceQuery().orderPartiallyByOccurrence().asc();
    verifyOrder(query, "theStart", "theService1", "theService2#multiInstanceBody", "theService2", "theService2", "theService3", "theEnd");
}
Also used : HistoricActivityInstanceQuery(org.camunda.bpm.engine.history.HistoricActivityInstanceQuery) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 55 with HistoricActivityInstanceQuery

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

the class HistoricActivityInstanceSequenceCounterTest method testSequence.

@Deployment(resources = { "org/camunda/bpm/engine/test/standalone/entity/ExecutionSequenceCounterTest.testSequence.bpmn20.xml" })
public void testSequence() {
    // given
    HistoricActivityInstanceQuery query = historyService.createHistoricActivityInstanceQuery().orderPartiallyByOccurrence().asc();
    // when
    runtimeService.startProcessInstanceByKey("process");
    // then
    verifyOrder(query, "theStart", "theService1", "theService2", "theEnd");
}
Also used : HistoricActivityInstanceQuery(org.camunda.bpm.engine.history.HistoricActivityInstanceQuery) Deployment(org.camunda.bpm.engine.test.Deployment)

Aggregations

HistoricActivityInstanceQuery (org.camunda.bpm.engine.history.HistoricActivityInstanceQuery)59 Deployment (org.camunda.bpm.engine.test.Deployment)35 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)18 Task (org.camunda.bpm.engine.task.Task)18 HistoricProcessInstance (org.camunda.bpm.engine.history.HistoricProcessInstance)17 HistoricActivityInstance (org.camunda.bpm.engine.history.HistoricActivityInstance)13 Execution (org.camunda.bpm.engine.runtime.Execution)4 Test (org.junit.Test)4 Job (org.camunda.bpm.engine.runtime.Job)3 JobQuery (org.camunda.bpm.engine.runtime.JobQuery)3 TaskQuery (org.camunda.bpm.engine.task.TaskQuery)3 Response (com.jayway.restassured.response.Response)2 ArrayList (java.util.ArrayList)2 AbstractRestServiceTest (org.camunda.bpm.engine.rest.AbstractRestServiceTest)2 Matchers.containsString (org.hamcrest.Matchers.containsString)2 InOrder (org.mockito.InOrder)2 HashMap (java.util.HashMap)1 HistoricDetail (org.camunda.bpm.engine.history.HistoricDetail)1 HistoricVariableInstance (org.camunda.bpm.engine.history.HistoricVariableInstance)1 MigrationPlan (org.camunda.bpm.engine.migration.MigrationPlan)1