use of org.camunda.bpm.engine.history.HistoricCaseActivityInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricCaseActivityInstanceTest method testAutoCompleteStageWithRepeatableTaskWithoutEntryCriteria.
@Deployment(resources = { "org/camunda/bpm/engine/test/cmmn/repetition/RepetitionRuleTest.testAutoCompleteStageWithoutEntryCriteria.cmmn" })
public void testAutoCompleteStageWithRepeatableTaskWithoutEntryCriteria() {
// given
createCaseInstanceByKey("case", Variables.createVariables().putValue("manualActivation", false));
queryCaseExecutionByActivityId("PI_Stage_1");
// when
String humanTask = queryCaseExecutionByActivityId("PI_HumanTask_1").getId();
complete(humanTask);
// then
HistoricCaseActivityInstanceQuery query = historicQuery().caseActivityId("PI_HumanTask_1");
assertEquals(2, query.count());
query = historicQuery().caseActivityId("PI_Stage_1");
assertEquals(1, query.count());
}
use of org.camunda.bpm.engine.history.HistoricCaseActivityInstanceQuery 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.HistoricCaseActivityInstanceQuery 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());
}
use of org.camunda.bpm.engine.history.HistoricCaseActivityInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricCaseActivityInstanceTest method testAutoCompleteStage.
@Deployment(resources = { "org/camunda/bpm/engine/test/cmmn/repetition/RepetitionRuleTest.testAutoCompleteStage.cmmn" })
public void testAutoCompleteStage() {
// given
createCaseInstance();
String humanTask1 = queryCaseExecutionByActivityId("PI_HumanTask_1").getId();
// when
complete(humanTask1);
// then
HistoricCaseActivityInstanceQuery query = historicQuery().caseActivityId("PI_Stage_1");
assertEquals(1, query.count());
query = historicQuery().caseActivityId("PI_HumanTask_1");
assertEquals(1, query.count());
query = historicQuery().caseActivityId("PI_HumanTask_2");
assertEquals(2, query.count());
}
use of org.camunda.bpm.engine.history.HistoricCaseActivityInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricCaseActivityInstanceQueryTest method testQueryDisabledTenantCheck.
public void testQueryDisabledTenantCheck() {
processEngineConfiguration.setTenantCheckEnabled(false);
identityService.setAuthentication("user", null, null);
HistoricCaseActivityInstanceQuery query = historyService.createHistoricCaseActivityInstanceQuery();
assertThat(query.count(), is(2L));
}
Aggregations