Search in sources :

Example 6 with UserOperationLogQuery

use of org.camunda.bpm.engine.history.UserOperationLogQuery in project camunda-bpm-platform by camunda.

the class UserOperationLogAuthorizationTest method testQuerySetStandaloneJobRetriesUserOperationLog.

// standalone job ///////////////////////////////
public void testQuerySetStandaloneJobRetriesUserOperationLog() {
    // given
    disableAuthorization();
    repositoryService.suspendProcessDefinitionByKey(ONE_TASK_PROCESS_KEY, true, new Date());
    enableAuthorization();
    disableAuthorization();
    String jobId = managementService.createJobQuery().singleResult().getId();
    managementService.setJobRetries(jobId, 5);
    enableAuthorization();
    // when
    UserOperationLogQuery query = historyService.createUserOperationLogQuery();
    // then
    verifyQueryResults(query, 1);
    disableAuthorization();
    managementService.deleteJob(jobId);
    enableAuthorization();
    clearDatabase();
}
Also used : UserOperationLogQuery(org.camunda.bpm.engine.history.UserOperationLogQuery) Date(java.util.Date)

Example 7 with UserOperationLogQuery

use of org.camunda.bpm.engine.history.UserOperationLogQuery in project camunda-bpm-platform by camunda.

the class UserOperationLogAuthorizationTest method testQuerySetAssigneeTaskUserOperationLogWithoutAuthorization.

// (process) user task /////////////////////////////
public void testQuerySetAssigneeTaskUserOperationLogWithoutAuthorization() {
    // given
    startProcessInstanceByKey(ONE_TASK_PROCESS_KEY);
    String taskId = selectSingleTask().getId();
    setAssignee(taskId, "demo");
    // when
    UserOperationLogQuery query = historyService.createUserOperationLogQuery();
    // then
    verifyQueryResults(query, 0);
}
Also used : UserOperationLogQuery(org.camunda.bpm.engine.history.UserOperationLogQuery)

Example 8 with UserOperationLogQuery

use of org.camunda.bpm.engine.history.UserOperationLogQuery in project camunda-bpm-platform by camunda.

the class UserOperationLogAuthorizationTest method testQuerySetAssigneeTaskUserOperationLogWithReadHistoryPermissionOnProcessDefinition.

public void testQuerySetAssigneeTaskUserOperationLogWithReadHistoryPermissionOnProcessDefinition() {
    // given
    startProcessInstanceByKey(ONE_TASK_PROCESS_KEY);
    String taskId = selectSingleTask().getId();
    setAssignee(taskId, "demo");
    createGrantAuthorization(PROCESS_DEFINITION, ONE_TASK_PROCESS_KEY, userId, READ_HISTORY);
    // when
    UserOperationLogQuery query = historyService.createUserOperationLogQuery();
    // then
    verifyQueryResults(query, 1);
}
Also used : UserOperationLogQuery(org.camunda.bpm.engine.history.UserOperationLogQuery)

Example 9 with UserOperationLogQuery

use of org.camunda.bpm.engine.history.UserOperationLogQuery in project camunda-bpm-platform by camunda.

the class UserOperationLogAuthorizationTest method testQuerySuspendProcessInstanceUserOperationLogWithReadHistoryPermissionOnAnyProcessDefinition.

public void testQuerySuspendProcessInstanceUserOperationLogWithReadHistoryPermissionOnAnyProcessDefinition() {
    // given
    String processInstanceId = startProcessInstanceByKey(ONE_TASK_PROCESS_KEY).getId();
    suspendProcessInstanceById(processInstanceId);
    createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, READ_HISTORY);
    // when
    UserOperationLogQuery query = historyService.createUserOperationLogQuery();
    // then
    verifyQueryResults(query, 1);
    clearDatabase();
}
Also used : UserOperationLogQuery(org.camunda.bpm.engine.history.UserOperationLogQuery)

Example 10 with UserOperationLogQuery

use of org.camunda.bpm.engine.history.UserOperationLogQuery in project camunda-bpm-platform by camunda.

the class BatchSuspensionTest method testUserOperationLogQueryByBatchEntityType.

@Test
@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_FULL)
public void testUserOperationLogQueryByBatchEntityType() {
    // given
    Batch batch1 = helper.migrateProcessInstancesAsync(1);
    Batch batch2 = helper.migrateProcessInstancesAsync(1);
    // when
    identityService.setAuthenticatedUserId(USER_ID);
    managementService.suspendBatchById(batch1.getId());
    managementService.suspendBatchById(batch2.getId());
    managementService.activateBatchById(batch1.getId());
    identityService.clearAuthentication();
    // then
    UserOperationLogQuery query = historyService.createUserOperationLogQuery().entityType(BATCH);
    assertEquals(3, query.count());
    assertEquals(3, query.list().size());
}
Also used : Batch(org.camunda.bpm.engine.batch.Batch) UserOperationLogQuery(org.camunda.bpm.engine.history.UserOperationLogQuery) Test(org.junit.Test) RequiredHistoryLevel(org.camunda.bpm.engine.test.RequiredHistoryLevel)

Aggregations

UserOperationLogQuery (org.camunda.bpm.engine.history.UserOperationLogQuery)67 Deployment (org.camunda.bpm.engine.test.Deployment)25 UserOperationLogEntry (org.camunda.bpm.engine.history.UserOperationLogEntry)20 Deployment (org.camunda.bpm.engine.repository.Deployment)10 ProcessDefinition (org.camunda.bpm.engine.repository.ProcessDefinition)6 Task (org.camunda.bpm.engine.task.Task)4 Date (java.util.Date)2 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)2 Batch (org.camunda.bpm.engine.batch.Batch)2 UserOperationLogQueryDto (org.camunda.bpm.engine.rest.dto.history.UserOperationLogQueryDto)2 RequiredHistoryLevel (org.camunda.bpm.engine.test.RequiredHistoryLevel)2 BpmnModelInstance (org.camunda.bpm.model.bpmn.BpmnModelInstance)2 Test (org.junit.Test)2 HistoricProcessInstance (org.camunda.bpm.engine.history.HistoricProcessInstance)1 CountResultDto (org.camunda.bpm.engine.rest.dto.CountResultDto)1 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)1