use of org.camunda.bpm.engine.impl.oplog.UserOperationLogContext 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);
}
}
use of org.camunda.bpm.engine.impl.oplog.UserOperationLogContext 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);
}
}
use of org.camunda.bpm.engine.impl.oplog.UserOperationLogContext in project camunda-bpm-platform by camunda.
the class SetJobDefinitionPriorityCmd method execute.
public Void execute(CommandContext commandContext) {
ensureNotNull(NotValidException.class, "jobDefinitionId", jobDefinitionId);
JobDefinitionEntity jobDefinition = commandContext.getJobDefinitionManager().findById(jobDefinitionId);
ensureNotNull(NotFoundException.class, "Job definition with id '" + jobDefinitionId + "' does not exist", "jobDefinition", jobDefinition);
checkUpdateProcess(commandContext, jobDefinition);
Long currentPriority = jobDefinition.getOverridingJobPriority();
jobDefinition.setJobPriority(priority);
UserOperationLogContext opLogContext = new UserOperationLogContext();
createJobDefinitionOperationLogEntry(opLogContext, currentPriority, jobDefinition);
if (cascade && priority != null) {
commandContext.getJobManager().updateJobPriorityByDefinitionId(jobDefinitionId, priority);
createCascadeJobsOperationLogEntry(opLogContext, jobDefinition);
}
commandContext.getOperationLogManager().logUserOperations(opLogContext);
return null;
}
use of org.camunda.bpm.engine.impl.oplog.UserOperationLogContext 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);
}
}
use of org.camunda.bpm.engine.impl.oplog.UserOperationLogContext 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);
}
}
Aggregations