use of org.camunda.bpm.engine.history.HistoricDetailQuery in project camunda-bpm-platform by camunda.
the class HistoricDetailAuthorizationTest method testQueryAfterDeletingDeployment.
// delete deployment (cascade = false)
public void testQueryAfterDeletingDeployment() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
disableAuthorization();
formService.submitTaskForm(taskId, getVariables());
enableAuthorization();
startProcessInstanceByKey(PROCESS_KEY);
taskId = selectSingleTask().getId();
disableAuthorization();
formService.submitTaskForm(taskId, getVariables());
enableAuthorization();
startProcessInstanceByKey(PROCESS_KEY, getVariables());
startProcessInstanceByKey(PROCESS_KEY, getVariables());
startProcessInstanceByKey(PROCESS_KEY, getVariables());
createGrantAuthorization(PROCESS_DEFINITION, PROCESS_KEY, userId, READ_HISTORY);
disableAuthorization();
List<Task> tasks = taskService.createTaskQuery().list();
for (Task task : tasks) {
taskService.complete(task.getId());
}
enableAuthorization();
disableAuthorization();
repositoryService.deleteDeployment(deploymentId);
enableAuthorization();
// when
HistoricDetailQuery query = historyService.createHistoricDetailQuery();
// then
verifyQueryResults(query, 7);
disableAuthorization();
List<HistoricProcessInstance> instances = historyService.createHistoricProcessInstanceQuery().list();
for (HistoricProcessInstance instance : instances) {
historyService.deleteHistoricProcessInstance(instance.getId());
}
enableAuthorization();
}
use of org.camunda.bpm.engine.history.HistoricDetailQuery in project camunda-bpm-platform by camunda.
the class HistoricDetailAuthorizationTest method testSimpleVariableUpdateQueryWithReadHistoryPermissionOnAnyProcessDefinition.
public void testSimpleVariableUpdateQueryWithReadHistoryPermissionOnAnyProcessDefinition() {
// given
startProcessInstanceByKey(PROCESS_KEY, getVariables());
createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, READ_HISTORY);
// when
HistoricDetailQuery query = historyService.createHistoricDetailQuery().variableUpdates();
// then
verifyQueryResults(query, 1);
}
use of org.camunda.bpm.engine.history.HistoricDetailQuery in project camunda-bpm-platform by camunda.
the class HistoricDetailAuthorizationTest method testDetailQueryWithReadHistoryOnAnyProcessDefinition.
public void testDetailQueryWithReadHistoryOnAnyProcessDefinition() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
disableAuthorization();
formService.submitTaskForm(taskId, getVariables());
enableAuthorization();
startProcessInstanceByKey(PROCESS_KEY);
taskId = selectSingleTask().getId();
disableAuthorization();
formService.submitTaskForm(taskId, getVariables());
enableAuthorization();
startProcessInstanceByKey(PROCESS_KEY, getVariables());
startProcessInstanceByKey(PROCESS_KEY, getVariables());
startProcessInstanceByKey(PROCESS_KEY, getVariables());
createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, READ_HISTORY);
// when
HistoricDetailQuery query = historyService.createHistoricDetailQuery();
// then
verifyQueryResults(query, 7);
}
use of org.camunda.bpm.engine.history.HistoricDetailQuery in project camunda-bpm-platform by camunda.
the class HistoricDetailAuthorizationTest method testFormFieldQueryWithReadHistoryPermissionOnProcessDefinition.
public void testFormFieldQueryWithReadHistoryPermissionOnProcessDefinition() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
disableAuthorization();
formService.submitTaskForm(taskId, getVariables());
enableAuthorization();
startProcessInstanceByKey(PROCESS_KEY);
taskId = selectSingleTask().getId();
disableAuthorization();
formService.submitTaskForm(taskId, getVariables());
enableAuthorization();
startProcessInstanceByKey(PROCESS_KEY);
taskId = selectSingleTask().getId();
disableAuthorization();
formService.submitTaskForm(taskId, getVariables());
enableAuthorization();
startProcessInstanceByKey(MESSAGE_START_PROCESS_KEY);
taskId = selectSingleTask().getId();
disableAuthorization();
formService.submitTaskForm(taskId, getVariables());
enableAuthorization();
startProcessInstanceByKey(MESSAGE_START_PROCESS_KEY);
taskId = selectSingleTask().getId();
disableAuthorization();
formService.submitTaskForm(taskId, getVariables());
enableAuthorization();
startProcessInstanceByKey(MESSAGE_START_PROCESS_KEY);
taskId = selectSingleTask().getId();
disableAuthorization();
formService.submitTaskForm(taskId, getVariables());
enableAuthorization();
startProcessInstanceByKey(MESSAGE_START_PROCESS_KEY);
taskId = selectSingleTask().getId();
disableAuthorization();
formService.submitTaskForm(taskId, getVariables());
enableAuthorization();
createGrantAuthorization(PROCESS_DEFINITION, PROCESS_KEY, userId, READ_HISTORY);
// when
HistoricDetailQuery query = historyService.createHistoricDetailQuery().formFields();
// then
verifyQueryResults(query, 3);
}
use of org.camunda.bpm.engine.history.HistoricDetailQuery in project camunda-bpm-platform by camunda.
the class HistoricDetailAuthorizationTest method testQueryAfterStandaloneTaskVariableUpdates.
// historic variable update query (standalone task) /////////////////////////////////////////////
public void testQueryAfterStandaloneTaskVariableUpdates() {
// given
String taskId = "myTask";
createTask(taskId);
disableAuthorization();
taskService.setVariables(taskId, getVariables());
enableAuthorization();
// when
HistoricDetailQuery query = historyService.createHistoricDetailQuery().variableUpdates();
// then
verifyQueryResults(query, 1);
deleteTask(taskId, true);
}
Aggregations