use of org.camunda.bpm.engine.history.UserOperationLogQuery in project camunda-bpm-platform by camunda.
the class UserOperationLogDeletionTest method testDeleteProcessTaskKeepTaskOperationLog.
@Deployment(resources = PROCESS_PATH)
public void testDeleteProcessTaskKeepTaskOperationLog() {
// given
runtimeService.startProcessInstanceByKey(PROCESS_KEY);
String taskId = taskService.createTaskQuery().singleResult().getId();
taskService.setAssignee(taskId, "demo");
taskService.complete(taskId);
UserOperationLogQuery query = historyService.createUserOperationLogQuery().taskId(taskId);
assertEquals(2, query.count());
// when
historyService.deleteHistoricTaskInstance(taskId);
// then
assertEquals(2, query.count());
}
use of org.camunda.bpm.engine.history.UserOperationLogQuery in project camunda-bpm-platform by camunda.
the class UserOperationLogDeletionTest method testDeleteProcessInstanceKeepUserOperationLog.
@Deployment(resources = PROCESS_PATH)
public void testDeleteProcessInstanceKeepUserOperationLog() {
// given
String processInstanceId = runtimeService.startProcessInstanceByKey(PROCESS_KEY).getId();
runtimeService.suspendProcessInstanceById(processInstanceId);
runtimeService.activateProcessInstanceById(processInstanceId);
String taskId = taskService.createTaskQuery().singleResult().getId();
taskService.complete(taskId);
UserOperationLogQuery query = historyService.createUserOperationLogQuery().processInstanceId(processInstanceId);
assertEquals(3, query.count());
// when
historyService.deleteHistoricProcessInstance(processInstanceId);
// then
assertEquals(3, query.count());
}
Aggregations