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; }
public ArithmeticExpression MakeAssignmentRHS(Value value) { ArithmeticExpression arithmeticExpression = new ArithmeticExpression(); arithmeticExpression.AddValue(value); return arithmeticExpression; }
public ArithmeticExpression MakeArithmeticExperssion(Value value) { ArithmeticExpression arithmeticExpression = new ArithmeticExpression(); arithmeticExpression.AddValue(value); return arithmeticExpression; }
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; }
public ConstantEnumerator(Value par) { parent = par; nIndex = -1; }
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); }
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; }
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); }