Ejemplo n.º 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;
        }
Ejemplo n.º 2
0
        public ArithmeticExpression MakeAssignmentRHS(Value value)
        {
            ArithmeticExpression arithmeticExpression = new ArithmeticExpression();
            arithmeticExpression.AddValue(value);

            return arithmeticExpression;
        }
Ejemplo n.º 3
0
        public ArithmeticExpression MakeArithmeticExperssion(Value value)
        {
            ArithmeticExpression arithmeticExpression = new ArithmeticExpression();

            arithmeticExpression.AddValue(value);

            return arithmeticExpression;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 5
0
			public ConstantEnumerator(Value par) 
			{
				parent = par;
				nIndex = -1;
			}
Ejemplo n.º 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);
		}
Ejemplo n.º 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;
        }
Ejemplo n.º 11
0
		public LogicalExpression MakeLogical(Value value)
		{
			LogicalExpression logicalExpression = new LogicalExpression();
			
			logicalExpression.AddValue(value);  					   
			
			return logicalExpression;
		}
Ejemplo n.º 12
0
		public void ReplaceScriptParameterAt(Value newValue, int index)
		{
			ReplaceDomElementAt("", "ScriptParameter", index, newValue);
		}
Ejemplo n.º 13
0
		public void InsertScriptParameterAt(Value newValue, int index)
		{
			InsertDomElementAt("", "ScriptParameter", index, newValue);
		}
Ejemplo n.º 14
0
		public void AddScriptParameter(Value newValue)
		{
			AppendDomElement("", "ScriptParameter", newValue);
		}