public virtual void setVariableLocal(string variableName, TypedValue value, AbstractVariableScope sourceActivityExecution) { checkJavaSerialization(variableName, value); VariableStore <CoreVariableInstance> variableStore = VariableStore; if (variableStore.containsKey(variableName)) { CoreVariableInstance existingInstance = variableStore.getVariable(variableName); existingInstance.Value = value; invokeVariableLifecycleListenersUpdate(existingInstance, sourceActivityExecution); } else if (variableStore.isRemoved(variableName)) { CoreVariableInstance existingInstance = variableStore.getRemovedVariable(variableName); existingInstance.Value = value; VariableStore.addVariable(existingInstance); invokeVariableLifecycleListenersUpdate(existingInstance, sourceActivityExecution); DbEntityManager dbEntityManager = Context.CommandContext.DbEntityManager; dbEntityManager.undoDelete((VariableInstanceEntity)existingInstance); } else { CoreVariableInstance variableValue = VariableInstanceFactory.build(variableName, value, false); VariableStore.addVariable(variableValue); invokeVariableLifecycleListenersCreate(variableValue, sourceActivityExecution); } }
protected internal virtual void removeVariableLocal(string variableName, AbstractVariableScope sourceActivityExecution) { if (VariableStore.containsKey(variableName)) { CoreVariableInstance variableInstance = VariableStore.getVariable(variableName); invokeVariableLifecycleListenersDelete(variableInstance, sourceActivityExecution); VariableStore.removeVariable(variableName); } }
public virtual void setVariableLocalTransient(string variableName, object value, AbstractVariableScope sourceActivityVariableScope) { VariableStore <CoreVariableInstance> variableStore = VariableStore; if (variableStore.containsKey(variableName)) { CoreVariableInstance existingInstance = variableStore.getVariable(variableName); existingInstance.Value = (TypedValue)value; invokeVariableLifecycleListenersUpdate(existingInstance, sourceActivityVariableScope); } else { setVariableLocalTransient(variableName, value); invokeVariableLifecycleListenersCreate(variableStore.getVariable(variableName), sourceActivityVariableScope); } }
protected internal virtual void removeVariable(string variableName, AbstractVariableScope sourceActivityExecution) { if (VariableStore.containsKey(variableName)) { removeVariableLocal(variableName, sourceActivityExecution); return; } AbstractVariableScope parentVariableScope = ParentVariableScope; if (parentVariableScope != null) { if (sourceActivityExecution == null) { parentVariableScope.removeVariable(variableName); } else { parentVariableScope.removeVariable(variableName, sourceActivityExecution); } } }
public virtual bool hasVariableLocal(string variableName) { return(VariableStore.containsKey(variableName)); }