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);
}
}
Aggregations