use of org.camunda.bpm.engine.history.HistoricCaseActivityInstance in project camunda-bpm-platform by camunda.
the class HistoricCaseActivityInstanceTest method testRequiredRuleEvaluatesToTrue.
@Deployment(resources = "org/camunda/bpm/engine/test/cmmn/required/RequiredRuleTest.testVariableBasedRule.cmmn")
public void testRequiredRuleEvaluatesToTrue() {
caseService.createCaseInstanceByKey("case", Collections.<String, Object>singletonMap("required", true));
HistoricCaseActivityInstance task = historyService.createHistoricCaseActivityInstanceQuery().caseActivityId("PI_HumanTask_1").singleResult();
assertNotNull(task);
assertTrue(task.isRequired());
}
use of org.camunda.bpm.engine.history.HistoricCaseActivityInstance in project camunda-bpm-platform by camunda.
the class HistoricCaseActivityInstanceTest method testDeleteHistoricCaseActivityInstance.
@Deployment(resources = { "org/camunda/bpm/engine/test/api/cmmn/oneTaskCaseWithManualActivation.cmmn" })
public void testDeleteHistoricCaseActivityInstance() {
CaseInstance caseInstance = createCaseInstance();
HistoricCaseActivityInstance historicInstance = historicQuery().singleResult();
assertNotNull(historicInstance);
// disable human task to complete case
disable(historicInstance.getId());
// close case to be able to delete historic case instance
close(caseInstance.getId());
// delete historic case instance
historyService.deleteHistoricCaseInstance(caseInstance.getId());
assertCount(0, historicQuery());
}
use of org.camunda.bpm.engine.history.HistoricCaseActivityInstance in project camunda-bpm-platform by camunda.
the class HistoricCaseActivityInstanceTest method testRequiredRuleEvaluatesToFalse.
@Deployment(resources = "org/camunda/bpm/engine/test/cmmn/required/RequiredRuleTest.testVariableBasedRule.cmmn")
public void testRequiredRuleEvaluatesToFalse() {
caseService.createCaseInstanceByKey("case", Collections.<String, Object>singletonMap("required", false));
HistoricCaseActivityInstance task = historyService.createHistoricCaseActivityInstanceQuery().caseActivityId("PI_HumanTask_1").singleResult();
assertNotNull(task);
assertFalse(task.isRequired());
}
use of org.camunda.bpm.engine.history.HistoricCaseActivityInstance in project camunda-bpm-platform by camunda.
the class HistoricCaseActivityInstanceTest method testHistoricCalledProcessInstanceId.
@Deployment(resources = { "org/camunda/bpm/engine/test/api/cmmn/oneProcessTaskCaseWithManualActivation.cmmn", "org/camunda/bpm/engine/test/history/HistoricCaseActivityInstanceTest.oneTaskProcess.bpmn20.xml" })
public void testHistoricCalledProcessInstanceId() {
String taskId = "PI_ProcessTask_1";
createCaseInstanceByKey("oneProcessTaskCase").getId();
// as long as the process task is not activated there should be no process instance
assertCount(0, historyService.createHistoricProcessInstanceQuery());
HistoricCaseActivityInstance historicInstance = queryHistoricActivityCaseInstance(taskId);
assertNull(historicInstance.getCalledProcessInstanceId());
// start process task manually to create case instance
CaseExecution processTask = queryCaseExecutionByActivityId(taskId);
manualStart(processTask.getId());
// there should exist a new process instance
HistoricProcessInstance calledProcessInstance = historyService.createHistoricProcessInstanceQuery().singleResult();
assertNotNull(calledProcessInstance);
assertNotNull(calledProcessInstance.getEndTime());
// check that the called process instance id was correctly set
historicInstance = queryHistoricActivityCaseInstance(taskId);
assertEquals(calledProcessInstance.getId(), historicInstance.getCalledProcessInstanceId());
}
use of org.camunda.bpm.engine.history.HistoricCaseActivityInstance in project camunda-bpm-platform by camunda.
the class HistoricCaseActivityInstanceTest method assertHistoricCreateTime.
protected void assertHistoricCreateTime(String activityId, Date expectedCreateTime) {
HistoricCaseActivityInstance historicActivityInstance = queryHistoricActivityCaseInstance(activityId);
Date actualCreateTime = historicActivityInstance.getCreateTime();
assertSimilarDate(expectedCreateTime, actualCreateTime);
}
Aggregations