/// <summary> /// Builds the decision table output definition /// </summary> /// <returns>Decision table output definition built</returns> /// <exception cref="DmnBuilderException">Throws <see cref="DmnBuilderException"/> when the definition has already been built</exception> /// <exception cref="DmnBuilderException">Throws <see cref="DmnBuilderException"/> when the output variable is not defined in builder</exception> protected internal override DmnDecisionTableOutput Build() { if (IsBuilt) { throw Logger.Error <DmnBuilderException>("Decision is already built"); } if (VariableInternal == null) { throw Logger.Error <DmnBuilderException>("Variable must be defined for decision table output"); } var output = new DmnDecisionTableOutput( Index, VariableInternal.GetResultOrBuild(), AllowedValues); ResultInternal = output; return(output); }
/// <summary> /// Builds the decision table input definition /// </summary> /// <returns>Decision table input definition built</returns> /// <exception cref="DmnBuilderException">Throws <see cref="DmnBuilderException"/> when the definition has already been built</exception> /// <exception cref="DmnBuilderException">Throws <see cref="DmnBuilderException"/> when neither expression nor variable is defined for the input </exception> protected internal override DmnDecisionTableInput Build() { if (IsBuilt) { throw Logger.Error <DmnBuilderException>("Decision is already built"); } if (Expression == null && VariableInternal == null) { throw Logger.Error <DmnBuilderException>("Either Expression or Variable must be defined for decision table input"); } var input = new DmnDecisionTableInput( Index, VariableInternal?.GetResultOrBuild(), Expression, AllowedValues); ResultInternal = input; return(input); }