Beispiel #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);
            }
        }
Beispiel #2
0
 public virtual void initializeVariableStore(IDictionary <string, object> variables)
 {
     foreach (string variableName in variables.Keys)
     {
         TypedValue           value         = Variables.untypedValue(variables[variableName]);
         CoreVariableInstance variableValue = VariableInstanceFactory.build(variableName, value, false);
         VariableStore.addVariable(variableValue);
     }
 }
Beispiel #3
0
        public virtual void removeVariables()
        {
            foreach (CoreVariableInstance variableInstance in VariableStore.Variables)
            {
                invokeVariableLifecycleListenersDelete(variableInstance, SourceActivityVariableScope);
            }

            VariableStore.removeVariables();
        }
Beispiel #4
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);
            }
        }
Beispiel #5
0
        /// <summary>
        /// Sets a variable in the local scope. In contrast to
        /// <seealso cref="setVariableLocal(string, object)"/>, the variable is transient that
        /// means it will not be stored in the data base. For example, a transient
        /// variable can be used for a result variable that is only available for
        /// output mapping.
        /// </summary>
        public virtual void setVariableLocalTransient(string variableName, object value)
        {
            TypedValue typedValue = Variables.untypedValue(value, true);

            checkJavaSerialization(variableName, typedValue);

            CoreVariableInstance coreVariableInstance = VariableInstanceFactory.build(variableName, typedValue, true);

            VariableStore.addVariable(coreVariableInstance);
        }
Beispiel #6
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);
            }
        }
Beispiel #7
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);
                }
            }
        }
Beispiel #8
0
 public virtual bool hasVariableLocal(string variableName)
 {
     return(VariableStore.containsKey(variableName));
 }
Beispiel #9
0
 public virtual IList <CoreVariableInstance> getVariableInstancesLocal(ICollection <string> variableNames)
 {
     return(VariableStore.getVariables(variableNames));
 }
Beispiel #10
0
 public virtual CoreVariableInstance getVariableInstanceLocal(string name)
 {
     return(VariableStore.getVariable(name));
 }