示例#1
0
        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);
            }
        }
示例#2
0
        protected internal virtual void removeVariableLocal(string variableName, AbstractVariableScope sourceActivityExecution)
        {
            if (VariableStore.containsKey(variableName))
            {
                CoreVariableInstance variableInstance = VariableStore.getVariable(variableName);

                invokeVariableLifecycleListenersDelete(variableInstance, sourceActivityExecution);
                VariableStore.removeVariable(variableName);
            }
        }
示例#3
0
        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);
            }
        }
示例#4
0
        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);
                }
            }
        }
示例#5
0
 public virtual bool hasVariableLocal(string variableName)
 {
     return(VariableStore.containsKey(variableName));
 }