use of org.camunda.bpm.engine.impl.persistence.entity.PropertyChange in project camunda-bpm-platform by camunda.
the class SetExternalTaskRetriesCmd method execute.
@Override
protected void execute(ExternalTaskEntity externalTask) {
if (writeUserOperationLog) {
List<PropertyChange> propertyChanges = new ArrayList<PropertyChange>();
propertyChanges.add(new PropertyChange("retries", externalTask.getRetries(), retries));
Context.getCommandContext().getOperationLogManager().logProcessInstanceOperation(UserOperationLogEntry.OPERATION_TYPE_SET_EXTERNAL_TASK_RETRIES, externalTask.getProcessInstanceId(), externalTask.getProcessDefinitionId(), externalTask.getProcessDefinitionKey(), propertyChanges);
}
externalTask.setRetriesAndManageIncidents(retries);
}
use of org.camunda.bpm.engine.impl.persistence.entity.PropertyChange in project camunda-bpm-platform by camunda.
the class SetJobRetriesCmd method setJobRetriesByJobDefinitionId.
protected void setJobRetriesByJobDefinitionId(CommandContext commandContext) {
JobDefinitionManager jobDefinitionManager = commandContext.getJobDefinitionManager();
JobDefinitionEntity jobDefinition = jobDefinitionManager.findById(jobDefinitionId);
if (jobDefinition != null) {
String processDefinitionId = jobDefinition.getProcessDefinitionId();
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
checker.checkUpdateProcessInstanceByProcessDefinitionId(processDefinitionId);
}
}
commandContext.getJobManager().updateFailedJobRetriesByJobDefinitionId(jobDefinitionId, retries);
PropertyChange propertyChange = new PropertyChange(RETRIES, null, retries);
commandContext.getOperationLogManager().logJobOperation(getLogEntryOperation(), null, jobDefinitionId, null, null, null, propertyChange);
}
use of org.camunda.bpm.engine.impl.persistence.entity.PropertyChange in project camunda-bpm-platform by camunda.
the class DefaultHistoryEventProducer method createUserOperationLogEvents.
// User Operation Logs ///////////////////////////
public List<HistoryEvent> createUserOperationLogEvents(UserOperationLogContext context) {
List<HistoryEvent> historyEvents = new ArrayList<HistoryEvent>();
String operationId = Context.getCommandContext().getOperationId();
context.setOperationId(operationId);
for (UserOperationLogContextEntry entry : context.getEntries()) {
for (PropertyChange propertyChange : entry.getPropertyChanges()) {
UserOperationLogEntryEventEntity evt = new UserOperationLogEntryEventEntity();
initUserOperationLogEvent(evt, context, entry, propertyChange);
historyEvents.add(evt);
}
}
return historyEvents;
}
use of org.camunda.bpm.engine.impl.persistence.entity.PropertyChange in project camunda-bpm-platform by camunda.
the class DeleteHistoricProcessInstancesBatchCmd method writeUserOperationLog.
protected void writeUserOperationLog(CommandContext commandContext, String deleteReason, int numInstances, boolean async) {
List<PropertyChange> propertyChanges = new ArrayList<PropertyChange>();
propertyChanges.add(new PropertyChange("nrOfInstances", null, numInstances));
propertyChanges.add(new PropertyChange("async", null, async));
propertyChanges.add(new PropertyChange("type", null, "history"));
propertyChanges.add(new PropertyChange("deleteReason", null, deleteReason));
commandContext.getOperationLogManager().logProcessInstanceOperation(UserOperationLogEntry.OPERATION_TYPE_DELETE, null, null, null, propertyChanges);
}
use of org.camunda.bpm.engine.impl.persistence.entity.PropertyChange in project camunda-bpm-platform by camunda.
the class AbstractMigrationCmd method writeUserOperationLog.
protected void writeUserOperationLog(CommandContext commandContext, ProcessDefinitionEntity sourceProcessDefinition, ProcessDefinitionEntity targetProcessDefinition, int numInstances, boolean async) {
List<PropertyChange> propertyChanges = new ArrayList<PropertyChange>();
propertyChanges.add(new PropertyChange("processDefinitionId", sourceProcessDefinition.getId(), targetProcessDefinition.getId()));
propertyChanges.add(new PropertyChange("nrOfInstances", null, numInstances));
propertyChanges.add(new PropertyChange("async", null, async));
commandContext.getOperationLogManager().logProcessInstanceOperation(UserOperationLogEntry.OPERATION_TYPE_MIGRATE, null, sourceProcessDefinition.getId(), sourceProcessDefinition.getKey(), propertyChanges);
}
Aggregations