예제 #1
0
        public virtual void SetVariableLocal(string variableName, ITypedValue value,
                                             AbstractVariableScope sourceActivityExecution)
        {
            var variableStore = VariableStore;

            if (variableStore.ContainsKey(variableName))
            {
                var existingInstance = variableStore.GetVariable(variableName);
                existingInstance.SetValue(value);
                InvokeVariableLifecycleListenersUpdate(existingInstance, sourceActivityExecution);
            }
            else
            {
                var variableValue = VariableInstanceFactory.Build(variableName, value, false);
                VariableStore.AddVariable(variableValue as VariableInstanceEntity);
                InvokeVariableLifecycleListenersCreate(variableValue, sourceActivityExecution);
            }
        }
예제 #2
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)
        {
            ITypedValue typedValue = Engine.Variable.Variables.UnTypedValue(value);

            VariableStore.AddVariable(VariableInstanceFactory.Build(variableName, typedValue, true));
        }