### Builder with Require overloads for inputs and decisions Source: https://github.com/adamecr/common.dmn.engine/blob/master/readme.md Shows how to define required inputs and decisions using the builder's Require method. The example creates expression and table decisions with dependencies. ```C# var def = new DmnDefinitionBuilder() .WithInput("input1", out var input1Ref) .WithInput("input2", out var input2Ref) .WithVariable("variable1", out var variable1Ref) .WithVariable("variable2", out var variable2Ref) .WithExpressionDecision("eDecision1", "input1>3",variable1Ref,out var eDecision1Ref) .WithExpressionDecision("eDecision2", eDecision => eDecision .Put("variable1 && input2=='ahoy'").To(variable2Ref) .Requires(input2Ref) .Requires(eDecision1Ref),out var eDecision2Ref) .WithTableDecision("tDecision1", table=> table .WithInput(input1Ref,out var tableInput1Ref) .WithInput(variable2Ref,out var tableInput2Ref) .WithOutput(variable2Ref,out var tableOutput) .WithRule("Rule1",r=>r.When(tableInput1Ref, ">6").And(tableInput2Ref,"true").Then(tableOutput,"ABC")) .WithRule("Rule2", r => r.Always().Then(tableOutput, "DEF")) .Requires(input1Ref) .Requires(eDecision2Ref)) .Build(); ``` -------------------------------- ### C# TableDecision builder with WithRule examples Source: https://github.com/adamecr/common.dmn.engine/blob/master/readme.md Shows how to define table rules using the TableDecision builder's WithRule method. Input conditions are set with When/And or Always, and output calculations with Then/And or SkipOutput. Note that When/Then clear prior expressions, Add sets or removes a single expression, and Always/SkipOutput clear all expressions for the rule. ```csharp var definition = new DmnDefinitionBuilder() .WithInput("input1", out var inputVar1Ref) .WithInput("input2", out var inputVar2Ref) .WithVariable("output1", out var outputVar1Ref) .WithVariable("output2", out var outputVar2Ref) .WithVariable("output3", out var outputVar3Ref) .WithTableDecision("tDecision1", table => table .WithInput(inputVar1Ref, out var tableInput1Ref) .WithInput(inputVar2Ref, out var tableInput2Ref) .WithInput("input2.ToString()[0]", out var tableInput3Ref) .WithOutput(outputVar1Ref, out var tableOutput1Ref) .WithOutput(outputVar2Ref, out var tableOutput2Ref) .WithOutput(outputVar3Ref, out var tableOutput3Ref) .WithRule("rule1", r => r .When(tableInput1Ref, "1") .Then(tableOutput1Ref, "\"a\"")) .WithRule("rule2", r => r .When(tableInput1Ref, "11") .And(tableInput2Ref, "false") .Then(tableOutput2Ref, "111")) .WithRule("rule3", r => r .When(tableInput1Ref, "2") .And(tableInput2Ref, "true") .Then(tableOutput2Ref, "2") .And(tableOutput1Ref, "\"b\"") .And(tableOutput3Ref, "false")) .WithRule("rule4", "some rule description", r => r .When(tableInput1Ref, "33") .And(tableInput2Ref, "false") .And(tableInput3Ref, "\"t\"") .Then(tableOutput1Ref, "\"three\"")) .WithRule("rule5", r => r .When(tableInput1Ref, "4") .Then(tableOutput1Ref, "\"four\"") .And(tableOutput2Ref, "4") .And(tableOutput3Ref, "true")) .WithRule("rule5", r => r .Always() .Then(tableOutput3Ref, "false")) .WithRule("rule6", r => r .Always() .Then(tableOutput1Ref, "\"six\"") .And(tableOutput2Ref, "66")) .WithRule("rule7", r => r .Always() .Then(tableOutput1Ref, "\"7\"") .And(tableOutput3Ref, "true")) .WithRule("rule8", r => r .When(tableInput2Ref, "false") .SkipOutput()) .WithRule("rule9", r => r .When(tableInput1Ref, "9") .And(tableInput2Ref, "true") .SkipOutput()) .WithRule("rule10", r => r .Always() .SkipOutput()) ) .Build(); ``` -------------------------------- ### SFeel.RngI Source: https://github.com/adamecr/common.dmn.engine/blob/master/readme.md Creates a range expression token that includes both the start and end values (inclusive). ```APIDOC ## SFeel.RngI ### Description Creates a range expression token that includes both the start and end values (inclusive). ### Method Function call ### Parameters - **from** (object) - Required - The start value of the range. - **to** (object) - Required - The end value of the range. ### Request Example ```csharp var r10 = SFeel.Eq(SFeel.RngI(2, 5)); ``` ### Response Returns a string token representing the inclusive range expression. #### Response Example ```csharp //[2..5] var r10 = SFeel.Eq(SFeel.RngI(2, 5)); ``` ``` -------------------------------- ### SFeel.Lt Source: https://github.com/adamecr/common.dmn.engine/blob/master/readme.md Creates a less-than comparison expression token. ```APIDOC ## SFeel.Lt ### Description Creates a less-than comparison expression token. ### Method Function call ### Parameters - **value** (object) - Required - The value to compare against. ### Request Example ```csharp var r6 = SFeel.Lt(5); ``` ### Response Returns a string token representing the less-than expression. #### Response Example ```csharp //< 5 var r6 = SFeel.Lt(5); ``` ``` -------------------------------- ### Build Source: https://github.com/adamecr/common.dmn.engine/blob/master/readme.md Builds the DMN definition from the builder configuration. ```APIDOC ## Build ### Description Builds the DMN definition from the builder configuration. ### Method Builder method ### Endpoint `DmnDefinitionBuilder.Build` ### Parameters None ### Request Example ```csharp .Build() ``` ### Response Returns the built DMN definition. ``` -------------------------------- ### SFeel.Le Source: https://github.com/adamecr/common.dmn.engine/blob/master/readme.md Creates a less-or-equal comparison expression token. ```APIDOC ## SFeel.Le ### Description Creates a less-or-equal comparison expression token. ### Method Function call ### Parameters - **value** (object) - Required - The value to compare against. ### Request Example ```csharp var r7 = SFeel.Le(4); ``` ### Response Returns a string token representing the less-or-equal expression. #### Response Example ```csharp //<= 4 var r7 = SFeel.Le(4); ``` ``` -------------------------------- ### SFeel.Ge Source: https://github.com/adamecr/common.dmn.engine/blob/master/readme.md Creates a greater-or-equal comparison expression token. ```APIDOC ## SFeel.Ge ### Description Creates a greater-or-equal comparison expression token. ### Method Function call ### Parameters - **value** (object) - Required - The value to compare against. ### Request Example ```csharp var r9 = SFeel.Ge(7); ``` ### Response Returns a string token representing the greater-or-equal expression. #### Response Example ```csharp //>= 7 var r9 = SFeel.Ge(7); ``` ``` -------------------------------- ### SFeel.Gt Source: https://github.com/adamecr/common.dmn.engine/blob/master/readme.md Creates a greater-than comparison expression token. ```APIDOC ## SFeel.Gt ### Description Creates a greater-than comparison expression token. ### Method Function call ### Parameters - **value** (object) - Required - The value to compare against. ### Request Example ```csharp var r8 = SFeel.Gt(5); ``` ### Response Returns a string token representing the greater-than expression. #### Response Example ```csharp //> 5 var r8 = SFeel.Gt(5); ``` ``` -------------------------------- ### SFeel.RngIE Source: https://github.com/adamecr/common.dmn.engine/blob/master/readme.md Creates a range expression token that includes the start value but excludes the end value. ```APIDOC ## SFeel.RngIE ### Description Creates a range expression token that includes the start value but excludes the end value. ### Method Function call ### Parameters - **from** (object) - Required - The start value of the range. - **to** (object) - Required - The end value of the range. ### Request Example ```csharp var r11 = SFeel.Eq(SFeel.RngIE(2, 5)); ``` ### Response Returns a string token representing the range expression. #### Response Example ```csharp //[2..5[ var r11 = SFeel.Eq(SFeel.RngIE(2, 5)); ``` ``` -------------------------------- ### AddExtension Source: https://github.com/adamecr/common.dmn.engine/blob/master/readme.md Adds an extension to the element. The extension can be any object. ```APIDOC ## AddExtension ### Description Adds an extension to the element. The extension can be any object. ### Method Extension method ### Signature `public static void AddExtension(this IDmnExtendable element, object extension)` ### Parameters - **element** (IDmnExtendable) - Required - The element to which the extension is added. - **extension** (object) - Required - The extension object to add. ### Returns - **void** - This method does not return a value. ``` -------------------------------- ### Parse and execute a DMN model Source: https://github.com/adamecr/common.dmn.engine/blob/master/nuget.md Shows the basic workflow: parse a DMN model from a file, create an execution context, provide an input parameter, and execute a decision. The result is returned from ExecuteDecision. ```csharp var def = DmnParser.Parse(fileName); var ctx = DmnExecutionContextFactory.CreateExecutionContext(def); ctx.WithInputParameter("input name", inputValue); var result = ctx.ExecuteDecision("decision name"); ``` -------------------------------- ### InformationRequirement.InformationRequirementItem.Ref Property Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.parser.dto__17tk5mp.html Gets or sets the reference to an input or decision by its ID prefixed with '#', for example href="#Input1". This property is serialized as an XML attribute named 'href'. ```APIDOC ## [PROPERTY] InformationRequirement.InformationRequirementItem.Ref ### Description Gets or sets the reference to an input or decision by its ID prefixed with '#', for example href="#Input1". ### Property Signature ```csharp [XmlAttribute("href")] public string Ref { get; set; } ``` ### Property Value - **Type**: string ### Attributes - **System.Xml.Serialization.XmlAttributeAttribute** ``` -------------------------------- ### DMN Diagram Extensions XML Example Source: https://github.com/adamecr/common.dmn.engine/blob/master/readme.md Shows the DMN XML structure for diagram extensions, including DMNShape and DMNEdge elements with bounds and waypoints. The parser V1_3 and above supports these extensions, and the DmnDefinitionFactory adds shape extensions to decisions and variable definitions when linked via dmnElementRef. Edges are parsed but not further processed by the default factory. ```xml ``` -------------------------------- ### SFeel.RngE Source: https://github.com/adamecr/common.dmn.engine/blob/master/readme.md Creates a range expression token that excludes both the start and end values. ```APIDOC ## SFeel.RngE ### Description Creates a range expression token that excludes both the start and end values. ### Method Function call ### Parameters - **from** (object) - Required - The start value of the range. - **to** (object) - Required - The end value of the range. ### Request Example ```csharp var r13 = SFeel.Eq(SFeel.RngE(2, 5)); ``` ### Response Returns a string token representing the range expression. #### Response Example ```csharp //]2..5[ var r13 = SFeel.Eq(SFeel.RngE(2, 5)); ``` ``` -------------------------------- ### Define inputs with builder Source: https://github.com/adamecr/common.dmn.engine/blob/master/readme.md Shows builder overloads for defining inputs with or without variable type and optional label. Typed inputs are recommended to avoid unexpected behavior. ```csharp var def = new DmnDefinitionBuilder() .WithInput("input1") .WithInput("input2", out var inputVariable2Ref) .WithInput("input2", typeof(string)) .WithInput("input4", typeof(string), out var inputVariable4Ref) .WithInputs("input5", "input6") ... .Build(); ``` -------------------------------- ### DmnDecision.RequiredInputs Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.decisions__15bua3q.md Gets the decision required inputs (input variables). Only direct dependencies are included; use GetAllRequiredInputs() to get the full list. ```APIDOC ## DmnDecision.RequiredInputs ### Description Gets the decision required inputs (input variables). Only direct dependencies are included; use GetAllRequiredInputs() to get the full list. ### Property ```csharp public IReadOnlyCollection RequiredInputs { get; } ``` ### Property Value - **Type**: IReadOnlyCollection ### Implements - IDmnDecision.RequiredInputs ``` -------------------------------- ### Define decisions with builder Source: https://github.com/adamecr/common.dmn.engine/blob/master/readme.md Shows builder methods for defining expression and table decisions with optional labels. Includes input, variable, and rule definitions. ```csharp var definition = new DmnDefinitionBuilder() .WithInput("input1") .WithVariable("variable1", out var variable1) .WithVariable("variable2", out var variable2) .WithExpressionDecision("exprDecision", "input1>3", variable1) .WithTableDecision("tableDecision", table=> table .WithInput(variable1,out var tblInputRef) .WithOutput(variable2,out var tblOutputRef) .WithRule("rule 1",r=>r .When(tblInputRef,"true") .Then(tblOutputRef,@"""T""")) .WithRule("rule 2", r=>r .Always() .Then(tblOutputRef,@"""F"""))) .Build(); ``` -------------------------------- ### Build DMN definition with DmnDefinitionBuilder Source: https://github.com/adamecr/common.dmn.engine/blob/master/readme.md Shows how to build a DMN definition programmatically using the fluent DmnDefinitionBuilder interface, then create an execution context from the built definition. ```csharp var definition = new DmnDefinitionBuilder() .... .Build(); var ctx = DmnExecutionContextFactory.CreateExecutionContext(definition); ``` -------------------------------- ### GetParsedExpressionCacheKey method for cache key construction Source: https://github.com/adamecr/common.dmn.engine/blob/master/readme.md Builds the cache key for parsed expressions based on the ParsedExpressionCacheScope option. The prefix is determined by the scope: None uses a unique GUID, Execution uses the execution ID, Context uses the context ID, Definition uses the definition ID, and Global uses an empty string. The key combines the prefix, expression text, and output type's assembly-qualified name. ```csharp protected virtual string GetParsedExpressionCacheKey(string executionId, string expression, Type outputType) { string prefix; switch (Options.ParsedExpressionCacheScope) { case ParsedExpressionCacheScopeEnum.None: prefix = Guid.NewGuid().ToString(); //fallback, always unique key break; case ParsedExpressionCacheScopeEnum.Execution: prefix = executionId; break; case ParsedExpressionCacheScopeEnum.Context: prefix = Id; break; case ParsedExpressionCacheScopeEnum.Definition: prefix = Definition.Id; break; case ParsedExpressionCacheScopeEnum.Global: prefix = ""; break; default: throw new ArgumentOutOfRangeException(); } return $"{prefix}||{expression}||{outputType.AssemblyQualifiedName}"; } ``` -------------------------------- ### SFeel.RngEI Source: https://github.com/adamecr/common.dmn.engine/blob/master/readme.md Creates a range expression token that excludes the start value but includes the end value. ```APIDOC ## SFeel.RngEI ### Description Creates a range expression token that excludes the start value but includes the end value. ### Method Function call ### Parameters - **from** (object) - Required - The start value of the range. - **to** (object) - Required - The end value of the range. ### Request Example ```csharp var r12 = SFeel.Eq(SFeel.RngEI(2, 5)); ``` ### Response Returns a string token representing the range expression. #### Response Example ```csharp //]2..5] var r12 = SFeel.Eq(SFeel.RngEI(2, 5)); ``` ``` -------------------------------- ### DmnExecutionContext Constructor Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.execution.context__143xaoa.html Initializes a new instance of the DmnExecutionContext class with the specified definition, variables, decisions, and optional configuration. ```APIDOC ## Constructor ### Description Initializes a new instance of the DmnExecutionContext class. ### Constructor Signature ```csharp public DmnExecutionContext(DmnDefinition definition, IReadOnlyDictionary variables, IReadOnlyDictionary decisions, Action configure = null) ``` ### Parameters - **definition** (DmnDefinition) - Required - The DMN model definition. - **variables** (IReadOnlyDictionary) - Required - Variables used while executing the DMN model. - **decisions** (IReadOnlyDictionary) - Required - Dictionary of available decisions by name. - **configure** (Action) - Optional - Optional configuration action. ### Exceptions - **ArgumentNullException** - Thrown when any of the parameters is null. ``` -------------------------------- ### When Source: https://github.com/adamecr/common.dmn.engine/blob/master/readme.md Sets the first input condition for a rule. Clears all existing input expressions and adds the given expression if not null or whitespace. ```APIDOC ## When ### Description Sets the first input condition for a rule. Clears all existing input expressions and adds the given expression if not null or whitespace. ### Method Builder method ### Parameters - **inputRef** (table input reference) - Required - Reference to the table input - **expression** (string) - Required - Rule input expression ### Returns Rule builder for chaining additional conditions. ``` -------------------------------- ### XML output mapping example for DMN decision table Source: https://github.com/adamecr/common.dmn.engine/blob/master/readme.md Shows how output elements are defined in DMN XML. The output always maps to a variable, either existing or newly created. The typeRef attribute specifies the variable data type (casting is not supported). Note that parser version 1_3ext and above use the name attribute first, then label, then id; parser versions 1_3 and 1_1 use label first, then name, then id. ```xml ``` -------------------------------- ### From(SFeel.Token) Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.definition.builder__1eocnfx.html Implicit conversion of SFeel.Token to SFeel expression. ```APIDOC ## [STATIC] From(SFeel.Token) ### Description Implicit conversion of SFeel.Token to SFeel expression. ### Method Static implicit conversion operator ### Parameters - **token** (SFeel.Token) - Required - The token to convert. ### Returns An SFeel expression. ``` -------------------------------- ### DmnDecision.RequiredDecisions Property Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.decisions__15bua3q.html Gets the list of decisions that this decision directly depends on. Use GetAllRequiredDecisions() to get the full list including indirect dependencies. ```APIDOC ## DmnDecision.RequiredDecisions Property ### Description Gets the list of decisions that this decision directly depends on. Only direct dependencies are included; use GetAllRequiredDecisions() to get the full list. ### Property Signature ```csharp public IReadOnlyCollection RequiredDecisions { get; } ``` ### Property Value - **Type**: IReadOnlyCollection - **Description**: The collection of directly required decisions. ### Implements - IDmnDecision.RequiredDecisions ``` -------------------------------- ### Build DMN definition with S-FEEL expressions Source: https://github.com/adamecr/common.dmn.engine/blob/master/readme.md Constructs a DMN definition with input variables, a table decision, and rules using S-FEEL expressions. Demonstrates the use of SFeel operations like Gt, RngIE, Eq, Not, and hit policy configuration. ```csharp var def = new DmnDefinitionBuilder() .WithInput("input1", out var inputVar1Ref) .WithInput("input2", out var inputVar2Ref) .WithVariable("output", out var outputVarRef) .WithTableDecision("tbl", table => table .WithInput(inputVar1Ref, out var tblInput1Ref) .WithInput(inputVar2Ref, out var tblInput2Ref, l.ToArray()) .WithOutput(outputVarRef, out var tblOutputRef) .WithRule("r1", "input1 > 10 -> input1", r => r .When(tblInput1Ref, SFeel.Gt(10)) .Then(tblOutputRef, "input1")) .WithRule("r2", "input1 >=5 && <15, input2 is 1|3|input1 -> input2/2", r => r .When(tblInput1Ref, SFeel.RngIE(5,15)) .And(tblInput2Ref, SFeel.Eq(1,3,inputVar1Ref)) .Then(tblOutputRef, "input2/2")) .WithRule("r3", "input2 !5 && !input1 -> 10", r => r .When(tblInput2Ref, SFeel.Not(5,inputVar1Ref)) .Then(tblOutputRef, "10")) .WithHitPolicy(HitPolicyEnum.Collect) .WithAggregation(CollectHitPolicyAggregationEnum.List)) .Build(); ``` -------------------------------- ### DmnDecisionTableRule.Name Property Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.decisions.table.definition__1xpej0v.md Gets the rule name. ```APIDOC ## DmnDecisionTableRule.Name Property ### Description Gets the rule name. ### Property Signature ```csharp public string Name { get; } ``` ### Property Value - **Type**: `string` - **Description**: The rule name. ``` -------------------------------- ### C#: Building a decision table with allowed values constraints Source: https://github.com/adamecr/common.dmn.engine/blob/master/readme.md Shows how to use the DmnDefinitionBuilder to create a table decision with allowed values for inputs and outputs via WithInput and WithOutput overloads. The params keyword allows passing multiple allowed values. ```csharp var definition = new DmnDefinitionBuilder() .WithInput("modelInput1", out var modelInput1Ref) .WithVariable("variable1", out var variable1Ref) .WithTableDecision("tableDecision", table => table .WithInput(modelInput1Ref, out var tableInput1, "10", "20") .WithInput(variable1Ref, out var tableInput2, "a", "b") .WithInput(@"modelInput1.ToString()+""<""", out var tableInput3,"10<","20<") .WithInput("variable1.ToString()[0]", out var tableInput4, "1", "2", "3", "4") .WithOutput(variable1Ref,out var tableOutputRef,"s10","s20","s30") .WithRule("rule1", r => r .When(tableInput1, "10") .Then(tableOutputRef, "s10")) ) .Build(); ``` -------------------------------- ### DmnExecutionVariable.GetHashCode() Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.execution.context__143xaoa.md Gets the variable hashcode from name and value. ```APIDOC ## DmnExecutionVariable.GetHashCode() ### Description Gets the variable hashcode from name and value. ### Method GetHashCode() ### Return Value - **int** - Variable hashcode ### Code Example ```csharp public override int GetHashCode() ``` ``` -------------------------------- ### DmnExecutionContext Constructor Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.execution.context__143xaoa.html Initializes a new instance of the DmnExecutionContext class. The constructor accepts the DMN definition, initial variables, decisions, and an optional configuration action for execution context options. ```APIDOC ## Constructor ### Description Initializes a new instance of the DmnExecutionContext class. ### Signature `public DmnExecutionContext(DmnDefinition definition, IReadOnlyDictionary variables, IReadOnlyDictionary decisions, Action configureOptions = null)` ### Parameters - **definition** (DmnDefinition) - Required - The DMN model definition. - **variables** (IReadOnlyDictionary) - Required - Initial variables for the execution context. - **decisions** (IReadOnlyDictionary) - Required - Dictionary of available decisions by name. - **configureOptions** (Action) - Optional - Action to configure execution context options. ``` -------------------------------- ### DmnDecisionTableOutput.Variable Property Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.decisions.table.definition__1xpej0v.md Gets the variable to store the output to. ```APIDOC ## DmnDecisionTableOutput.Variable Property ### Description Gets the variable to store the output to. ### Property Signature ```csharp public IDmnVariable Variable { get; } ``` ### Property Value - **Type**: IDmnVariable - **Description**: The variable to store the output to. ``` -------------------------------- ### Variable.Ref.Name Property Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.definition.builder__1eocnfx.md Gets the name of the variable. ```APIDOC ## Variable.Ref.Name Property ### Description Gets the name of the variable. ### Property Signature ```csharp public string Name { get; } ``` ### Property Value - **string** - The name of the variable. ``` -------------------------------- ### DmnResultVariable.Value Property Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.execution.result__q1n4oi.md Gets the value of the variable. ```APIDOC ## DmnResultVariable.Value Property ### Description Gets the value of the variable. ### Property Signature ```csharp public object Value { get; } ``` ### Property Value - **Value** (object) - The value of the variable. ``` -------------------------------- ### CreateExecutionContext(DmnDefinition, Action) Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.execution.context__143xaoa.html Creates an execution context from a source DMN definition. Optionally accepts a configuration action to customize the execution context options. ```APIDOC ## CreateExecutionContext(DmnDefinition, Action) ### Description Creates the execution context from the provided source definition. ### Method CreateExecutionContext ### Signature public static DmnExecutionContext CreateExecutionContext(DmnDefinition sourceDefinition, Action configure = null) ### Parameters - **sourceDefinition** (DmnDefinition) - Required - Source model definition to create the execution context for. - **configure** (Action) - Optional - Optional configuration action. ### Return Value - **DmnExecutionContext** - The execution context for the source definition. ### Exceptions - **ArgumentNullException** - Thrown when sourceDefinition is null. ``` -------------------------------- ### DmnExecutionSnapshot.Step Property Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.execution.context__143xaoa.html Gets the zero-based sequence number of the execution step. ```APIDOC ## DmnExecutionSnapshot.Step Property ### Description Gets the zero-based sequence number of the execution step. ### Property Signature ```csharp public int Step { get; } ``` ### Property Value - **Type**: [int](https://docs.microsoft.com/en-us/dotnet/api/system.int32) - **Description**: The zero-based sequence number of the execution step. ``` -------------------------------- ### ToString(SFeel) Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.definition.builder__1eocnfx.html Implicit conversion of SFeel.Token to System.String. ```APIDOC ## [STATIC] ToString(SFeel) ### Description Implicit conversion of SFeel.Token to System.String. ### Method Static implicit conversion operator ### Parameters - **sfeel** (SFeel) - Required - The SFeel expression to convert. ### Returns A string representation. ``` -------------------------------- ### GetVariable(string) Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.execution.context__143xaoa.html Gets the runtime (execution) variable with given name. ```APIDOC ## GetVariable(string) ### Description Gets the runtime (execution) variable with given name. ### Method public ### Parameters - **name** (string) - Required - The name of the variable. ### Returns - **runtime variable** - The runtime (execution) variable. ``` -------------------------------- ### ToString(SFeel.Token) Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.definition.builder__1eocnfx.html Implicit conversion of SFeel.Token to System.String. ```APIDOC ## ToString(SFeel.Token) ### Description Implicit conversion of SFeel.Token to System.String. ### Method ToString(SFeel.Token) ### Parameters - **token** (SFeel.Token) - Required - The token to convert. ### Returns - **string** - A string representation of the token. ``` -------------------------------- ### XML informationRequirement with requiredDecision and requiredInput Source: https://github.com/adamecr/common.dmn.engine/blob/master/readme.md Shows how dependencies are stored in XML. Each informationRequirement must contain exactly one of requiredDecision or requiredInput, with an href attribute referencing the target by id (with # prefix). ```XML ``` -------------------------------- ### GetVariable(IDmnVariable) Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.execution.context__143xaoa.html Gets the runtime (execution) variable corresponding to its definition. ```APIDOC ## GetVariable(IDmnVariable) ### Description Gets the runtime (execution) variable corresponding to its definition. ### Method public ### Parameters - **definition** (IDmnVariable) - Required - The variable definition. ### Returns - **runtime variable** - The runtime (execution) variable. ``` -------------------------------- ### DmnDecisionTableRuleOutput.Output Property Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.decisions.table.definition__1xpej0v.md Gets the corresponding table output for this rule output. ```APIDOC ## DmnDecisionTableRuleOutput.Output Property ### Description Gets the corresponding table output for this rule output. ### Property Signature ```csharp public DmnDecisionTableOutput Output { get; } ``` ### Property Value - **Type**: `DmnDecisionTableOutput` - **Description**: The corresponding table output. ``` -------------------------------- ### ForInput() Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.definition.builder__1eocnfx.html Flags variable for input. ```APIDOC ## ForInput() ### Description Flags variable for input. ### Method ForInput ### Parameters None. ### Returns - The updated variable builder instance. ``` -------------------------------- ### DmnDecisionTableOutput.Index Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.decisions.table.definition__1xpej0v.md Gets the index of the output, representing its order in the decision table. ```APIDOC ## DmnDecisionTableOutput.Index ### Description Gets the index of the output, representing its order in the decision table. ### Property `public int Index { get; }` ### Property Value - **int** - The index of the output. ``` -------------------------------- ### DmnDefinitionFactory(DmnModel) Constructor Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.definition__199kcn6.html Initializes a new instance of the DmnDefinitionFactory class with a source DMN model. The source model must not be null. ```APIDOC ## [CTOR] DmnDefinitionFactory(DmnModel) ### Description Initializes a new instance of the DmnDefinitionFactory class with a source DMN model parsed from XML. ### Method Constructor ### Endpoint N/A (SDK constructor) ### Parameters #### Constructor Parameters - **sourceModel** (DmnModel) - Required - Source DMN Model parsed from XML. ### Exceptions - **System.ArgumentNullException** - Thrown when **sourceModel** is null. ### Return Value - **DmnDefinitionFactory** - A new instance of the factory. ### Example ```csharp var factory = new DmnDefinitionFactory(sourceModel); ``` ``` -------------------------------- ### DmnExecutionVariable.Type Property Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.execution.context__143xaoa.html Gets the variable type or null if not defined. Returns a System.Type. ```APIDOC ## DmnExecutionVariable.Type Property ### Description Gets the variable type or null if not defined. ### Property Signature ```csharp public Type Type { get; } ``` ### Property Value - **Type**: System.Type ### Remarks - **Namespace**: net.adamec.lib.common.dmn.engine.engine.execution.context - **Assembly**: net.adamec.lib.common.dmn.engine - **Type**: DmnExecutionVariable - **Source**: engine\execution\context\DmnExecutionVariable.cs ``` -------------------------------- ### DmnExecutionContext.Definition Property Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.execution.context__143xaoa.html Gets the DMN model definition associated with the execution context. ```APIDOC ## DmnExecutionContext.Definition Property ### Description Gets the DMN model definition associated with the execution context. ### Property Signature ```csharp public DmnDefinition Definition { get; } ``` ### Property Value - **DmnDefinition** - The DMN model definition. ``` -------------------------------- ### From(string) Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.definition.builder__1eocnfx.html Implicit conversion from System.String - creates a token representing a string constant. ```APIDOC ## From(string) ### Description Implicit conversion from System.String - creates a token representing a string constant. ### Method From(string) ### Parameters - **value** (string) - Required - The string value to convert. ### Returns - **SFeel.Token** - A token representing a string constant. ``` -------------------------------- ### DmnResultVariable.Type Property Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.execution.result__q1n4oi.md Gets the type of the variable, or null if not defined. ```APIDOC ## DmnResultVariable.Type Property ### Description Gets the type of the variable, or null if not defined. ### Property Signature ```csharp public Type Type { get; } ``` ### Property Value - **Type** (System.Type) - The type of the variable, or null if not defined. ``` -------------------------------- ### Transform DmnModel to DmnExecutionContext via DmnDefinitionFactory Source: https://github.com/adamecr/common.dmn.engine/blob/master/readme.md Shows the typical pipeline: parse the DMN file, create a DmnDefinition using DmnDefinitionFactory, then create a DmnExecutionContext for evaluation. The DmnDefinitionFactory performs the second-level parsing and validation. ```csharp var model=DmnParser.Parse(file); var definition= DmnDefinitionFactory.CreateDmnDefinition(model); var ctx = DmnExecutionContextFactory.CreateExecutionContext(definition); ``` -------------------------------- ### DmnResultVariable.Label Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.execution.result__q1n4oi.md Gets the label of the variable, used for input parameters. ```APIDOC ## DmnResultVariable.Label ### Description Gets the label of the variable, used for input parameters. ### Property `public string Label { get; }` ### Property Value - **string** - The label of the variable. ``` -------------------------------- ### Then Source: https://github.com/adamecr/common.dmn.engine/blob/master/readme.md Defines an action on a table output within a rule. It specifies the output reference and the value to assign. ```APIDOC ## Then ### Description Defines an action on a table output within a rule. It specifies the output reference and the value to assign. ### Method Builder method ### Endpoint `RuleBuilder.Then` ### Parameters - **tableOutputRef** (TableOutputReference) - Required - Reference to the table output. - **value** (string) - Required - Value to assign. ### Request Example ```csharp .Then(tableOutputRef, "it's 2 to 5") ``` ### Response Returns the rule builder for chaining. ``` -------------------------------- ### DmnDecisionTableRuleOutput.Expression Property Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.decisions.table.definition__1xpej0v.md Gets the expression used to calculate the value of the rule output. ```APIDOC ## DmnDecisionTableRuleOutput.Expression Property ### Description Gets the expression used to calculate the value of the rule output. ### Property Signature ```csharp public string Expression { get; } ``` ### Property Value - **Type**: `string` - **Description**: The expression string. ``` -------------------------------- ### Create DmnExecutionContext directly from DmnModel Source: https://github.com/adamecr/common.dmn.engine/blob/master/readme.md Uses the DmnExecutionContextFactory overload that accepts a DmnModel and encapsulates the model-to-definition transformation, allowing direct creation of an execution context from a parsed model. ```csharp var ctx = DmnExecutionContextFactory.CreateExecutionContext(DmnParser.Parse(file)); ``` -------------------------------- ### DmnDecisionTableOutput.AllowedValues Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.decisions.table.definition__1xpej0v.md Gets the optional array of allowed values for the decision table output. ```APIDOC ## DmnDecisionTableOutput.AllowedValues ### Description Gets the optional array of allowed values for the decision table output. ### Property `public string[] AllowedValues { get; }` ### Property Value - **string[]** - The array of allowed values. ``` -------------------------------- ### Generate S-FEEL expression strings with helper Source: https://github.com/adamecr/common.dmn.engine/blob/master/readme.md Shows how to produce S-FEEL expression strings for various operations: equality, comparisons, ranges, negation, and date/time/duration functions. Each line includes a comment showing the resulting expression. ```csharp //"b" var r1 = SFeel.Eq("b"); //6 var r2 = SFeel.Eq(6); //"6" var r3 = SFeel.Eq("6"); //"a","aa","aaa" var r4 = SFeel.Eq("a", "aa", "aaa"); //6,8,3 var r5 = SFeel.Eq(6, 8, 3); //< 5 var r6 = SFeel.Lt(5); //<= 4 var r7 = SFeel.Le(4); //> 5 var r8 = SFeel.Gt(5); //>= 7 var r9 = SFeel.Ge(7); //[2..5] var r10 = SFeel.Eq(SFeel.RngI(2, 5)); //[2..5[ var r11 = SFeel.Eq(SFeel.RngIE(2, 5)); //]2..5] var r12 = SFeel.Eq(SFeel.RngEI(2, 5)); //]2..5[ var r13 = SFeel.Eq(SFeel.RngE(2, 5)); //not(6) var r14 = SFeel.Not(6); //not("b","c","q","o","r","s","v") var r15 = SFeel.Not("b", "c", "q", "o", "r", "s", "v"); //not(<= 5) var r16 = SFeel.Not(SFeel.Le(5)); //not(> 4) var r17 = SFeel.Not(SFeel.Gt(4)); //not([2..5]) var r18 = SFeel.Not(SFeel.RngI(2, 5)); //not(]2..5[) var r19 = SFeel.Not(SFeel.RngE(2, 5)); //4,[6..9[,11 var r20 = SFeel.Eq(4, SFeel.RngIE(6, 9), 11); //not(4,[6..9[,11) var r21 = SFeel.Not(4, SFeel.RngIE(6, 9), 11); //< date("2018-01-23") var r22 = SFeel.Lt(SFeel.Date(new DateTime(2018, 01, 23))); //not(> date("2018-01-23")) var r23 = SFeel.Not(SFeel.Gt(SFeel.Date("2018-01-23"))); //not(date("2018-01-23")) var r24 = SFeel.Not(SFeel.Date(2018, 01, 23)); //>= date and time("2018-01-23T15:30:15") var r25 = SFeel.Ge(SFeel.DateAndTime(new DateTime(2018, 01, 23,15,30,15))); //not(<= date and time("2018-01-23T15:30")) var r26 = SFeel.Not(SFeel.Le(SFeel.DateAndTime(2018, 01, 23, 15, 30))); //date and time("2018-01-23T15:30") var r27 = SFeel.Eq(SFeel.DateAndTime("2018-01-23T15:30")); //time("13:00") var r28 = SFeel.Eq(SFeel.Time("13:00")); //< time("13:45") var r29 = SFeel.Lt(SFeel.Time(13,45)); //not(time("13:10:45")) var r30 = SFeel.Not(SFeel.Time(new TimeSpan(13,10,45))); //duration("P3Y") var r31 = SFeel.Eq(SFeel.Duration("P3Y")); //duration("P92D") var dt = new DateTime(2018, 01, 23); var r32 = SFeel.Eq(SFeel.Duration((dt.AddMonths(3).AddDays(2))-dt)); //duration("P5DT6H7M") var r33 = SFeel.Eq(SFeel.Duration(5,6,7)); //duration("-P6M7DT9M10S") var r34 = SFeel.Eq(SFeel.Duration(0, 6, 7,0,9,10,true)); //>= (date("2018-01-23") + duration("P3Y")) var r35 = SFeel.Ge(SFeel.Expr($"({SFeel.Date(2018, 01, 23)} + {SFeel.Duration(3, 0, 0,0,0)})")); ``` -------------------------------- ### DmnDecision.Label Property Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.decisions__15bua3q.html Gets the label of the decision. ```APIDOC ## [GET] DmnDecision.Label ### Description Gets the label of the decision. ### Method GET ### Endpoint DmnDecision.Label ### Parameters None ### Response #### Success Response (200) - **Label** (string) - The label of the decision. #### Response Example ```json { "label": "string" } ``` ``` -------------------------------- ### SFeel Source: https://github.com/adamecr/common.dmn.engine/blob/master/readme.md A struct helper for composing S-FEEL input expressions as an alternative to raw strings. Helps with syntax but does not check semantics. ```APIDOC ## SFeel ### Description A struct helper for composing S-FEEL input expressions as an alternative to raw strings. Helps with syntax but does not check semantics. ### Usage Use in place of string expressions in `When` and input `And` methods of rule builders. ``` -------------------------------- ### NamedElement.Name Property Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.parser.dto__17tk5mp.html Gets or sets the name of the element. This property is serialized as an XML attribute. ```APIDOC ## [PROPERTY] NamedElement.Name ### Description Gets or sets the name of the element. This property is serialized as an XML attribute. ### Property Signature ```csharp [XmlAttribute("name")] public string Name { get; set; } ``` ### Property Value - **Type**: string - **Description**: The name of the element. ### Attributes - `System.Xml.Serialization.XmlAttributeAttribute` ``` -------------------------------- ### ToString() Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.definition.builder__1eocnfx.html Returns a string that represents the current object. ```APIDOC ## [INSTANCE] ToString() ### Description Returns a string that represents the current object. ### Method Instance method ### Returns A string representation of the current object. ``` -------------------------------- ### ToString() Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.definition.builder__1eocnfx.html Returns a string that represents the current object. ```APIDOC ## ToString() ### Description Returns a string that represents the current object. ### Method ToString ### Parameters None. ### Returns - A string representation of the current object. ``` -------------------------------- ### DmnExecutionVariable.Name Property Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.execution.context__143xaoa.html Gets the unique variable name. This property is read-only and returns a string. ```APIDOC ## DmnExecutionVariable.Name Property ### Description Gets the unique variable name. ### Property Signature ```csharp public string Name { get; } ``` ### Property Value - **Type**: string - **Description**: The unique variable name. ``` -------------------------------- ### DmnExecutionContext.Id Property Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.execution.context__143xaoa.html Gets the unique identifier of the execution context, set at construction time. ```APIDOC ## DmnExecutionContext.Id Property ### Description Gets the unique identifier of the execution context, set at construction time. ### Property Signature ```csharp public string Id { get; } ``` ### Property Value - **string** - The unique identifier of the execution context. ``` -------------------------------- ### ToString() Source: https://github.com/adamecr/common.dmn.engine/blob/master/doc/net.adamec.lib.common.dmn.engine.engine.definition.builder__1eocnfx.html Returns a string that represents the current object. ```APIDOC ## ToString() ### Description Returns a string that represents the current object. ### Method ToString() ### Parameters None ### Returns - **string** - A string representation of the current object. ```