Search in sources :

Example 1 with IdGenerator

use of org.camunda.bpm.engine.impl.cfg.IdGenerator in project camunda-bpm-platform by camunda.

the class DefaultHistoryEventProducer method createFormPropertyUpdateEvt.

// form Properties ///////////////////////////
public HistoryEvent createFormPropertyUpdateEvt(ExecutionEntity execution, String propertyId, String propertyValue, String taskId) {
    final IdGenerator idGenerator = Context.getProcessEngineConfiguration().getIdGenerator();
    HistoricFormPropertyEventEntity historicFormPropertyEntity = newHistoricFormPropertyEvent();
    historicFormPropertyEntity.setId(idGenerator.getNextId());
    historicFormPropertyEntity.setEventType(HistoryEventTypes.FORM_PROPERTY_UPDATE.getEventName());
    historicFormPropertyEntity.setTimestamp(ClockUtil.getCurrentTime());
    historicFormPropertyEntity.setActivityInstanceId(execution.getActivityInstanceId());
    historicFormPropertyEntity.setExecutionId(execution.getId());
    historicFormPropertyEntity.setProcessDefinitionId(execution.getProcessDefinitionId());
    historicFormPropertyEntity.setProcessInstanceId(execution.getProcessInstanceId());
    historicFormPropertyEntity.setPropertyId(propertyId);
    historicFormPropertyEntity.setPropertyValue(propertyValue);
    historicFormPropertyEntity.setTaskId(taskId);
    historicFormPropertyEntity.setTenantId(execution.getTenantId());
    historicFormPropertyEntity.setUserOperationId(Context.getCommandContext().getOperationId());
    ProcessDefinitionEntity definition = execution.getProcessDefinition();
    if (definition != null) {
        historicFormPropertyEntity.setProcessDefinitionKey(definition.getKey());
    }
    // initialize sequence counter
    initSequenceCounter(execution, historicFormPropertyEntity);
    return historicFormPropertyEntity;
}
Also used : IdGenerator(org.camunda.bpm.engine.impl.cfg.IdGenerator) ProcessDefinitionEntity(org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity)

Aggregations

IdGenerator (org.camunda.bpm.engine.impl.cfg.IdGenerator)1 ProcessDefinitionEntity (org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity)1