コード例 #1
0
 protected internal virtual IVariableMap FilterVariables(IVariableMap variables)
 {
     if (variables != null)
     {
         foreach (var key in VariablesFilter)
         {
             variables.Remove(key);
         }
     }
     return(variables);
 }
コード例 #2
0
        public virtual void SubmitFormProperty(IVariableScope variableScope, IVariableMap variables)
        {
            if (!IsWritable && variables.ContainsKey(id))
            {
                throw new ProcessEngineException("form property '" + id + "' is not writable");
            }

            if (IsRequired && !variables.ContainsKey(id) && (defaultExpression == null))
            {
                throw new ProcessEngineException("form property '" + id + "' is required");
            }

            object modelValue = null;

            if (variables.ContainsKey(id))
            {
                //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
                //ORIGINAL LINE: final Object propertyValue = variables.remove(id);
                object propertyValue = variables.Remove(id);
                if (Type != null)
                {
                    modelValue = Type.ConvertFormValueToModelValue(propertyValue);
                }
                else
                {
                    modelValue = propertyValue;
                }
            }
            else if (defaultExpression != null)
            {
                //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
                //ORIGINAL LINE: final Object expressionValue = defaultExpression.getValue(variableScope);
                //var expressionValue = defaultExpression.GetValue(variableScope);
                //if ((Type != null) && (expressionValue != null))
                //    modelValue = Type.ConvertFormValueToModelValue(expressionValue.ToString());
                //else if (expressionValue != null)
                //    modelValue = expressionValue.ToString();
                //else if (IsRequired)
                //    throw new ProcessEngineException("form property '" + id + "' is required");
            }

            //if (modelValue != null)
            //    if (!ReferenceEquals(variableName, null))
            //        variableScope.SetVariable(variableName, modelValue);
            //    else if (variableExpression != null)
            //        variableExpression.SetValue(modelValue, variableScope);
            //    else
            //        variableScope.SetVariable(id, modelValue);
        }