use of org.camunda.bpm.engine.impl.persistence.entity.PropertyChange in project camunda-bpm-platform by camunda.
the class AbstractSetProcessDefinitionStateCmd method logUserOperation.
@Override
protected void logUserOperation(CommandContext commandContext) {
PropertyChange propertyChange = new PropertyChange(SUSPENSION_STATE_PROPERTY, null, getNewSuspensionState().getName());
commandContext.getOperationLogManager().logProcessDefinitionOperation(getLogEntryOperation(), processDefinitionId, processDefinitionKey, propertyChange);
}
use of org.camunda.bpm.engine.impl.persistence.entity.PropertyChange in project camunda-bpm-platform by camunda.
the class AbstractUpdateProcessInstancesSuspendStateCmd method writeUserOperationLog.
protected void writeUserOperationLog(CommandContext commandContext, int numInstances, boolean async) {
List<PropertyChange> propertyChanges = new ArrayList<PropertyChange>();
propertyChanges.add(new PropertyChange("nrOfInstances", null, numInstances));
propertyChanges.add(new PropertyChange("async", null, async));
String operationType;
if (suspending) {
operationType = UserOperationLogEntry.OPERATION_TYPE_SUSPEND_JOB;
} else {
operationType = UserOperationLogEntry.OPERATION_TYPE_ACTIVATE_JOB;
}
commandContext.getOperationLogManager().logProcessInstanceOperation(operationType, null, null, null, propertyChanges);
}
use of org.camunda.bpm.engine.impl.persistence.entity.PropertyChange in project camunda-bpm-platform by camunda.
the class AbstractDeleteProcessDefinitionCmd method deleteProcessDefinitionCmd.
protected void deleteProcessDefinitionCmd(CommandContext commandContext, String processDefinitionId, boolean cascade, boolean skipCustomListeners) {
ensureNotNull("processDefinitionId", processDefinitionId);
ProcessDefinition processDefinition = commandContext.getProcessDefinitionManager().findLatestProcessDefinitionById(processDefinitionId);
ensureNotNull(NotFoundException.class, "No process definition found with id '" + processDefinitionId + "'", "processDefinition", processDefinition);
List<CommandChecker> commandCheckers = commandContext.getProcessEngineConfiguration().getCommandCheckers();
for (CommandChecker checker : commandCheckers) {
checker.checkDeleteProcessDefinitionById(processDefinitionId);
}
UserOperationLogManager userOperationLogManager = commandContext.getOperationLogManager();
userOperationLogManager.logProcessDefinitionOperation(UserOperationLogEntry.OPERATION_TYPE_DELETE, processDefinitionId, processDefinition.getKey(), new PropertyChange("cascade", false, cascade));
ProcessDefinitionManager definitionManager = commandContext.getProcessDefinitionManager();
definitionManager.deleteProcessDefinition(processDefinition, processDefinitionId, cascade, cascade, skipCustomListeners);
}
use of org.camunda.bpm.engine.impl.persistence.entity.PropertyChange in project camunda-bpm-platform by camunda.
the class DeleteAttachmentCmd method execute.
public Object execute(CommandContext commandContext) {
AttachmentEntity attachment = commandContext.getDbEntityManager().selectById(AttachmentEntity.class, attachmentId);
commandContext.getDbEntityManager().delete(attachment);
if (attachment.getContentId() != null) {
commandContext.getByteArrayManager().deleteByteArrayById(attachment.getContentId());
}
if (attachment.getTaskId() != null) {
TaskEntity task = commandContext.getTaskManager().findTaskById(attachment.getTaskId());
PropertyChange propertyChange = new PropertyChange("name", null, attachment.getName());
commandContext.getOperationLogManager().logAttachmentOperation(UserOperationLogEntry.OPERATION_TYPE_DELETE_ATTACHMENT, task, propertyChange);
}
return null;
}
use of org.camunda.bpm.engine.impl.persistence.entity.PropertyChange in project camunda-bpm-platform by camunda.
the class DeleteTaskAttachmentCmd method execute.
public Object execute(CommandContext commandContext) {
AttachmentEntity attachment = (AttachmentEntity) commandContext.getAttachmentManager().findAttachmentByTaskIdAndAttachmentId(taskId, attachmentId);
ensureNotNull("No attachment exist for task id '" + taskId + " and attachmentId '" + attachmentId + "'.", "attachment", attachment);
commandContext.getDbEntityManager().delete(attachment);
if (attachment.getContentId() != null) {
commandContext.getByteArrayManager().deleteByteArrayById(attachment.getContentId());
}
if (attachment.getTaskId() != null) {
TaskEntity task = commandContext.getTaskManager().findTaskById(attachment.getTaskId());
PropertyChange propertyChange = new PropertyChange("name", null, attachment.getName());
commandContext.getOperationLogManager().logAttachmentOperation(UserOperationLogEntry.OPERATION_TYPE_DELETE_ATTACHMENT, task, propertyChange);
}
return null;
}
Aggregations