use of org.camunda.bpm.engine.history.HistoricCaseActivityInstance in project camunda-bpm-platform by camunda.
the class HistoricCaseActivityInstanceTest method queryHistoricActivityCaseInstance.
protected HistoricCaseActivityInstance queryHistoricActivityCaseInstance(String activityId) {
HistoricCaseActivityInstance historicActivityInstance = historicQuery().caseActivityId(activityId).singleResult();
assertNotNull("No historic activity instance found for activity id: " + activityId, historicActivityInstance);
return historicActivityInstance;
}
use of org.camunda.bpm.engine.history.HistoricCaseActivityInstance in project camunda-bpm-platform by camunda.
the class HistoricCaseActivityInstanceTest method testDecisionTask.
@Deployment
public void testDecisionTask() {
createCaseInstance();
HistoricCaseActivityInstance decisionTask = historyService.createHistoricCaseActivityInstanceQuery().caseActivityId("PI_DecisionTask_1").singleResult();
assertNotNull(decisionTask);
assertEquals("decisionTask", decisionTask.getCaseActivityType());
}
use of org.camunda.bpm.engine.history.HistoricCaseActivityInstance in project camunda-bpm-platform by camunda.
the class HistoricCaseActivityInstanceTest method testDisabledHistoricActivityInstancesStayDisabledOnComplete.
@Deployment(resources = { "org/camunda/bpm/engine/test/history/HistoricCaseActivityInstanceTest.oneStageAndOneTaskCaseWithManualActivation.cmmn" })
public void testDisabledHistoricActivityInstancesStayDisabledOnComplete() {
// given
createCaseInstance();
CaseExecution humanTask = queryCaseExecutionByActivityId("PI_HumanTask_3");
assertTrue(humanTask.isEnabled());
CaseExecution stageExecution = queryCaseExecutionByActivityId("PI_Stage_1");
disable(stageExecution.getId());
stageExecution = queryCaseExecutionByActivityId("PI_Stage_1");
assertTrue(stageExecution.isDisabled());
// when
CaseExecution casePlanExecution = queryCaseExecutionByActivityId("CasePlanModel_1");
complete(casePlanExecution.getId());
// then make sure disabled executions stay disabled
HistoricCaseActivityInstance stageInstance = historyService.createHistoricCaseActivityInstanceQuery().caseActivityId("PI_Stage_1").singleResult();
HistoricCaseActivityInstance taskInstance = historyService.createHistoricCaseActivityInstanceQuery().caseActivityId("PI_HumanTask_3").singleResult();
assertTrue(stageInstance.isDisabled());
assertTrue(taskInstance.isTerminated());
}
use of org.camunda.bpm.engine.history.HistoricCaseActivityInstance in project camunda-bpm-platform by camunda.
the class HistoricCaseActivityInstanceTest method testAutoCompleteEnabled.
@Deployment(resources = { "org/camunda/bpm/engine/test/cmmn/stage/AutoCompleteTest.testCasePlanModel.cmmn" })
public void testAutoCompleteEnabled() {
String caseInstanceId = createCaseInstanceByKey("case").getId();
HistoricCaseInstance caseInstance = historyService.createHistoricCaseInstanceQuery().caseInstanceId(caseInstanceId).singleResult();
assertNotNull(caseInstance);
assertTrue(caseInstance.isCompleted());
HistoricCaseActivityInstanceQuery query = historyService.createHistoricCaseActivityInstanceQuery();
HistoricCaseActivityInstance humanTask1 = query.caseActivityId("PI_HumanTask_1").singleResult();
assertNotNull(humanTask1);
assertTrue(humanTask1.isTerminated());
assertNotNull(humanTask1.getEndTime());
assertNotNull(humanTask1.getDurationInMillis());
HistoricCaseActivityInstance humanTask2 = query.caseActivityId("PI_HumanTask_2").singleResult();
assertNotNull(humanTask2);
assertTrue(humanTask2.isTerminated());
assertNotNull(humanTask2.getEndTime());
assertNotNull(humanTask2.getDurationInMillis());
}
use of org.camunda.bpm.engine.history.HistoricCaseActivityInstance in project camunda-bpm-platform by camunda.
the class HistoricCaseActivityInstanceTest method testQueryByRequired.
@Deployment(resources = "org/camunda/bpm/engine/test/cmmn/required/RequiredRuleTest.testVariableBasedRule.cmmn")
public void testQueryByRequired() {
caseService.createCaseInstanceByKey("case", Collections.<String, Object>singletonMap("required", true));
HistoricCaseActivityInstanceQuery query = historyService.createHistoricCaseActivityInstanceQuery().required();
assertEquals(1, query.count());
assertEquals(1, query.list().size());
HistoricCaseActivityInstance activityInstance = query.singleResult();
assertNotNull(activityInstance);
assertTrue(activityInstance.isRequired());
}
Aggregations