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");
}
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");
}
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");
}
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");
}
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");
}
Aggregations