use of org.camunda.bpm.engine.history.HistoricTaskInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricTaskInstanceAuthorizationTest method testMixedQueryWithReadHistoryPermissionOnAnyProcessDefinition.
public void testMixedQueryWithReadHistoryPermissionOnAnyProcessDefinition() {
// given
startProcessInstanceByKey(PROCESS_KEY);
startProcessInstanceByKey(PROCESS_KEY);
startProcessInstanceByKey(PROCESS_KEY);
startProcessInstanceByKey(MESSAGE_START_PROCESS_KEY);
startProcessInstanceByKey(MESSAGE_START_PROCESS_KEY);
startProcessInstanceByKey(MESSAGE_START_PROCESS_KEY);
startProcessInstanceByKey(MESSAGE_START_PROCESS_KEY);
createTask("one");
createTask("two");
createTask("three");
createTask("four");
createTask("five");
createCaseInstanceByKey(CASE_KEY);
createCaseInstanceByKey(CASE_KEY);
createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, READ_HISTORY);
// when
HistoricTaskInstanceQuery query = historyService.createHistoricTaskInstanceQuery();
// then
verifyQueryResults(query, 14);
deleteTask("one", true);
deleteTask("two", true);
deleteTask("three", true);
deleteTask("four", true);
deleteTask("five", true);
}
use of org.camunda.bpm.engine.history.HistoricTaskInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricTaskInstanceAuthorizationTest method testQueryWithReadHistoryPermissionOnProcessDefinition.
public void testQueryWithReadHistoryPermissionOnProcessDefinition() {
// given
startProcessInstanceByKey(PROCESS_KEY);
startProcessInstanceByKey(PROCESS_KEY);
startProcessInstanceByKey(PROCESS_KEY);
startProcessInstanceByKey(MESSAGE_START_PROCESS_KEY);
startProcessInstanceByKey(MESSAGE_START_PROCESS_KEY);
startProcessInstanceByKey(MESSAGE_START_PROCESS_KEY);
startProcessInstanceByKey(MESSAGE_START_PROCESS_KEY);
createGrantAuthorization(PROCESS_DEFINITION, PROCESS_KEY, userId, READ_HISTORY);
// when
HistoricTaskInstanceQuery query = historyService.createHistoricTaskInstanceQuery();
// then
verifyQueryResults(query, 3);
}
use of org.camunda.bpm.engine.history.HistoricTaskInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricTaskInstanceAuthorizationTest method testSimpleQueryWithReadHistoryPermissionOnProcessDefinition.
public void testSimpleQueryWithReadHistoryPermissionOnProcessDefinition() {
// given
startProcessInstanceByKey(PROCESS_KEY);
createGrantAuthorization(PROCESS_DEFINITION, PROCESS_KEY, userId, READ_HISTORY);
// when
HistoricTaskInstanceQuery query = historyService.createHistoricTaskInstanceQuery();
// then
verifyQueryResults(query, 1);
}
use of org.camunda.bpm.engine.history.HistoricTaskInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricTaskInstanceAuthorizationTest method testDeleteHistoricTaskInstanceAfterDeletingDeployment.
public void testDeleteHistoricTaskInstanceAfterDeletingDeployment() {
// given
String processInstanceId = startProcessInstanceByKey(PROCESS_KEY).getId();
String taskId = selectSingleTask().getId();
disableAuthorization();
taskService.complete(taskId);
enableAuthorization();
createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, DELETE_HISTORY);
disableAuthorization();
repositoryService.deleteDeployment(deploymentId);
enableAuthorization();
// when
historyService.deleteHistoricTaskInstance(taskId);
// then
disableAuthorization();
HistoricTaskInstanceQuery query = historyService.createHistoricTaskInstanceQuery().taskId(taskId);
verifyQueryResults(query, 0);
enableAuthorization();
disableAuthorization();
historyService.deleteHistoricProcessInstance(processInstanceId);
enableAuthorization();
}
use of org.camunda.bpm.engine.history.HistoricTaskInstanceQuery in project camunda-bpm-platform by camunda.
the class CompleteProcessWithParallelGatewayTest method testQueryHistoricProcessWithParallelGateway.
@Test
@ScenarioUnderTest("init.complete.two.1")
public void testQueryHistoricProcessWithParallelGateway() {
// given an already finished process instance with parallel gateway and two user tasks
HistoricProcessInstance historicProcessInstance = rule.historicProcessInstance();
// when query history
HistoricTaskInstanceQuery historicTaskQuery = rule.getHistoryService().createHistoricTaskInstanceQuery().processInstanceId(historicProcessInstance.getId());
// then two historic user tasks are returned
Assert.assertEquals(2, historicTaskQuery.count());
}
Aggregations