示例#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;
		}
		public void ReplaceScriptParameterAt(Value newValue, int index)
		{
			ReplaceDomElementAt("", "ScriptParameter", index, newValue);
		}
		public void InsertScriptParameterAt(Value newValue, int index)
		{
			InsertDomElementAt("", "ScriptParameter", index, newValue);
		}
		public void AddScriptParameter(Value newValue)
		{
			AppendDomElement("", "ScriptParameter", newValue);
		}