public virtual void SubmitFormVariables(IVariableMap properties, IVariableScope variableScope) { VariableMapImpl propertiesCopy = new VariableMapImpl(properties); // support legacy form properties foreach (var formPropertyHandler in FormPropertyHandlers) { formPropertyHandler.SubmitFormProperty(variableScope, propertiesCopy); } // support form data: foreach (var formFieldHandler in FormFieldHandlers) { formFieldHandler.HandleSubmit(variableScope, propertiesCopy, properties); } // any variables passed in which are not handled by form-fields or form // properties are added to the process as variables foreach (var propertyId in propertiesCopy.KeySet()) { variableScope.SetVariable(propertyId, propertiesCopy.GetValueTyped <ITypedValue>(propertyId)); } FireFormPropertyHistoryEvents(properties, variableScope); }
public virtual void Initialize(IVariableScope innerScopeInstance, IVariableScope outerScopeInstance) { if (!ReferenceEquals(sourceVariableName, null)) { if (outerScopeInstance.HasVariable(sourceVariableName)) { var value = outerScopeInstance.GetVariable(sourceVariableName); innerScopeInstance.SetVariable(destinationVariableName, value); } else { throw new ProcessEngineException("Couldn't create variable '" + destinationVariableName + "', since the source variable '" + sourceVariableName + "does not exist"); } } if (sourceExpression != null) { var value = sourceExpression.GetValue(outerScopeInstance); innerScopeInstance.SetVariable(destinationVariableName, value); } if (!ReferenceEquals(link, null)) { if (outerScopeInstance.HasVariable(sourceVariableName)) { var value = outerScopeInstance.GetVariable(sourceVariableName); innerScopeInstance.SetVariable(destinationVariableName, value); } else { throw new ProcessEngineException("Couldn't create variable '" + destinationVariableName + "', since the source variable '" + sourceVariableName + "does not exist"); } } if (linkExpression != null) { var value = sourceExpression.GetValue(outerScopeInstance); innerScopeInstance.SetVariable(destinationVariableName, value); } }
public virtual void Destroy(IVariableScope innerScopeInstance, IVariableScope outerScopeInstance) { if (!ReferenceEquals(destinationVariableName, null)) { if (innerScopeInstance.HasVariable(sourceVariableName)) { var value = innerScopeInstance.GetVariable(sourceVariableName); outerScopeInstance.SetVariable(destinationVariableName, value); } else { throw new ProcessEngineException("Couldn't destroy variable " + sourceVariableName + ", since it does not exist"); } } if (destinationExpression != null) { var value = destinationExpression.GetValue(innerScopeInstance); outerScopeInstance.SetVariable(destinationVariableName, value); } if (!ReferenceEquals(link, null)) { if (innerScopeInstance.HasVariable(sourceVariableName)) { var value = innerScopeInstance.GetVariable(sourceVariableName); outerScopeInstance.SetVariable(destinationVariableName, value); } else { throw new ProcessEngineException("Couldn't destroy variable " + sourceVariableName + ", since it does not exist"); } } if (linkExpression != null) { var value = sourceExpression.GetValue(innerScopeInstance); outerScopeInstance.SetVariable(destinationVariableName, value); } }
/// <summary> /// /// </summary> /// <param name="context"></param> /// <param name="base"></param> /// <param name="property"></param> /// <param name="value"></param> public override void SetValue(ELContext context, object @base, object property, object value) { if (@base == null) { string variable = property.ToString(); if (variableScope.HasVariable(variable)) { variableScope.SetVariable(variable, value); } } }
public virtual object Put(string name, object value) { if (autoStoreScriptVariables) { if (!UNSTORED_KEYS.Contains(name)) { object oldValue = variableScope.GetVariable(name); variableScope.SetVariable(name, value); return(oldValue); } } return(wrappedBindings.Put(name, value)); }
public static void SetStringVariable(this IVariableScope transaction, string name, string value) { transaction.SetVariable(name, Field.String(value)); }
public static void SetBooleanVariable(this IVariableScope transaction, string name, bool value) { transaction.SetVariable(name, Field.Boolean(value)); }