Search in sources :

Example 16 with PropertyChange

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);
}
Also used : PropertyChange(org.camunda.bpm.engine.impl.persistence.entity.PropertyChange) ArrayList(java.util.ArrayList)

Example 17 with PropertyChange

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);
}
Also used : JobDefinitionEntity(org.camunda.bpm.engine.impl.persistence.entity.JobDefinitionEntity) PropertyChange(org.camunda.bpm.engine.impl.persistence.entity.PropertyChange) JobDefinitionManager(org.camunda.bpm.engine.impl.persistence.entity.JobDefinitionManager) CommandChecker(org.camunda.bpm.engine.impl.cfg.CommandChecker)

Example 18 with 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;
}
Also used : PropertyChange(org.camunda.bpm.engine.impl.persistence.entity.PropertyChange) ArrayList(java.util.ArrayList) UserOperationLogContextEntry(org.camunda.bpm.engine.impl.oplog.UserOperationLogContextEntry)

Example 19 with PropertyChange

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);
}
Also used : PropertyChange(org.camunda.bpm.engine.impl.persistence.entity.PropertyChange) ArrayList(java.util.ArrayList)

Example 20 with PropertyChange

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);
}
Also used : PropertyChange(org.camunda.bpm.engine.impl.persistence.entity.PropertyChange) ArrayList(java.util.ArrayList)

Aggregations

PropertyChange (org.camunda.bpm.engine.impl.persistence.entity.PropertyChange)35 ArrayList (java.util.ArrayList)12 CommandChecker (org.camunda.bpm.engine.impl.cfg.CommandChecker)4 UserOperationLogContextEntry (org.camunda.bpm.engine.impl.oplog.UserOperationLogContextEntry)4 TaskEntity (org.camunda.bpm.engine.impl.persistence.entity.TaskEntity)4 AttachmentEntity (org.camunda.bpm.engine.impl.persistence.entity.AttachmentEntity)3 UserOperationLogManager (org.camunda.bpm.engine.impl.persistence.entity.UserOperationLogManager)3 Date (java.util.Date)2 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)2 ExecutionEntity (org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity)2 JobDefinitionEntity (org.camunda.bpm.engine.impl.persistence.entity.JobDefinitionEntity)2 JobEntity (org.camunda.bpm.engine.impl.persistence.entity.JobEntity)2 ProcessApplicationReference (org.camunda.bpm.application.ProcessApplicationReference)1 ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)1 DbEntityManager (org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager)1 HistoryLevel (org.camunda.bpm.engine.impl.history.HistoryLevel)1 HistoryEvent (org.camunda.bpm.engine.impl.history.event.HistoryEvent)1 HistoryEventProcessor (org.camunda.bpm.engine.impl.history.event.HistoryEventProcessor)1 HistoryEventProducer (org.camunda.bpm.engine.impl.history.producer.HistoryEventProducer)1 CommandContext (org.camunda.bpm.engine.impl.interceptor.CommandContext)1