use of org.camunda.bpm.engine.history.HistoricActivityInstance in project camunda-bpm-platform by camunda.
the class HistoricActivityInstanceTest method testCaseCallActivity.
@Deployment(resources = { "org/camunda/bpm/engine/test/history/HistoricActivityInstanceTest.testCaseCallActivity.bpmn20.xml", "org/camunda/bpm/engine/test/api/cmmn/oneTaskCase.cmmn" })
public void testCaseCallActivity() {
runtimeService.startProcessInstanceByKey("process");
String subCaseInstanceId = caseService.createCaseInstanceQuery().singleResult().getId();
HistoricActivityInstance historicCallActivity = historyService.createHistoricActivityInstanceQuery().activityId("callActivity").singleResult();
assertEquals(subCaseInstanceId, historicCallActivity.getCalledCaseInstanceId());
assertNull(historicCallActivity.getEndTime());
String humanTaskId = caseService.createCaseExecutionQuery().activityId("PI_HumanTask_1").singleResult().getId();
caseService.completeCaseExecution(humanTaskId);
historicCallActivity = historyService.createHistoricActivityInstanceQuery().activityId("callActivity").singleResult();
assertEquals(subCaseInstanceId, historicCallActivity.getCalledCaseInstanceId());
assertNotNull(historicCallActivity.getEndTime());
}
use of org.camunda.bpm.engine.history.HistoricActivityInstance in project camunda-bpm-platform by camunda.
the class HistoricActivityInstanceTest method testSignalEventSubprocess.
@Deployment(resources = "org/camunda/bpm/engine/test/history/HistoricActivityInstanceTest.startEventTypesForEventSubprocess.bpmn20.xml")
public void testSignalEventSubprocess() {
Map<String, Object> vars = new HashMap<String, Object>();
vars.put("shouldThrowError", false);
runtimeService.startProcessInstanceByKey("process", vars);
runtimeService.signalEventReceived("newSignal");
HistoricActivityInstance historicActivity = historyService.createHistoricActivityInstanceQuery().activityId("signalStartEvent").singleResult();
assertEquals("signalStartEvent", historicActivity.getActivityType());
}
use of org.camunda.bpm.engine.history.HistoricActivityInstance in project camunda-bpm-platform by camunda.
the class HistoricActivityInstanceTest method testScopeActivity.
@Deployment
public void testScopeActivity() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("process");
HistoricActivityInstanceQuery query = historyService.createHistoricActivityInstanceQuery();
query.activityId("userTask");
assertEquals(1, query.count());
HistoricActivityInstance historicActivityInstance = query.singleResult();
assertEquals(pi.getId(), historicActivityInstance.getParentActivityInstanceId());
Task task = taskService.createTaskQuery().singleResult();
taskService.complete(task.getId());
assertProcessEnded(pi.getId());
}
use of org.camunda.bpm.engine.history.HistoricActivityInstance in project camunda-bpm-platform by camunda.
the class HistoricActivityInstanceTest method testProcessDefinitionKeyProperty.
@Deployment(resources = { "org/camunda/bpm/engine/test/history/oneTaskProcess.bpmn20.xml" })
public void testProcessDefinitionKeyProperty() {
// given
String key = "oneTaskProcess";
String processInstanceId = runtimeService.startProcessInstanceByKey(key).getId();
// when
HistoricActivityInstance activityInstance = historyService.createHistoricActivityInstanceQuery().processInstanceId(processInstanceId).activityId("theTask").singleResult();
// then
assertNotNull(activityInstance.getProcessDefinitionKey());
assertEquals(key, activityInstance.getProcessDefinitionKey());
}
use of org.camunda.bpm.engine.history.HistoricActivityInstance in project camunda-bpm-platform by camunda.
the class HistoricActivityInstanceTest method testMessageEventSubprocess.
@Deployment(resources = "org/camunda/bpm/engine/test/history/HistoricActivityInstanceTest.startEventTypesForEventSubprocess.bpmn20.xml")
public void testMessageEventSubprocess() {
Map<String, Object> vars = new HashMap<String, Object>();
vars.put("shouldThrowError", false);
runtimeService.startProcessInstanceByKey("process", vars);
runtimeService.correlateMessage("newMessage");
HistoricActivityInstance historicActivity = historyService.createHistoricActivityInstanceQuery().activityId("messageStartEvent").singleResult();
assertEquals("messageStartEvent", historicActivity.getActivityType());
}
Aggregations