<?xml version="1.0" encoding="UTF-8"?>
<semantic:definitions xmlns="https://www.drools.org/kie-dmn"
                      xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/"
                      xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/"
                      xmlns:dmndi="http://www.omg.org/spec/DMN/20180521/DMNDI/"
                      xmlns:feel="http://www.omg.org/spec/DMN/20180521/FEEL/"
                      xmlns:kie="https://www.drools.org/kie-dmn"
                      xmlns:semantic="http://www.omg.org/spec/DMN/20180521/MODEL/"
                      id="_0020_vacation_days"
                      name="0020-vacation-days"
                      namespace="https://www.drools.org/kie-dmn">
   <semantic:inputData id="i_Age" name="Age">
      <semantic:variable name="Age" typeRef="number"/>
   </semantic:inputData>
   <semantic:inputData id="i_Years_of_Service" name="Years of Service">
      <semantic:variable name="Years of Service" typeRef="number"/>
   </semantic:inputData>
   <semantic:decision name="Total Vacation Days" id="d_Total_Vacation_Days">
      <semantic:variable name="Total Vacation Days" typeRef="number"/>
      <semantic:informationRequirement>
         <semantic:requiredDecision href="#d_Base_Vacation_Days"/>
      </semantic:informationRequirement>
      <semantic:informationRequirement>
         <semantic:requiredDecision href="#d_Extra_days_case_1"/>
      </semantic:informationRequirement>
      <semantic:informationRequirement>
         <semantic:requiredDecision href="#d_Extra_days_case_2"/>
      </semantic:informationRequirement>
      <semantic:informationRequirement>
         <semantic:requiredDecision href="#d_Extra_days_case_3"/>
      </semantic:informationRequirement>
      <semantic:literalExpression>
         <semantic:text>Base Vacation Days +
	              max( Extra days case 1, Extra days case 3 ) +
	              Extra days case 2</semantic:text>
      </semantic:literalExpression>
   </semantic:decision>
   <semantic:decision name="Extra days case 1" id="d_Extra_days_case_1">
      <semantic:variable name="Extra days case 1" typeRef="number"/>
      <semantic:informationRequirement>
         <semantic:requiredInput href="#i_Age"/>
      </semantic:informationRequirement>
      <semantic:informationRequirement>
         <semantic:requiredInput href="#i_Years_of_Service"/>
      </semantic:informationRequirement>
      <semantic:decisionTable hitPolicy="COLLECT" aggregation="MAX">
         <semantic:input id="d_Extra_days_case_1_dt_i_age" label="Age">
            <semantic:inputExpression typeRef="number">
               <semantic:text>Age</semantic:text>
            </semantic:inputExpression>
         </semantic:input>
         <semantic:input id="d_Extra_days_case_1_dt_i_years" label="Years of Service">
            <semantic:inputExpression typeRef="number">
               <semantic:text>Years of Service</semantic:text>
            </semantic:inputExpression>
         </semantic:input>
         <semantic:output id="d_Extra_days_case_1_dt_o" label="Extra days">
            <semantic:defaultOutputEntry>
               <semantic:text>0</semantic:text>
            </semantic:defaultOutputEntry>
         </semantic:output>
         <semantic:rule id="d_Extra_days_case_1_dt_r1">
            <semantic:inputEntry id="d_Extra_days_case_1_dt_r1_i1">
               <semantic:text>&lt;18,&gt;=60</semantic:text>
            </semantic:inputEntry>
            <semantic:inputEntry id="d_Extra_days_case_1_dt_r1_i2">
               <semantic:text>-</semantic:text>
            </semantic:inputEntry>
            <semantic:outputEntry id="d_Extra_days_case_1_dt_r1_o1">
               <semantic:text>5</semantic:text>
            </semantic:outputEntry>
         </semantic:rule>
         <semantic:rule id="d_Extra_days_case_1_dt_r2">
            <semantic:inputEntry id="d_Extra_days_case_1_dt_r2_i1">
               <semantic:text>-</semantic:text>
            </semantic:inputEntry>
            <semantic:inputEntry id="d_Extra_days_case_1_dt_r2_i2">
               <semantic:text>&gt;=30</semantic:text>
            </semantic:inputEntry>
            <semantic:outputEntry id="d_Extra_days_case_1_dt_r2_o1">
               <semantic:text>5</semantic:text>
            </semantic:outputEntry>
         </semantic:rule>
      </semantic:decisionTable>
   </semantic:decision>
   <semantic:decision name="Extra days case 2" id="d_Extra_days_case_2">
      <semantic:variable name="Extra days case 2" typeRef="number"/>
      <semantic:informationRequirement>
         <semantic:requiredInput href="#i_Age"/>
      </semantic:informationRequirement>
      <semantic:informationRequirement>
         <semantic:requiredInput href="#i_Years_of_Service"/>
      </semantic:informationRequirement>
      <semantic:decisionTable hitPolicy="COLLECT" aggregation="MAX">
         <semantic:input id="d_Extra_days_case_2_dt_i_age" label="Age">
            <semantic:inputExpression typeRef="number">
               <semantic:text>Age</semantic:text>
            </semantic:inputExpression>
         </semantic:input>
         <semantic:input id="d_Extra_days_case_2_dt_i_years" label="Years of Service">
            <semantic:inputExpression typeRef="number">
               <semantic:text>Years of Service</semantic:text>
            </semantic:inputExpression>
         </semantic:input>
         <semantic:output id="d_Extra_days_case_2_dt_o" label="Extra days">
            <semantic:defaultOutputEntry>
               <semantic:text>0</semantic:text>
            </semantic:defaultOutputEntry>
         </semantic:output>
         <semantic:rule id="d_Extra_days_case_2_dt_r1">
            <semantic:inputEntry id="d_Extra_days_case_2_dt_r1_i1">
               <semantic:text>-</semantic:text>
            </semantic:inputEntry>
            <semantic:inputEntry id="d_Extra_days_case_2_dt_r1_i2">
               <semantic:text>&gt;=30</semantic:text>
            </semantic:inputEntry>
            <semantic:outputEntry id="d_Extra_days_case_2_dt_r1_o1">
               <semantic:text>3</semantic:text>
            </semantic:outputEntry>
         </semantic:rule>
         <semantic:rule id="d_Extra_days_case_2_dt_r2">
            <semantic:inputEntry id="d_Extra_days_case_2_dt_r2_i1">
               <semantic:text>&gt;=60</semantic:text>
            </semantic:inputEntry>
            <semantic:inputEntry id="d_Extra_days_case_2_dt_r2_i2">
               <semantic:text>-</semantic:text>
            </semantic:inputEntry>
            <semantic:outputEntry id="d_Extra_days_case_2_dt_r2_o1">
               <semantic:text>3</semantic:text>
            </semantic:outputEntry>
         </semantic:rule>
      </semantic:decisionTable>
   </semantic:decision>
   <semantic:decision name="Extra days case 3" id="d_Extra_days_case_3">
      <semantic:variable name="Extra days case 3" typeRef="number"/>
      <semantic:informationRequirement>
         <semantic:requiredInput href="#i_Age"/>
      </semantic:informationRequirement>
      <semantic:informationRequirement>
         <semantic:requiredInput href="#i_Years_of_Service"/>
      </semantic:informationRequirement>
      <semantic:decisionTable hitPolicy="COLLECT" aggregation="MAX">
         <semantic:input id="d_Extra_days_case_3_dt_i_age" label="Age">
            <semantic:inputExpression typeRef="number">
               <semantic:text>Age</semantic:text>
            </semantic:inputExpression>
         </semantic:input>
         <semantic:input id="d_Extra_days_case_3_dt_i_years" label="Years of Service">
            <semantic:inputExpression typeRef="number">
               <semantic:text>Years of Service</semantic:text>
            </semantic:inputExpression>
         </semantic:input>
         <semantic:output id="d_Extra_days_case_3_dt_o" label="Extra days">
            <semantic:defaultOutputEntry>
               <semantic:text>0</semantic:text>
            </semantic:defaultOutputEntry>
         </semantic:output>
         <semantic:rule id="d_Extra_days_case_3_dt_r1">
            <semantic:inputEntry id="d_Extra_days_case_3_dt_r1_i1">
               <semantic:text>-</semantic:text>
            </semantic:inputEntry>
            <semantic:inputEntry id="d_Extra_days_case_3_dt_r1_i2">
               <semantic:text>[15..30)</semantic:text>
            </semantic:inputEntry>
            <semantic:outputEntry id="d_Extra_days_case_3_dt_r1_o1">
               <semantic:text>2</semantic:text>
            </semantic:outputEntry>
         </semantic:rule>
         <semantic:rule id="d_Extra_days_case_3_dt_r2">
            <semantic:inputEntry id="d_Extra_days_case_3_dt_r2_i1">
               <semantic:text>&gt;=45</semantic:text>
            </semantic:inputEntry>
            <semantic:inputEntry id="d_Extra_days_case_3_dt_r2_i2">
               <semantic:text>-</semantic:text>
            </semantic:inputEntry>
            <semantic:outputEntry id="d_Extra_days_case_3_dt_r2_o1">
               <semantic:text>2</semantic:text>
            </semantic:outputEntry>
         </semantic:rule>
      </semantic:decisionTable>
   </semantic:decision>
   <semantic:decision id="d_Base_Vacation_Days" name="Base Vacation Days">
      <semantic:variable name="Base Vacation Days" typeRef="number"/>
      <semantic:literalExpression>
         <semantic:text>22</semantic:text>
      </semantic:literalExpression>
   </semantic:decision>
</semantic:definitions>
