use of org.camunda.bpm.engine.history.UserOperationLogEntry in project camunda-bpm-platform by camunda.
the class UserOperationLogTaskTest method testCompleteCaseExecution.
@Deployment(resources = { "org/camunda/bpm/engine/test/api/cmmn/oneTaskCase.cmmn" })
public void testCompleteCaseExecution() {
// given
String caseDefinitionId = repositoryService.createCaseDefinitionQuery().singleResult().getId();
String caseInstanceId = caseService.withCaseDefinition(caseDefinitionId).create().getId();
String humanTaskId = caseService.createCaseExecutionQuery().activityId("PI_HumanTask_1").singleResult().getId();
// when
caseService.withCaseExecution(humanTaskId).complete();
// then
UserOperationLogQuery query = queryOperationDetails(OPERATION_TYPE_COMPLETE);
assertEquals(1, query.count());
UserOperationLogEntry entry = query.singleResult();
assertNotNull(entry);
assertEquals(caseDefinitionId, entry.getCaseDefinitionId());
assertEquals(caseInstanceId, entry.getCaseInstanceId());
assertEquals(humanTaskId, entry.getCaseExecutionId());
assertEquals(deploymentId, entry.getDeploymentId());
assertFalse(Boolean.valueOf(entry.getOrgValue()));
assertTrue(Boolean.valueOf(entry.getNewValue()));
assertEquals(DELETE, entry.getProperty());
}
use of org.camunda.bpm.engine.history.UserOperationLogEntry in project camunda-bpm-platform by camunda.
the class UserOperationLogTaskTest method testCreateAndCompleteTask.
@Deployment(resources = { "org/camunda/bpm/engine/test/history/oneTaskProcess.bpmn20.xml" })
public void testCreateAndCompleteTask() {
startTestProcess();
// expect: no entry for the task creation by process engine
UserOperationLogQuery query = historyService.createUserOperationLogQuery();
assertEquals(0, query.count());
completeTestProcess();
// expect: one entry for the task completion
query = queryOperationDetails(OPERATION_TYPE_COMPLETE);
assertEquals(1, query.count());
UserOperationLogEntry complete = query.singleResult();
assertEquals(DELETE, complete.getProperty());
assertTrue(Boolean.parseBoolean(complete.getNewValue()));
}
use of org.camunda.bpm.engine.history.UserOperationLogEntry 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.UserOperationLogEntry 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.UserOperationLogEntry in project camunda-bpm-platform by camunda.
the class UserOperationLogDeploymentTest method testCreateDeployment.
public void testCreateDeployment() {
// when
Deployment deployment = repositoryService.createDeployment().name(DEPLOYMENT_NAME).addModelInstance(RESOURCE_NAME, createProcessWithServiceTask(PROCESS_KEY)).deploy();
// then
UserOperationLogEntry userOperationLogEntry = historyService.createUserOperationLogQuery().singleResult();
assertNotNull(userOperationLogEntry);
assertEquals(EntityTypes.DEPLOYMENT, userOperationLogEntry.getEntityType());
assertEquals(deployment.getId(), userOperationLogEntry.getDeploymentId());
assertEquals(UserOperationLogEntry.OPERATION_TYPE_CREATE, userOperationLogEntry.getOperationType());
assertEquals("duplicateFilterEnabled", userOperationLogEntry.getProperty());
assertNull(userOperationLogEntry.getOrgValue());
assertFalse(Boolean.valueOf(userOperationLogEntry.getNewValue()));
assertEquals(USER_ID, userOperationLogEntry.getUserId());
assertNull(userOperationLogEntry.getJobDefinitionId());
assertNull(userOperationLogEntry.getProcessInstanceId());
assertNull(userOperationLogEntry.getProcessDefinitionId());
assertNull(userOperationLogEntry.getProcessDefinitionKey());
assertNull(userOperationLogEntry.getCaseInstanceId());
assertNull(userOperationLogEntry.getCaseDefinitionId());
}
Aggregations