runtimeService.deleteProcessInstance(process.getId(), "a delete reason");
// then
assertEquals(3, query().entityType(PROCESS_INSTANCE).count());
UserOperationLogEntry deleteEntry = query()
.entityType(PROCESS_INSTANCE)
.processInstanceId(process.getId())
.operationType(OPERATION_TYPE_DELETE)
.singleResult();
assertNotNull(deleteEntry);
assertEquals(process.getId(), deleteEntry.getProcessInstanceId());
assertNull(deleteEntry.getProcessDefinitionId());
assertNull(deleteEntry.getProcessDefinitionKey());
UserOperationLogEntry suspendEntry = query()
.entityType(PROCESS_INSTANCE)
.processInstanceId(process.getId())
.operationType(OPERATION_TYPE_SUSPEND)
.singleResult();
assertNotNull(suspendEntry);
assertEquals(process.getId(), suspendEntry.getProcessInstanceId());
assertNull(suspendEntry.getProcessDefinitionId());
assertNull(suspendEntry.getProcessDefinitionKey());
assertEquals("suspensionState", suspendEntry.getProperty());
assertEquals("suspended", suspendEntry.getNewValue());
assertNull(suspendEntry.getOrgValue());
UserOperationLogEntry activateEntry = query()
.entityType(PROCESS_INSTANCE)
.processInstanceId(process.getId())
.operationType(OPERATION_TYPE_ACTIVATE)
.singleResult();
assertNotNull(activateEntry);
assertEquals(process.getId(), activateEntry.getProcessInstanceId());
assertNull(activateEntry.getProcessDefinitionId());
assertNull(activateEntry.getProcessDefinitionKey());
assertEquals("suspensionState", activateEntry.getProperty());
assertEquals("active", activateEntry.getNewValue());
assertNull(activateEntry.getOrgValue());
}