Search in sources :

Example 6 with UserOperationLogContextEntryBuilder

use of org.camunda.bpm.engine.impl.oplog.UserOperationLogContextEntryBuilder in project camunda-bpm-platform by camunda.

the class UserOperationLogManager method logTaskOperations.

public void logTaskOperations(String operation, TaskEntity task, List<PropertyChange> propertyChanges) {
    if (isUserOperationLogEnabled()) {
        UserOperationLogContext context = new UserOperationLogContext();
        UserOperationLogContextEntryBuilder entryBuilder = UserOperationLogContextEntryBuilder.entry(operation, EntityTypes.TASK).inContextOf(task, propertyChanges);
        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 7 with UserOperationLogContextEntryBuilder

use of org.camunda.bpm.engine.impl.oplog.UserOperationLogContextEntryBuilder in project camunda-bpm-platform by camunda.

the class UserOperationLogManager method logJobDefinitionOperation.

public void logJobDefinitionOperation(String operation, String jobDefinitionId, String processDefinitionId, String processDefinitionKey, PropertyChange propertyChange) {
    if (isUserOperationLogEnabled()) {
        UserOperationLogContext context = new UserOperationLogContext();
        UserOperationLogContextEntryBuilder entryBuilder = UserOperationLogContextEntryBuilder.entry(operation, EntityTypes.JOB_DEFINITION).jobDefinitionId(jobDefinitionId).processDefinitionId(processDefinitionId).processDefinitionKey(processDefinitionKey).propertyChanges(propertyChange);
        if (jobDefinitionId != null) {
            JobDefinitionEntity jobDefinition = getJobDefinitionManager().findById(jobDefinitionId);
            // Backward compatibility
            if (jobDefinition != null) {
                entryBuilder.inContextOf(jobDefinition);
            }
        } else if (processDefinitionId != null) {
            ProcessDefinitionEntity definition = getProcessDefinitionManager().findLatestProcessDefinitionById(processDefinitionId);
            // Backward compatibility
            if (definition != null) {
                entryBuilder.inContextOf(definition);
            }
        }
        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 8 with UserOperationLogContextEntryBuilder

use of org.camunda.bpm.engine.impl.oplog.UserOperationLogContextEntryBuilder in project camunda-bpm-platform by camunda.

the class UserOperationLogManager method logProcessInstanceOperation.

public void logProcessInstanceOperation(String operation, String processInstanceId, String processDefinitionId, String processDefinitionKey, List<PropertyChange> propertyChanges) {
    if (isUserOperationLogEnabled()) {
        UserOperationLogContext context = new UserOperationLogContext();
        UserOperationLogContextEntryBuilder entryBuilder = UserOperationLogContextEntryBuilder.entry(operation, EntityTypes.PROCESS_INSTANCE).propertyChanges(propertyChanges).processInstanceId(processInstanceId).processDefinitionId(processDefinitionId).processDefinitionKey(processDefinitionKey);
        if (processInstanceId != null) {
            ExecutionEntity instance = getProcessInstanceManager().findExecutionById(processInstanceId);
            if (instance != null) {
                entryBuilder.inContextOf(instance);
            }
        } else if (processDefinitionId != null) {
            ProcessDefinitionEntity definition = getProcessDefinitionManager().findLatestProcessDefinitionById(processDefinitionId);
            if (definition != null) {
                entryBuilder.inContextOf(definition);
            }
        }
        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 9 with UserOperationLogContextEntryBuilder

use of org.camunda.bpm.engine.impl.oplog.UserOperationLogContextEntryBuilder in project camunda-bpm-platform by camunda.

the class UserOperationLogManager method logProcessDefinitionOperation.

public void logProcessDefinitionOperation(String operation, String processDefinitionId, String processDefinitionKey, PropertyChange propertyChange) {
    if (isUserOperationLogEnabled()) {
        UserOperationLogContext context = new UserOperationLogContext();
        UserOperationLogContextEntryBuilder entryBuilder = UserOperationLogContextEntryBuilder.entry(operation, EntityTypes.PROCESS_DEFINITION).propertyChanges(propertyChange).processDefinitionId(processDefinitionId).processDefinitionKey(processDefinitionKey);
        if (processDefinitionId != null) {
            ProcessDefinitionEntity definition = getProcessDefinitionManager().findLatestProcessDefinitionById(processDefinitionId);
            entryBuilder.inContextOf(definition);
        }
        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 10 with UserOperationLogContextEntryBuilder

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