Search in sources :

Example 11 with UserOperationLogContextEntryBuilder

use of org.camunda.bpm.engine.impl.oplog.UserOperationLogContextEntryBuilder 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);
    }
}
Also used : UserOperationLogContext(org.camunda.bpm.engine.impl.oplog.UserOperationLogContext) UserOperationLogContextEntryBuilder(org.camunda.bpm.engine.impl.oplog.UserOperationLogContextEntryBuilder)

Example 12 with UserOperationLogContextEntryBuilder

use of org.camunda.bpm.engine.impl.oplog.UserOperationLogContextEntryBuilder 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);
    }
}
Also used : UserOperationLogContext(org.camunda.bpm.engine.impl.oplog.UserOperationLogContext) UserOperationLogContextEntryBuilder(org.camunda.bpm.engine.impl.oplog.UserOperationLogContextEntryBuilder)

Aggregations

UserOperationLogContext (org.camunda.bpm.engine.impl.oplog.UserOperationLogContext)12 UserOperationLogContextEntryBuilder (org.camunda.bpm.engine.impl.oplog.UserOperationLogContextEntryBuilder)12