Beispiel #1
0
        /// <summary>
        /// Gets the runtime (execution) variable corresponding to its <paramref name="definition"/>
        /// </summary>
        /// <param name="definition">Name of the variable</param>
        /// <returns>Variable  corresponding to its <paramref name="definition"/></returns>
        /// <exception cref="ArgumentNullException"><paramref name="definition"/> is null</exception>
        public DmnExecutionVariable GetVariable(IDmnVariable definition)
        {
            if (definition == null)
            {
                throw Logger.Fatal <ArgumentNullException>($"{nameof(definition)} is null");
            }

            return(GetVariable(definition.Name));
        }
 /// <summary>
 /// CTOR
 /// </summary>
 /// <param name="name">Unique name of the decision</param>
 /// <param name="expression">Decision expression</param>
 /// <param name="output">Decision output variable</param>
 /// <param name="requiredInputs">Decision required inputs (input variables)</param>
 /// <param name="requiredDecisions">List of decisions, the decision depends on</param>
 public DmnExpressionDecision(
     string name,
     string expression,
     IDmnVariable output,
     IReadOnlyCollection <IDmnVariable> requiredInputs,
     IReadOnlyCollection <IDmnDecision> requiredDecisions)
     : base(name, requiredInputs, requiredDecisions)
 {
     Expression = expression;
     Output     = output;
 }
Beispiel #3
0
 /// <summary>
 /// CTOR
 /// </summary>
 /// <param name="index">Index of the input (order)</param>
 /// <param name="variable">Input source variable (the variable value is compared to the rules)</param>
 /// <param name="expression">Input source expression (the evaluated expression is compared to the rules)</param>
 /// <param name="allowedValues">Optional array of allowed values</param>
 public DmnDecisionTableInput(
     int index,
     IDmnVariable variable,
     string expression      = null,
     string[] allowedValues = null)
 {
     Index         = index;
     Variable      = variable;
     Expression    = expression;
     AllowedValues = allowedValues;
 }
 public DmnLogicalAndDecision(
     string name,
     IDmnVariable inputVar1,
     IDmnVariable inputVar2,
     bool negate,
     IDmnVariable outputVar,
     IReadOnlyCollection <IDmnVariable> requiredInputs,
     IReadOnlyCollection <IDmnDecision> requiredDecisions)
     : base(name, requiredInputs, requiredDecisions)
 {
     InputVar1 = inputVar1;
     InputVar2 = inputVar2;
     Negate    = negate;
     OutputVar = outputVar;
 }
 /// <summary>
 /// CTOR
 /// </summary>
 /// <param name="index">Index of the output (order)</param>
 /// <param name="variable">Variable to store the output to</param>
 /// <param name="allowedValues">Optional array of allowed values</param>
 public DmnDecisionTableOutput(int index, IDmnVariable variable, string[] allowedValues = null)
 {
     Index         = index;
     Variable      = variable;
     AllowedValues = allowedValues;
 }