Пример #1
0
        public Value MakeConstant(AiRuleEngine.VariableType type, object value)
        {
            Value newValue = new Value();
            ConstantType newConstant = new ConstantType();
            switch (type)
            {
                case AiRuleEngine.VariableType.BOOLEAN:
                    newConstant.AddBoolean(new Altova.Types.SchemaBoolean((bool)value));
                    break;

                case AiRuleEngine.VariableType.INT:
                    newConstant.AddInteger(new Altova.Types.SchemaLong((long)(int)value));
                    break;

                case AiRuleEngine.VariableType.FLOAT:
                    newConstant.AddFloat2(new Altova.Types.SchemaDecimal((decimal)(float)value));
                    break;

                case AiRuleEngine.VariableType.STRING:
                    newConstant.AddString2(new Altova.Types.SchemaString((string)value));
                    break;
            }

            newValue.AddConstant(newConstant);

            return newValue;
        }
Пример #2
0
        public ArithmeticExpression MakeAssignmentRHS(Value value)
        {
            ArithmeticExpression arithmeticExpression = new ArithmeticExpression();
            arithmeticExpression.AddValue(value);

            return arithmeticExpression;
        }
Пример #3
0
        public ArithmeticExpression MakeArithmeticExperssion(Value value)
        {
            ArithmeticExpression arithmeticExpression = new ArithmeticExpression();

            arithmeticExpression.AddValue(value);

            return arithmeticExpression;
        }
Пример #4
0
        public Value MakeVariable(string name, AiRuleEngine.VariableType type)
        {
            Value newValue = new Value();
            XMLRules.VariableType newVariable = new XMLRules.VariableType();
            newVariable.AddName(new Altova.Types.SchemaString(name));
            newVariable.AddType2(new Altova.Types.SchemaLong((long)type));
            newValue.AddVariable(newVariable);

            return newValue;
        }
Пример #5
0
			public ConstantEnumerator(Value par) 
			{
				parent = par;
				nIndex = -1;
			}
Пример #6
0
			public VariableEnumerator(Value par) 
			{
				parent = par;
				nIndex = -1;
			}
		public void ReplaceValueAt(Value newValue, int index)
		{
			ReplaceDomElementAt("", "Value", index, newValue);
		}
		public void InsertValueAt(Value newValue, int index)
		{
			InsertDomElementAt("", "Value", index, newValue);
		}
		public void AddValue(Value newValue)
		{
			AppendDomElement("", "Value", newValue);
		}
Пример #10
0
        public XMLRules.ActionType MakeStateChangeAction(string name, AiRuleEngine.VariableType type, Value value)
        {
			XMLRules.ActionType action = new XMLRules.ActionType();
            AssignmentExpression assignment = new AssignmentExpression();
            assignment.AddVariable(MakeVariable(name, type).GetVariable());
            assignment.AddExpression(MakeAssignmentRHS(value));

            action.AddCertainty(new Altova.Types.SchemaDecimal(100));
            action.AddChangeState(assignment);

            return action;
        }
Пример #11
0
		public LogicalExpression MakeLogical(Value value)
		{
			LogicalExpression logicalExpression = new LogicalExpression();
			
			logicalExpression.AddValue(value);  					   
			
			return logicalExpression;
		}
Пример #12
0
		public void ReplaceScriptParameterAt(Value newValue, int index)
		{
			ReplaceDomElementAt("", "ScriptParameter", index, newValue);
		}
Пример #13
0
		public void InsertScriptParameterAt(Value newValue, int index)
		{
			InsertDomElementAt("", "ScriptParameter", index, newValue);
		}
Пример #14
0
		public void AddScriptParameter(Value newValue)
		{
			AppendDomElement("", "ScriptParameter", newValue);
		}