dsntk-examples 0.3.0

ÐecisionToolkit | Examples
Documentation
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions namespace="http://www.montera.com.au/spec/DMN/0095-feel-day-of-year-function"
             name="0095-feel-day-of-year-function"
             id="_i9fboPUUEeesLuP4RHs4vA"
             xmlns="https://www.omg.org/spec/DMN/20191111/MODEL/">
    
    <description>day of year function</description>

    <inputData name="date_input_001" id="_date_input_001">
        <!-- used to externally supply FEEL:date or other type of values defined in the TCK test file -->
        <variable name="date_input_001" typeRef="Any"/>
    </inputData>

    <decision name="date_001" id="_date_001">
        <description>Tests FEEL expression: 'day of year(@"1970-01-01")' and expects result: '1 (number)'</description>
        <question>Result of FEEL expression 'day of year(@"1970-01-01")'?</question>
        <allowedAnswers>1 (number)</allowedAnswers>
        <variable name="date_001"/>
        <literalExpression>
            <text>day of year(@"1970-01-01")</text>
        </literalExpression>
    </decision>

    <decision name="date_002" id="_date_002">
        <description>Tests FEEL expression: 'day of year(@"2019-12-31")' and expects result: '365 (number)'</description>
        <question>Result of FEEL expression 'day of year(@"2019-12-31")'?</question>
        <allowedAnswers>365 (number)</allowedAnswers>
        <variable name="date_002"/>
        <literalExpression>
            <text>day of year(@"2019-12-31")</text>
        </literalExpression>
    </decision>

    <decision name="date_003" id="_date_003">
        <description>Tests FEEL expression: 'day of year(@"2020-12-31")' and expects result: '366 (number)'</description>
        <question>Result of FEEL expression 'day of year(@"2020-12-31")'?</question>
        <allowedAnswers>366 (number)</allowedAnswers>
        <variable name="date_003"/>
        <literalExpression>
            <text>day of year(@"2020-12-31")</text>
        </literalExpression>
    </decision>

    <decision name="date_004" id="_date_004">
        <description>Tests FEEL expression: 'day of year(@"2019-09-17")' and expects result: '260 (number)'</description>
        <question>Result of FEEL expression 'day of year(@"2019-09-17")'?</question>
        <allowedAnswers>260 (number)</allowedAnswers>
        <variable name="date_004"/>
        <literalExpression>
            <text>day of year(@"2019-09-17")</text>
        </literalExpression>
    </decision>

    <decision name="date_005" id="_date_005">
        <variable name="date_005"/>
        <informationRequirement>
            <requiredInput href="#_date_input_001"/>
        </informationRequirement>
        <literalExpression>
            <text>day of year(date_input_001)</text>
        </literalExpression>
    </decision>

    <decision name="date_006" id="_date_006">
        <description>Tests FEEL expression: 'day of year(date: @"2019-09-17")' and expects result: '260 (number)'</description>
        <question>Result of FEEL expression 'day of year(date: @"2019-09-17")'?</question>
        <allowedAnswers>260 (number)</allowedAnswers>
        <variable name="date_006"/>
        <literalExpression>
            <text>day of year(date: @"2019-09-17")</text>
        </literalExpression>
    </decision>

    <decision name="datetime_001" id="_datetime_001">
        <description>Tests FEEL expression: 'day of year(@"1970-01-01T10:10:10")' and expects result: '1 (number)'</description>
        <question>Result of FEEL expression 'day of year(@"1970-01-01T10:10:10")'?</question>
        <allowedAnswers>1 (number)</allowedAnswers>
        <variable name="datetime_001"/>
        <literalExpression>
            <text>day of year(@"1970-01-01T10:10:10")</text>
        </literalExpression>
    </decision>

    <decision name="datetime_002" id="_datetime_002">
        <description>Tests FEEL expression: 'day of year(@"2019-12-31T10:10:10")' and expects result: '365 (number)'</description>
        <question>Result of FEEL expression 'day of year(@"2019-12-31T10:10:10")'?</question>
        <allowedAnswers>365 (number)</allowedAnswers>
        <variable name="datetime_002"/>
        <literalExpression>
            <text>day of year(@"2019-12-31T10:10:10")</text>
        </literalExpression>
    </decision>

    <decision name="datetime_003" id="_datetime_003">
        <description>Tests FEEL expression: 'day of year(@"2020-12-31T10:10:10")' and expects result: '366 (number)'</description>
        <question>Result of FEEL expression 'day of year(@"2020-12-31T10:10:10")'?</question>
        <allowedAnswers>366 (number)</allowedAnswers>
        <variable name="datetime_003"/>
        <literalExpression>
            <!-- leap year -->
            <text>day of year(@"2020-12-31T10:10:10")</text>
        </literalExpression>
    </decision>

    <decision name="datetime_004" id="_datetime_004">
        <variable name="datetime_004"/>
        <informationRequirement>
            <requiredInput href="#_date_input_001"/>
        </informationRequirement>
        <literalExpression>
            <text>day of year(date_input_001)</text>
        </literalExpression>
    </decision>

    <decision name="datetime_005" id="_datetime_005">
        <description>Tests FEEL expression: 'day of year(date: @"2019-09-17T10:10:10")' and expects result: '260 (number)'</description>
        <question>Result of FEEL expression 'day of year(date: @"2019-09-17T10:10:10")'?</question>
        <allowedAnswers>260 (number)</allowedAnswers>
        <variable name="datetime_005"/>
        <literalExpression>
            <text>day of year(date: @"2019-09-17T10:10:10")</text>
        </literalExpression>
    </decision>

    <decision name="null_001" id="_null_001">
        <description>Tests FEEL expression: 'day of year(null)' and expects result: 'null (number)'</description>
        <question>Result of FEEL expression 'day of year(null)'?</question>
        <allowedAnswers>null (number)</allowedAnswers>
        <variable name="null_001"/>
        <literalExpression>
            <text>day of year(null)</text>
        </literalExpression>
    </decision>

    <decision name="null_002" id="_null_002">
        <description>Tests FEEL expression: 'day of year()' and expects result: 'null (number)'</description>
        <question>Result of FEEL expression 'day of year()'?</question>
        <allowedAnswers>null (number)</allowedAnswers>
        <variable name="null_002"/>
        <literalExpression>
            <text>day of year()</text>
        </literalExpression>
    </decision>

    <decision name="null_003" id="_null_003">
        <description>Tests FEEL expression: 'day of year("foo")' and expects result: 'null (number)'</description>
        <question>Result of FEEL expression 'day of year("foo")'?</question>
        <allowedAnswers>null (number)</allowedAnswers>
        <variable name="null_003"/>
        <literalExpression>
            <text>day of year("foo")</text>
        </literalExpression>
    </decision>

    <decision name="null_004" id="_null_004">
        <description>Tests FEEL expression: 'day of year(date: null)' and expects result: 'null (number)'</description>
        <question>Result of FEEL expression 'day of year(date: null)'?</question>
        <allowedAnswers>null (number)</allowedAnswers>
        <variable name="null_004"/>
        <literalExpression>
            <text>day of year(date: null)</text>
        </literalExpression>
    </decision>

    <decision name="null_005" id="_null_005">
        <description>Tests FEEL expression: 'day of year(date: "foo")' and expects result: 'null (number)'</description>
        <question>Result of FEEL expression 'day of year(date: "foo")'?</question>
        <allowedAnswers>null (number)</allowedAnswers>
        <variable name="null_005"/>
        <literalExpression>
            <text>day of year(date: "foo")</text>
        </literalExpression>
    </decision>

    <decision name="null_006" id="_null_006">
        <description>Tests FEEL expression: 'day of year(value: @"1970-01-01")' and expects result: 'null (number)'</description>
        <question>Result of FEEL expression 'day of year(value: @"1970-01-01")'?</question>
        <allowedAnswers>null (number)</allowedAnswers>
        <variable name="null_006"/>
        <literalExpression>
            <!-- 'value' is not the param name -->
            <text>day of year(value: @"1970-01-01")</text>
        </literalExpression>
    </decision>

    <decision name="null_007" id="_null_007">
        <variable name="null_007"/>
        <informationRequirement>
            <requiredInput href="#_date_input_001"/>
        </informationRequirement>
        <literalExpression>
            <text>day of year(date_input_001)</text>
        </literalExpression>
    </decision>

    <decision name="null_008" id="_null_008">
        <description>Tests FEEL expression: 'day of year(@"1970-01-01", @"1970-01-01")' and expects result: 'null (number)'</description>
        <question>Result of FEEL expression 'day of year(@"1970-01-01", @"1970-01-01")'?</question>
        <allowedAnswers>null (number)</allowedAnswers>
        <variable name="null_008"/>
        <literalExpression>
            <!-- too many params -->
            <text>day of year(@"1970-01-01", @"1970-01-01")</text>
        </literalExpression>
    </decision>

</definitions>