Search in sources :

Example 11 with DbEntityManager

use of org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager in project camunda-bpm-platform by camunda.

the class AbstractVariableScope method setVariableLocal.

public void setVariableLocal(String variableName, TypedValue value, AbstractVariableScope sourceActivityExecution) {
    checkJavaSerialization(variableName, value);
    VariableStore<CoreVariableInstance> variableStore = getVariableStore();
    if (variableStore.containsKey(variableName)) {
        CoreVariableInstance existingInstance = variableStore.getVariable(variableName);
        existingInstance.setValue(value);
        invokeVariableLifecycleListenersUpdate(existingInstance, sourceActivityExecution);
    } else if (variableStore.isRemoved(variableName)) {
        CoreVariableInstance existingInstance = variableStore.getRemovedVariable(variableName);
        existingInstance.setValue(value);
        getVariableStore().addVariable(existingInstance);
        invokeVariableLifecycleListenersUpdate(existingInstance, sourceActivityExecution);
        DbEntityManager dbEntityManager = Context.getCommandContext().getDbEntityManager();
        dbEntityManager.undoDelete((VariableInstanceEntity) existingInstance);
    } else {
        CoreVariableInstance variableValue = getVariableInstanceFactory().build(variableName, value, false);
        getVariableStore().addVariable(variableValue);
        invokeVariableLifecycleListenersCreate(variableValue, sourceActivityExecution);
    }
}
Also used : CoreVariableInstance(org.camunda.bpm.engine.impl.core.variable.CoreVariableInstance) DbEntityManager(org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager) VariableInstanceEntity(org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity)

Aggregations

DbEntityManager (org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager)11 ByteArrayEntity (org.camunda.bpm.engine.impl.persistence.entity.ByteArrayEntity)3 CommandContext (org.camunda.bpm.engine.impl.interceptor.CommandContext)2 AttachmentEntity (org.camunda.bpm.engine.impl.persistence.entity.AttachmentEntity)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 HashMap (java.util.HashMap)1 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)1 QueryOrderingProperty (org.camunda.bpm.engine.impl.QueryOrderingProperty)1 AcquireJobsCmd (org.camunda.bpm.engine.impl.cmd.AcquireJobsCmd)1 CoreVariableInstance (org.camunda.bpm.engine.impl.core.variable.CoreVariableInstance)1 DbEntity (org.camunda.bpm.engine.impl.db.DbEntity)1 ListQueryParameterObject (org.camunda.bpm.engine.impl.db.ListQueryParameterObject)1 DbBulkOperation (org.camunda.bpm.engine.impl.db.entitymanager.operation.DbBulkOperation)1 HistoricScopeInstanceEvent (org.camunda.bpm.engine.impl.history.event.HistoricScopeInstanceEvent)1 JobExecutor (org.camunda.bpm.engine.impl.jobexecutor.JobExecutor)1 DatabasePurgeReport (org.camunda.bpm.engine.impl.management.DatabasePurgeReport)1 AuthorizationEntity (org.camunda.bpm.engine.impl.persistence.entity.AuthorizationEntity)1 ExecutionEntity (org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity)1 HistoricVariableInstanceEntity (org.camunda.bpm.engine.impl.persistence.entity.HistoricVariableInstanceEntity)1 JobManager (org.camunda.bpm.engine.impl.persistence.entity.JobManager)1