use of org.camunda.bpm.engine.history.UserOperationLogQuery in project camunda-bpm-platform by camunda.
the class UserOperationLogRestServiceImpl method queryUserOperationEntries.
@Override
public List<UserOperationLogEntryDto> queryUserOperationEntries(UriInfo uriInfo, Integer firstResult, Integer maxResults) {
UserOperationLogQueryDto queryDto = new UserOperationLogQueryDto(objectMapper, uriInfo.getQueryParameters());
UserOperationLogQuery query = queryDto.toQuery(processEngine);
if (firstResult == null && maxResults == null) {
return UserOperationLogEntryDto.map(query.list());
} else {
if (firstResult == null) {
firstResult = 0;
}
if (maxResults == null) {
maxResults = Integer.MAX_VALUE;
}
return UserOperationLogEntryDto.map(query.listPage(firstResult, maxResults));
}
}
use of org.camunda.bpm.engine.history.UserOperationLogQuery in project camunda-bpm-platform by camunda.
the class UserOperationLogAuthorizationTest method testQuerySuspendProcessDefinitionUserOperationLogWithoutAuthorization.
// process definition ////////////////////////////////////////////
public void testQuerySuspendProcessDefinitionUserOperationLogWithoutAuthorization() {
// given
suspendProcessDefinitionByKey(ONE_TASK_PROCESS_KEY);
// when
UserOperationLogQuery query = historyService.createUserOperationLogQuery();
// then
verifyQueryResults(query, 0);
clearDatabase();
}
use of org.camunda.bpm.engine.history.UserOperationLogQuery in project camunda-bpm-platform by camunda.
the class UserOperationLogAuthorizationTest method testQueryAfterDeletingDeployment.
// delete deployment (cascade = false)
public void testQueryAfterDeletingDeployment() {
// given
startProcessInstanceByKey(ONE_TASK_PROCESS_KEY);
String taskId = selectSingleTask().getId();
setAssignee(taskId, "demo");
createGrantAuthorization(PROCESS_DEFINITION, ONE_TASK_PROCESS_KEY, userId, READ_HISTORY);
disableAuthorization();
taskService.complete(taskId);
enableAuthorization();
deleteDeployment(deploymentId, false);
// when
UserOperationLogQuery query = historyService.createUserOperationLogQuery();
// then
verifyQueryResults(query, 2);
disableAuthorization();
List<HistoricProcessInstance> instances = historyService.createHistoricProcessInstanceQuery().list();
for (HistoricProcessInstance instance : instances) {
historyService.deleteHistoricProcessInstance(instance.getId());
}
enableAuthorization();
}
use of org.camunda.bpm.engine.history.UserOperationLogQuery in project camunda-bpm-platform by camunda.
the class UserOperationLogAuthorizationTest method testQuerySetJobRetriesUserOperationLogWithReadHistoryPermissionOnProcessDefinition.
public void testQuerySetJobRetriesUserOperationLogWithReadHistoryPermissionOnProcessDefinition() {
// given
startProcessInstanceByKey(TIMER_BOUNDARY_PROCESS_KEY);
String jobId = selectSingleJob().getId();
disableAuthorization();
managementService.setJobRetries(jobId, 5);
enableAuthorization();
createGrantAuthorization(PROCESS_DEFINITION, TIMER_BOUNDARY_PROCESS_KEY, userId, READ_HISTORY);
// when
UserOperationLogQuery query = historyService.createUserOperationLogQuery();
// then
verifyQueryResults(query, 1);
}
use of org.camunda.bpm.engine.history.UserOperationLogQuery in project camunda-bpm-platform by camunda.
the class UserOperationLogAuthorizationTest method testQuerySuspendProcessDefinitionUserOperationLogWithReadHistoryPermissionOnAnyProcessDefinition.
public void testQuerySuspendProcessDefinitionUserOperationLogWithReadHistoryPermissionOnAnyProcessDefinition() {
// given
suspendProcessDefinitionByKey(ONE_TASK_PROCESS_KEY);
createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, READ_HISTORY);
// when
UserOperationLogQuery query = historyService.createUserOperationLogQuery();
// then
verifyQueryResults(query, 1);
clearDatabase();
}
Aggregations