Constant dmntk_examples::DMN_3_0092

source ·
pub const DMN_3_0092: &str = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<definitions namespace=\"https://dmntk.io/\"\n             name=\"compliance-level-3-test-0092\"\n             id=\"_65c7b4cc-a125-4e92-8e7c-6057a6dc275c\"\n             xmlns=\"https://www.omg.org/spec/DMN/20191111/MODEL/\">\n    <description>FEEL lambda</description>\n\n    <!-- ============================================================================================= -->\n\n    <itemDefinition name=\"lambda_number_returns_number\">\n        <functionItem outputTypeRef=\"number\">\n            <parameters name=\"n\" typeRef=\"number\"/>\n        </functionItem>\n    </itemDefinition>\n\n    <!-- ============================================================================================= -->\n\n    <!-- decision returns a UDF lambda (no closures) -->\n    <decision name=\"decision_001_2\" id=\"_decision_001_2\">\n        <variable name=\"decision_001_2\"/>\n        <literalExpression>\n            <text>function (a) 1 + a</text>\n        </literalExpression>\n    </decision>\n\n    <decision name=\"decision_001_1\" id=\"_decision_001_1\">\n        <variable name=\"decision_001_1\"/>\n        <informationRequirement>\n            <requiredDecision href=\"#_decision_001_2\"/>\n        </informationRequirement>\n        <!-- invokes a lambda supplied by another decision -->\n        <literalExpression>\n            <text>decision_001_2(2)</text>\n        </literalExpression>\n    </decision>\n\n    <!-- ============================================================================================= -->\n\n    <!-- decision returns a function definition lambda (no closures) -->\n    <decision name=\"decision_002_2\" id=\"_decision_002_2\">\n        <variable name=\"decision_002_2\"/>\n        <functionDefinition>\n            <formalParameter name=\"a\" typeRef=\"number\"/>\n            <literalExpression>\n                <text>1 + a</text>\n            </literalExpression>\n        </functionDefinition>\n    </decision>\n\n    <decision name=\"decision_002_1\" id=\"_decision_002_1\">\n        <variable name=\"decision_002_1\"/>\n        <informationRequirement>\n            <requiredDecision href=\"#_decision_002_2\"/>\n        </informationRequirement>\n        <!-- invokes a lambda supplied by another decision -->\n        <literalExpression>\n            <text>decision_002_2(3)</text>\n        </literalExpression>\n    </decision>\n\n    <!-- ============================================================================================= -->\n\n    <!-- BKM returns a UDF lambda (no closures) -->\n    <businessKnowledgeModel name=\"bkm_003_1\" id=\"_bkm_003_1\">\n        <variable name=\"bkm_003_1\"/>\n        <encapsulatedLogic>\n            <literalExpression>\n                <text>function (a) 1 + a</text>\n            </literalExpression>\n        </encapsulatedLogic>\n    </businessKnowledgeModel>\n\n    <decision name=\"decision_003_1\" id=\"_decision_003_1\">\n        <variable name=\"decision_003_1\"/>\n        <knowledgeRequirement>\n            <requiredKnowledge href=\"#_bkm_003_1\"/>\n        </knowledgeRequirement>\n        <!-- invokes a lambda supplied by bkm -->\n        <literalExpression>\n            <text>bkm_003_1()(4)</text>\n        </literalExpression>\n    </decision>\n\n    <!-- ============================================================================================= -->\n\n    <!-- BKM returns a Function Definition lambda (no closures) -->\n    <businessKnowledgeModel name=\"bkm_004_1\" id=\"_bkm_004_1\">\n        <variable name=\"bkm_004_1\"/>\n        <encapsulatedLogic>\n            <functionDefinition>\n                <formalParameter name=\"a\" typeRef=\"number\"/>\n                <literalExpression>\n                    <text>1 + a</text>\n                </literalExpression>\n            </functionDefinition>\n        </encapsulatedLogic>\n    </businessKnowledgeModel>\n\n    <decision name=\"decision_004_1\" id=\"_decision_004_1\">\n        <variable name=\"decision_004_1\"/>\n        <knowledgeRequirement>\n            <requiredKnowledge href=\"#_bkm_004_1\"/>\n        </knowledgeRequirement>\n        <!-- invokes a lambda supplied by bkm -->\n        <literalExpression>\n            <text>bkm_004_1()(5)</text>\n        </literalExpression>\n    </decision>\n\n    <!-- ============================================================================================= -->\n\n    <!-- BKM has a single param.  It returns a UDF lambda that uses that bkm param in closure -->\n    <businessKnowledgeModel name=\"bkm_005_1\" id=\"_bkm_005_1\">\n        <variable name=\"bkm_005_1\"/>\n        <encapsulatedLogic>\n            <formalParameter name=\"a\" typeRef=\"number\"/>\n            <literalExpression>\n                <text>function (b) a * b</text>\n            </literalExpression>\n        </encapsulatedLogic>\n    </businessKnowledgeModel>\n\n    <decision name=\"decision_005_1\" id=\"_decision_005_1\">\n        <variable name=\"decision_005_1\"/>\n        <knowledgeRequirement>\n            <requiredKnowledge href=\"#_bkm_005_1\"/>\n        </knowledgeRequirement>\n        <!-- invokes bkm.  The bkm returns a function with \'10\' closed over.   -->\n        <literalExpression>\n            <text>bkm_005_1(10)(2)</text>\n        </literalExpression>\n    </decision>\n\n    <!-- ============================================================================================= -->\n\n    <!-- BKM has a single param.  It returns a function definition lambda that uses that bkm param in closure -->\n    <businessKnowledgeModel name=\"bkm_006_1\" id=\"_bkm_006_1\">\n        <variable name=\"bkm_006_1\"/>\n        <encapsulatedLogic>\n            <formalParameter name=\"a\" typeRef=\"number\"/>\n            <functionDefinition>\n                <formalParameter name=\"b\" typeRef=\"number\"/>\n                <literalExpression>\n                    <text>a * b</text>\n                </literalExpression>\n            </functionDefinition>\n        </encapsulatedLogic>\n    </businessKnowledgeModel>\n\n    <decision name=\"decision_006_1\" id=\"_decision_006_1\">\n        <variable name=\"decision_006_1\"/>\n        <knowledgeRequirement>\n            <requiredKnowledge href=\"#_bkm_006_1\"/>\n        </knowledgeRequirement>\n        <!-- invokes bkm.  The bkm returns a function with \'10\' closed over.   -->\n        <literalExpression>\n            <text>bkm_006_1(10)(3)</text>\n        </literalExpression>\n    </decision>\n\n    <!-- ============================================================================================= -->\n\n    <inputData name=\"input_007_1\" id=\"_input_007_1\">\n        <variable name=\"input_007_1\" typeRef=\"number\"/>\n    </inputData>\n\n    <!-- decision returns a UDF lambda that closes over an info requirement input data value -->\n    <decision name=\"decision_007_2\" id=\"_decision_007_2\">\n        <variable name=\"decision_007_2\"/>\n        <informationRequirement>\n            <requiredInput href=\"#_input_007_1\"/>\n        </informationRequirement>\n        <literalExpression>\n            <text>function (a: number) a * input_007_1</text>\n        </literalExpression>\n    </decision>\n\n    <decision name=\"decision_007_1\" id=\"_decision_007_1\">\n        <variable name=\"decision_007_1\"/>\n        <informationRequirement>\n            <requiredDecision href=\"#_decision_007_2\"/>\n        </informationRequirement>\n        <!-- invokes a lambda that has the value of input_007_1 closed over -->\n        <literalExpression>\n            <text>decision_007_2(5)</text>\n        </literalExpression>\n    </decision>\n\n    <!-- ============================================================================================= -->\n\n    <!-- BKM has a param.  It returns a UDF lambda that has the same name as one of its own params -->\n    <businessKnowledgeModel name=\"bkm_008_1\" id=\"_bkm_008_1\">\n        <variable name=\"bkm_008_1\"/>\n        <encapsulatedLogic>\n            <formalParameter name=\"a\" typeRef=\"number\"/>\n            <literalExpression>\n                <text>function (a, b) a * b</text>\n            </literalExpression>\n        </encapsulatedLogic>\n    </businessKnowledgeModel>\n\n    <decision name=\"decision_008_1\" id=\"_decision_008_1\">\n        <variable name=\"decision_008_1\"/>\n        <knowledgeRequirement>\n            <requiredKnowledge href=\"#_bkm_008_1\"/>\n        </knowledgeRequirement>\n        <!-- invokes lambda passing 10 as param \'a\', but as lambda has an \'a\' param the 10 is not closed over -->\n        <literalExpression>\n            <text>bkm_008_1(10)(2, 3)</text>\n        </literalExpression>\n    </decision>\n\n    <!-- ============================================================================================= -->\n\n    <!-- BKM returns a UDF with a closed over \'a\' -->\n    <businessKnowledgeModel name=\"bkm_009_1\" id=\"_bkm_009_1\">\n        <variable name=\"bkm_009_1\"/>\n        <encapsulatedLogic>\n            <formalParameter name=\"a\" typeRef=\"number\"/>\n            <literalExpression>\n                <text>function (b) a * b</text>\n            </literalExpression>\n        </encapsulatedLogic>\n    </businessKnowledgeModel>\n\n    <decision name=\"decision_009_1\" id=\"_decision_009_1\">\n        <variable name=\"decision_009_1\"/>\n        <knowledgeRequirement>\n            <requiredKnowledge href=\"#_bkm_009_1\"/>\n        </knowledgeRequirement>\n        <context>\n            <contextEntry>\n                <!-- var \'a\' in scope for expression below -->\n                <variable name=\"a\"/>\n                <literalExpression>\n                    <text>10</text>\n                </literalExpression>\n            </contextEntry>\n            <contextEntry>\n                <!-- lambda from bkm has \'a\' closed over with value 100 - so it gets used, not the 10 from context\n                var above -->\n                <literalExpression>\n                    <text>bkm_009_1(100)(2)</text>\n                </literalExpression>\n            </contextEntry>\n        </context>\n    </decision>\n\n    <!-- ============================================================================================= -->\n\n    <!-- bkm has UDF lambda that has a currying-like multiple levels of closure -->\n    <businessKnowledgeModel name=\"bkm_010_1\" id=\"_bkm_010_1\">\n        <variable name=\"bkm_010_1\"/>\n        <encapsulatedLogic>\n            <formalParameter name=\"a\" typeRef=\"number\"/>\n            <literalExpression>\n                <text>function (b) function(c) function(d) a*b*c*d</text>\n            </literalExpression>\n        </encapsulatedLogic>\n    </businessKnowledgeModel>\n\n    <decision name=\"decision_010_2\" id=\"_decision_010_2\">\n        <variable name=\"decision_010_2\"/>\n        <knowledgeRequirement>\n            <requiredKnowledge href=\"#_bkm_010_1\"/>\n        </knowledgeRequirement>\n        <!-- invokes lambda passing param that close over multiple levels, but last level is not invoked\n        so expression result is actually the final nested lambda -->\n        <literalExpression>\n            <text>bkm_010_1(2)(3)(4)</text>\n        </literalExpression>\n    </decision>\n\n    <decision name=\"decision_010_1\" id=\"_decision_010_1\">\n        <variable name=\"decision_010_1\"/>\n        <informationRequirement>\n            <requiredDecision href=\"#_decision_010_2\"/>\n        </informationRequirement>\n        <!-- invokes lambda passing param that close over multiple levels -->\n        <literalExpression>\n            <text>decision_010_2(5)</text>\n        </literalExpression>\n    </decision>\n\n    <!-- ============================================================================================= -->\n\n    <!-- bkm has function definition lambda that a currying-like multiple levels of closure -->\n    <businessKnowledgeModel name=\"bkm_010_1_a\" id=\"_bkm_010_1_a\">\n        <variable name=\"bkm_010_1_a\"/>\n        <encapsulatedLogic>\n            <formalParameter name=\"a\" typeRef=\"number\"/>\n            <functionDefinition>\n                <formalParameter name=\"b\" typeRef=\"number\"/>\n                <functionDefinition>\n                    <formalParameter name=\"c\" typeRef=\"number\"/>\n                    <functionDefinition>\n                        <formalParameter name=\"d\" typeRef=\"number\"/>\n                        <literalExpression>\n                            <text>a*b*c*d</text>\n                        </literalExpression>\n                    </functionDefinition>\n                </functionDefinition>\n            </functionDefinition>\n        </encapsulatedLogic>\n    </businessKnowledgeModel>\n\n    <decision name=\"decision_010_2_a\" id=\"_decision_010_2_a\">\n        <variable name=\"decision_010_2_a\"/>\n        <knowledgeRequirement>\n            <requiredKnowledge href=\"#_bkm_010_1_a\"/>\n        </knowledgeRequirement>\n        <!-- invokes lambda passing param that close over multiple levels, but last level is not invoked\n        so expression result is actually the final nested lambda -->\n        <literalExpression>\n            <text>bkm_010_1_a(2)(3)(4)</text>\n        </literalExpression>\n    </decision>\n\n    <decision name=\"decision_010_1_a\" id=\"_decision_010_1_a\">\n        <variable name=\"decision_010_1_a\"/>\n        <informationRequirement>\n            <requiredDecision href=\"#_decision_010_2_a\"/>\n        </informationRequirement>\n        <!-- invokes lambda passing param that close over multiple levels -->\n        <literalExpression>\n            <text>decision_010_2_a(5)</text>\n        </literalExpression>\n    </decision>\n\n    <!-- ============================================================================================= -->\n\n    <!-- BKM take two lambda params -->\n    <businessKnowledgeModel name=\"bkm_011_1\" id=\"_bkm_011_1\">\n        <variable name=\"bkm_011_1\"/>\n        <encapsulatedLogic>\n            <formalParameter name=\"fn1\"/>\n            <formalParameter name=\"fn2\"/>\n            <literalExpression>\n                <text>fn1(5)*fn2(10)</text>\n            </literalExpression>\n        </encapsulatedLogic>\n    </businessKnowledgeModel>\n\n    <inputData name=\"input_011_1\" id=\"_input_011_1\">\n        <variable name=\"input_011_1\" typeRef=\"number\"/>\n    </inputData>\n\n    <decision name=\"decision_011_1\" id=\"_decision_011_1\">\n        <variable name=\"decision_011_1\"/>\n        <informationRequirement>\n            <requiredInput href=\"#_input_011_1\"/>\n        </informationRequirement>\n        <knowledgeRequirement>\n            <requiredKnowledge href=\"#_bkm_011_1\"/>\n        </knowledgeRequirement>\n        <literalExpression>\n            <!-- two UDF lambdas are passed to bkm_011_1 -->\n            <text>bkm_011_1(function (a) input_011_1 * a, function (b) input_011_1 * b)</text>\n        </literalExpression>\n    </decision>\n\n    <!-- ============================================================================================= -->\n\n    <!-- BKM take two lambda params -->\n    <businessKnowledgeModel name=\"bkm_012_1\" id=\"_bkm_012_1\">\n        <variable name=\"bkm_012_1\"/>\n        <encapsulatedLogic>\n            <formalParameter name=\"fn1\"/>\n            <formalParameter name=\"fn2\"/>\n            <literalExpression>\n                <text>fn1(5)*fn2(10)</text>\n            </literalExpression>\n        </encapsulatedLogic>\n    </businessKnowledgeModel>\n\n    <businessKnowledgeModel name=\"bkm_012_2\" id=\"_bkm_012_2\">\n        <variable name=\"bkm_012_2\"/>\n        <encapsulatedLogic>\n            <formalParameter name=\"a\"/>\n            <literalExpression>\n                <text>a * 10</text>\n            </literalExpression>\n        </encapsulatedLogic>\n    </businessKnowledgeModel>\n\n    <decision name=\"decision_012_1\" id=\"_decision_012_1\">\n        <variable name=\"decision_012_1\"/>\n        <knowledgeRequirement>\n            <requiredKnowledge href=\"#_bkm_012_1\"/>\n        </knowledgeRequirement>\n        <knowledgeRequirement>\n            <requiredKnowledge href=\"#_bkm_012_2\"/>\n        </knowledgeRequirement>\n        <!-- bkm_012_2 is not executed here but is passed on to bkm_012_1 -->\n        <literalExpression>\n            <text>bkm_012_1(bkm_012_2, bkm_012_2)</text>\n        </literalExpression>\n    </decision>\n\n    <!-- ============================================================================================= -->\n\n    <inputData name=\"input_013_1\" id=\"_input_013_1\">\n        <variable name=\"input_013_1\" typeRef=\"number\"/>\n    </inputData>\n\n    <decisionService name=\"decisionService_013_1\" id=\"_decisionService_013_1\">\n        <variable name=\"decisionService_013_1\"/>\n        <outputDecision href=\"#_decision_013_2\"/>\n        <inputData href=\"#_input_013_1\"/>\n    </decisionService>\n\n    <decision name=\"decision_013_2\" id=\"_decision_013_2\">\n        <variable name=\"decision_013_2\"/>\n        <informationRequirement>\n            <requiredInput href=\"#_input_013_1\"/>\n        </informationRequirement>\n        <literalExpression>\n            <text>input_013_1 * 10</text>\n        </literalExpression>\n    </decision>\n\n    <!-- BKM take two DS lambda params (each DS returns a context)-->\n    <businessKnowledgeModel name=\"bkm_013_1\" id=\"_bkm_013_1\">\n        <variable name=\"bkm_013_1\"/>\n        <encapsulatedLogic>\n            <formalParameter name=\"fn1\"/>\n            <formalParameter name=\"fn2\"/>\n            <literalExpression>\n                <!-- DS invocations - with param.  Each DS invocation returns a context -->\n                <text>fn1(5)*fn2(10)</text>\n            </literalExpression>\n        </encapsulatedLogic>\n    </businessKnowledgeModel>\n\n    <decision name=\"decision_013_1\" id=\"_decision_013_1\">\n        <variable name=\"decision_013_1\"/>\n        <knowledgeRequirement>\n            <requiredKnowledge href=\"#_bkm_013_1\"/>\n        </knowledgeRequirement>\n        <knowledgeRequirement>\n            <requiredKnowledge href=\"#_decisionService_013_1\"/>\n        </knowledgeRequirement>\n        <!-- decisionService_013_1 is not executed here but is passed on to bkm_013_1 -->\n        <literalExpression>\n            <text>bkm_013_1(decisionService_013_1, decisionService_013_1)</text>\n        </literalExpression>\n    </decision>\n\n    <!-- ============================================================================================= -->\n\n    <!-- BKM take two lambda params -->\n    <businessKnowledgeModel name=\"bkm_014_1\" id=\"_bkm_014_1\">\n        <variable name=\"bkm_014_1\"/>\n        <encapsulatedLogic>\n            <formalParameter name=\"fn1\" typeRef=\"lambda_number_returns_number\"/>\n            <formalParameter name=\"fn2\" typeRef=\"lambda_number_returns_number\"/>\n            <literalExpression>\n                <text>fn1(-5)*fn2(25)</text>\n            </literalExpression>\n        </encapsulatedLogic>\n    </businessKnowledgeModel>\n\n    <decision name=\"decision_014_1\" id=\"_decision_014_1\">\n        <variable name=\"decision_014_1\"/>\n        <knowledgeRequirement>\n            <requiredKnowledge href=\"#_bkm_014_1\"/>\n        </knowledgeRequirement>\n        <literalExpression>\n            <text>bkm_014_1(abs, sqrt)</text>\n        </literalExpression>\n    </decision>\n\n    <!-- ============================================================================================= -->\n\n    <businessKnowledgeModel name=\"bkm_015_1\" id=\"_bkm_015_1\">\n        <variable name=\"bkm_015_1\"/>\n        <encapsulatedLogic>\n            <formalParameter name=\"fn1\"/>\n            <literalExpression>\n                <!-- pass in \'sum\' func is used both in sum(list) and sum(list..) modes -->\n                <text>fn1([1,2,3])*fn1(1,2)</text>\n            </literalExpression>\n        </encapsulatedLogic>\n    </businessKnowledgeModel>\n\n    <decision name=\"decision_015_1\" id=\"_decision_015_1\">\n        <variable name=\"decision_015_1\"/>\n        <knowledgeRequirement>\n            <requiredKnowledge href=\"#_bkm_015_1\"/>\n        </knowledgeRequirement>\n        <!-- passed overloadable built-in function as param  -->\n        <literalExpression>\n            <text>bkm_015_1(sum)</text>\n        </literalExpression>\n    </decision>\n\n    <!-- ============================================================================================= -->\n\n    <businessKnowledgeModel name=\"bkm_016_1\" id=\"_bkm_016_1\">\n        <variable name=\"bkm_016_1\"/>\n        <encapsulatedLogic>\n            <formalParameter name=\"fn1\"/>\n            <literalExpression>\n                <!-- passed in \'sqrt\' func is invoked with too many params -->\n                <text>fn1(10,2)</text>\n            </literalExpression>\n        </encapsulatedLogic>\n    </businessKnowledgeModel>\n\n    <decision name=\"decision_016_1\" id=\"_decision_016_1\">\n        <variable name=\"decision_016_1\"/>\n        <knowledgeRequirement>\n            <requiredKnowledge href=\"#_bkm_016_1\"/>\n        </knowledgeRequirement>\n        <literalExpression>\n            <text>bkm_016_1(sqrt)</text>\n        </literalExpression>\n    </decision>\n\n    <!-- ============================================================================================= -->\n\n    <businessKnowledgeModel name=\"bkm_017_1\" id=\"_bkm_017_1\">\n        <variable name=\"bkm_017_1\"/>\n        <encapsulatedLogic>\n            <formalParameter name=\"fn1\"/>\n            <literalExpression>\n                <!-- passed in \'precedes\' lambda is passed again to sort() -->\n                <text>sort([\"a\",\"z\", \"a\", \"z\"], fn1)</text>\n            </literalExpression>\n        </encapsulatedLogic>\n    </businessKnowledgeModel>\n\n    <inputData name=\"input_017_1\" id=\"_input_017_1\">\n        <variable name=\"input_017_1\" typeRef=\"string\"/>\n    </inputData>\n\n    <decision name=\"decision_017_1\" id=\"_decision_017_1\">\n        <variable name=\"decision_017_1\"/>\n        <informationRequirement>\n            <requiredInput href=\"#_input_017_1\"/>\n        </informationRequirement>\n        <knowledgeRequirement>\n            <requiredKnowledge href=\"#_bkm_017_1\"/>\n        </knowledgeRequirement>\n        <literalExpression>\n            <text>bkm_017_1(function (a,b) if a = input_017_1 then true else false)</text>\n        </literalExpression>\n    </decision>\n\n    <!-- ============================================================================================= -->\n\n    <businessKnowledgeModel name=\"bkm_018\" id=\"_bkm_018\">\n        <variable name=\"bkm_018\"/>\n        <encapsulatedLogic>\n            <formalParameter name=\"p1\"/>\n            <formalParameter name=\"p2\"/>\n            <literalExpression>\n                <text>if p1 = \"a\" then true else false</text>\n            </literalExpression>\n        </encapsulatedLogic>\n    </businessKnowledgeModel>\n\n    <!-- decision pass a BKM to the sort() function -->\n    <decision name=\"decision_018\" id=\"_decision_018\">\n        <variable name=\"decision_018\"/>\n        <knowledgeRequirement>\n            <requiredKnowledge href=\"#_bkm_018\"/>\n        </knowledgeRequirement>\n        <literalExpression>\n            <text>sort([\"a\",\"z\", \"a\", \"z\"], bkm_018)</text>\n        </literalExpression>\n    </decision>\n\n</definitions>";