Search in sources :

Example 1 with UserOperationLogContext

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

the class UserOperationLogManager method logDecisionInstanceOperation.

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

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, TaskEntity task, PropertyChange propertyChange) {
    if (isUserOperationLogEnabled()) {
        UserOperationLogContext context = new UserOperationLogContext();
        UserOperationLogContextEntryBuilder entryBuilder = UserOperationLogContextEntryBuilder.entry(operation, EntityTypes.ATTACHMENT).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 3 with UserOperationLogContext

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

the class UserOperationLogManager method logJobOperation.

public void logJobOperation(String operation, String jobId, String jobDefinitionId, String processInstanceId, String processDefinitionId, String processDefinitionKey, PropertyChange propertyChange) {
    if (isUserOperationLogEnabled()) {
        UserOperationLogContext context = new UserOperationLogContext();
        UserOperationLogContextEntryBuilder entryBuilder = UserOperationLogContextEntryBuilder.entry(operation, EntityTypes.JOB).jobId(jobId).jobDefinitionId(jobDefinitionId).processDefinitionId(processDefinitionId).processDefinitionKey(processDefinitionKey).propertyChanges(propertyChange);
        if (jobId != null) {
            JobEntity job = getJobManager().findJobById(jobId);
            // Backward compatibility
            if (job != null) {
                entryBuilder.inContextOf(job);
            }
        } else if (jobDefinitionId != null) {
            JobDefinitionEntity jobDefinition = getJobDefinitionManager().findById(jobDefinitionId);
            // Backward compatibility
            if (jobDefinition != null) {
                entryBuilder.inContextOf(jobDefinition);
            }
        } else if (processInstanceId != null) {
            ExecutionEntity processInstance = getProcessInstanceManager().findExecutionById(processInstanceId);
            // Backward compatibility
            if (processInstance != null) {
                entryBuilder.inContextOf(processInstance);
            }
        } 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 4 with UserOperationLogContext

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

the class UserOperationLogManager method logDeploymentOperation.

public void logDeploymentOperation(String operation, String deploymentId, List<PropertyChange> propertyChanges) {
    if (isUserOperationLogEnabled()) {
        UserOperationLogContext context = new UserOperationLogContext();
        UserOperationLogContextEntryBuilder entryBuilder = UserOperationLogContextEntryBuilder.entry(operation, EntityTypes.DEPLOYMENT).deploymentId(deploymentId).propertyChanges(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 5 with UserOperationLogContext

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

the class UserOperationLogManager method logLinkOperation.

public void logLinkOperation(String operation, TaskEntity task, PropertyChange propertyChange) {
    if (isUserOperationLogEnabled()) {
        UserOperationLogContext context = new UserOperationLogContext();
        UserOperationLogContextEntryBuilder entryBuilder = UserOperationLogContextEntryBuilder.entry(operation, EntityTypes.IDENTITY_LINK).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)

Aggregations

UserOperationLogContext (org.camunda.bpm.engine.impl.oplog.UserOperationLogContext)14 UserOperationLogContextEntryBuilder (org.camunda.bpm.engine.impl.oplog.UserOperationLogContextEntryBuilder)12 CommandContext (org.camunda.bpm.engine.impl.interceptor.CommandContext)1 UserOperationLogContextEntry (org.camunda.bpm.engine.impl.oplog.UserOperationLogContextEntry)1 JobDefinitionEntity (org.camunda.bpm.engine.impl.persistence.entity.JobDefinitionEntity)1 PropertyChange (org.camunda.bpm.engine.impl.persistence.entity.PropertyChange)1 Test (org.junit.Test)1