use of org.camunda.bpm.engine.history.UserOperationLogQuery in project camunda-bpm-platform by camunda.
the class UserOperationLogTaskTest method testDelegateTask.
@Deployment(resources = { "org/camunda/bpm/engine/test/history/oneTaskProcess.bpmn20.xml" })
public void testDelegateTask() {
startTestProcess();
// then: delegate the assigned task
taskService.claim(task.getId(), "icke");
taskService.delegateTask(task.getId(), "er");
// expect: three entries for the delegation
UserOperationLogQuery query = queryOperationDetails(OPERATION_TYPE_DELEGATE);
assertEquals(3, query.count());
// assert: details
assertEquals("icke", queryOperationDetails(OPERATION_TYPE_DELEGATE, OWNER).singleResult().getNewValue());
assertEquals("er", queryOperationDetails(OPERATION_TYPE_DELEGATE, ASSIGNEE).singleResult().getNewValue());
assertEquals(DelegationState.PENDING.toString(), queryOperationDetails(OPERATION_TYPE_DELEGATE, DELEGATION).singleResult().getNewValue());
completeTestProcess();
}
use of org.camunda.bpm.engine.history.UserOperationLogQuery in project camunda-bpm-platform by camunda.
the class UserOperationLogTaskTest method testChangeTaskOwner.
@Deployment(resources = { "org/camunda/bpm/engine/test/history/oneTaskProcess.bpmn20.xml" })
public void testChangeTaskOwner() {
startTestProcess();
// then: change the task owner
taskService.setOwner(task.getId(), "icke");
// expect: one entry for the owner change
UserOperationLogQuery query = queryOperationDetails(OPERATION_TYPE_SET_OWNER);
assertEquals(1, query.count());
// assert: details
UserOperationLogEntry change = query.singleResult();
assertEquals(OWNER, change.getProperty());
assertEquals("icke", change.getNewValue());
completeTestProcess();
}
use of org.camunda.bpm.engine.history.UserOperationLogQuery in project camunda-bpm-platform by camunda.
the class UserOperationLogTaskTest method testSubmitTaskForm_Resolve.
@Deployment(resources = { "org/camunda/bpm/engine/test/history/oneTaskProcess.bpmn20.xml" })
public void testSubmitTaskForm_Resolve() {
startTestProcess();
taskService.delegateTask(task.getId(), "demo");
formService.submitTaskForm(task.getId(), new HashMap<String, Object>());
// expect: two entries for the resolving (delegation and assignee changed)
UserOperationLogQuery query = queryOperationDetails(OPERATION_TYPE_RESOLVE);
assertEquals(2, query.count());
// assert: delegation
assertEquals(DelegationState.PENDING.toString(), query.property("delegation").singleResult().getOrgValue());
assertEquals(DelegationState.RESOLVED.toString(), query.property("delegation").singleResult().getNewValue());
// assert: assignee
assertEquals("demo", query.property("assignee").singleResult().getOrgValue());
assertEquals(null, query.property("assignee").singleResult().getNewValue());
completeTestProcess();
}
use of org.camunda.bpm.engine.history.UserOperationLogQuery in project camunda-bpm-platform by camunda.
the class UserOperationLogTaskTest method testClaimTask.
@Deployment(resources = { "org/camunda/bpm/engine/test/history/oneTaskProcess.bpmn20.xml" })
public void testClaimTask() {
startTestProcess();
// then: claim a new the task
taskService.claim(task.getId(), "icke");
// expect: one entry for the claim
UserOperationLogQuery query = queryOperationDetails(OPERATION_TYPE_CLAIM);
assertEquals(1, query.count());
// assert: details
UserOperationLogEntry claim = query.singleResult();
assertEquals(ASSIGNEE, claim.getProperty());
assertEquals("icke", claim.getNewValue());
completeTestProcess();
}
use of org.camunda.bpm.engine.history.UserOperationLogQuery in project camunda-bpm-platform by camunda.
the class LegacyUserOperationLogTest method testLogAllOperationWithAuthentication.
@Test
@Deployment(resources = "org/camunda/bpm/engine/test/history/useroperationlog/UserOperationLogTaskTest.testOnlyTaskCompletionIsLogged.bpmn20.xml")
public void testLogAllOperationWithAuthentication() {
try {
// given
identityService.setAuthenticatedUserId(USER_ID);
String processInstanceId = runtimeService.startProcessInstanceByKey("process").getId();
String taskId = taskService.createTaskQuery().singleResult().getId();
// when
taskService.complete(taskId);
// then
assertTrue((Boolean) runtimeService.getVariable(processInstanceId, "taskListenerCalled"));
assertTrue((Boolean) runtimeService.getVariable(processInstanceId, "serviceTaskCalled"));
UserOperationLogQuery query = userOperationLogQuery().userId(USER_ID);
assertEquals(3, query.count());
assertEquals(1, query.operationType(UserOperationLogEntry.OPERATION_TYPE_COMPLETE).count());
assertEquals(2, query.operationType(UserOperationLogEntry.OPERATION_TYPE_SET_VARIABLE).count());
} finally {
identityService.clearAuthentication();
}
}
Aggregations