use of org.camunda.bpm.engine.impl.oplog.UserOperationLogContext in project camunda-bpm-platform by camunda.
the class UserOperationLogManager method logBatchOperation.
public void logBatchOperation(String operation, String batchId, PropertyChange propertyChange) {
if (isUserOperationLogEnabled()) {
UserOperationLogContext context = new UserOperationLogContext();
UserOperationLogContextEntryBuilder entryBuilder = UserOperationLogContextEntryBuilder.entry(operation, EntityTypes.BATCH).batchId(batchId).propertyChanges(propertyChange);
context.addEntry(entryBuilder.create());
fireUserOperationLog(context);
}
}
use of org.camunda.bpm.engine.impl.oplog.UserOperationLogContext in project camunda-bpm-platform by camunda.
the class UserOperationLogManager method logVariableOperation.
public void logVariableOperation(String operation, String executionId, String taskId, PropertyChange propertyChange) {
if (isUserOperationLogEnabled()) {
UserOperationLogContext context = new UserOperationLogContext();
UserOperationLogContextEntryBuilder entryBuilder = UserOperationLogContextEntryBuilder.entry(operation, EntityTypes.VARIABLE).propertyChanges(propertyChange);
if (executionId != null) {
ExecutionEntity execution = getProcessInstanceManager().findExecutionById(executionId);
entryBuilder.inContextOf(execution);
} else if (taskId != null) {
TaskEntity task = getTaskManager().findTaskById(taskId);
entryBuilder.inContextOf(task, Arrays.asList(propertyChange));
}
context.addEntry(entryBuilder.create());
fireUserOperationLog(context);
}
}
use of org.camunda.bpm.engine.impl.oplog.UserOperationLogContext in project camunda-bpm-platform by camunda.
the class UserOperationLogManager method logAttachmentOperation.
public void logAttachmentOperation(String operation, ExecutionEntity processInstance, PropertyChange propertyChange) {
if (isUserOperationLogEnabled()) {
UserOperationLogContext context = new UserOperationLogContext();
UserOperationLogContextEntryBuilder entryBuilder = UserOperationLogContextEntryBuilder.entry(operation, EntityTypes.ATTACHMENT).inContextOf(processInstance, Arrays.asList(propertyChange));
context.addEntry(entryBuilder.create());
fireUserOperationLog(context);
}
}
use of org.camunda.bpm.engine.impl.oplog.UserOperationLogContext in project camunda-bpm-platform by camunda.
the class CustomUserOperationLogTest method testDoNotOverwriteUserId.
@Test
public void testDoNotOverwriteUserId() throws Exception {
commandExecutor.execute(new Command<Void>() {
@Override
public Void execute(final CommandContext commandContext) {
final UserOperationLogContext userOperationLogContext = new UserOperationLogContext();
userOperationLogContext.setUserId("kermit");
final UserOperationLogContextEntry entry = new UserOperationLogContextEntry("foo", "bar");
entry.setPropertyChanges(Arrays.asList(new PropertyChange(null, null, null)));
entry.setTaskId(TASK_ID);
userOperationLogContext.addEntry(entry);
commandContext.getOperationLogManager().logUserOperations(userOperationLogContext);
return null;
}
});
// and check its there
assertThat(historyService.createUserOperationLogQuery().taskId(TASK_ID).singleResult().getUserId(), is("kermit"));
}
Aggregations