Skip to content

Instantly share code, notes, and snippets.

@r00ta
Last active October 13, 2020 09:19
Show Gist options
  • Save r00ta/5fd31536a628805d1ba698db76912ae7 to your computer and use it in GitHub Desktop.
Save r00ta/5fd31536a628805d1ba698db76912ae7 to your computer and use it in GitHub Desktop.
<dmn:definitions xmlns:dmn="http://www.omg.org/spec/DMN/20180521/MODEL/" xmlns="https://github.com/kiegroup/kogito-examples/dmn-quarkus-listener-example" xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/" xmlns:kie="http://www.drools.org/kie/dmn/1.2" xmlns:dmndi="http://www.omg.org/spec/DMN/20180521/DMNDI/" xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/" xmlns:feel="http://www.omg.org/spec/DMN/20180521/FEEL/" id="_DC5AB7D9-7D61-40F7-94C1-2E064A053AC0" name="LoanEligibility" typeLanguage="http://www.omg.org/spec/DMN/20180521/FEEL/" namespace="https://github.com/kiegroup/kogito-examples/dmn-quarkus-listener-example">
<dmn:extensionElements/>
<dmn:itemDefinition id="_AD041308-CE7E-4359-97DA-E03C520A7A70" name="tClient" isCollection="false">
<dmn:itemComponent id="_91AB76A9-CDCC-463E-B404-C530AB0AA6B5" name="age" isCollection="false">
<dmn:typeRef>number</dmn:typeRef>
<dmn:allowedValues kie:constraintType="range" id="_4B686261-D292-4719-BCD7-4122528082CE">
<dmn:text>[18..80]</dmn:text>
</dmn:allowedValues>
</dmn:itemComponent>
</dmn:itemDefinition>
<dmn:itemDefinition id="_D88AFBD5-4920-49E6-BE27-1A43179E51EA" name="tLoan" isCollection="false">
<dmn:itemComponent id="_3FECD32E-06B7-4D31-B25D-DA4CCBCFCB6C" name="duration" isCollection="false">
<dmn:typeRef>number</dmn:typeRef>
<dmn:allowedValues kie:constraintType="expression" id="_124C0712-A0CB-4988-A225-8BBC57AA5963">
<dmn:text>&gt; 0</dmn:text>
</dmn:allowedValues>
</dmn:itemComponent>
<dmn:itemComponent id="_54CF2415-8CFA-4EAE-9482-F03C4355F218" name="installment" isCollection="false">
<dmn:typeRef>number</dmn:typeRef>
<dmn:allowedValues kie:constraintType="expression" id="_9B214CD8-4B23-4BD5-8A22-F0D22C2713A6">
<dmn:text>&gt; 0</dmn:text>
</dmn:allowedValues>
</dmn:itemComponent>
</dmn:itemDefinition>
<dmn:itemDefinition id="_01577ED6-3DBD-4ABE-9BA0-40D76C2B4E68" name="tFinancialSituation" isCollection="false">
<dmn:itemComponent id="_D1F07062-F112-4255-B415-C9228A9BDC39" name="existing payments" isCollection="false">
<dmn:typeRef>number</dmn:typeRef>
<dmn:allowedValues kie:constraintType="expression" id="_E8FC5152-E0A3-4FE7-9DD4-CB90A0926C50">
<dmn:text>&gt;= 0</dmn:text>
</dmn:allowedValues>
</dmn:itemComponent>
<dmn:itemComponent id="_5F85051D-A38B-48CA-B2BB-01C43AA00184" name="monthlyIncome" isCollection="false">
<dmn:typeRef>number</dmn:typeRef>
<dmn:allowedValues kie:constraintType="expression" id="_A1B477B6-EE9A-4295-ABEA-BD18CEBAAC9F">
<dmn:text>&gt;=0
</dmn:text>
</dmn:allowedValues>
</dmn:itemComponent>
<dmn:itemComponent id="_691741B2-D3B5-4973-B3DE-86F7DE317C45" name="employed" isCollection="false">
<dmn:typeRef>boolean</dmn:typeRef>
</dmn:itemComponent>
</dmn:itemDefinition>
<dmn:inputData id="_94A72ABB-E455-4F5C-A254-DB4B6D291944" name="Client">
<dmn:extensionElements/>
<dmn:variable id="_2200B3CC-EF45-40A1-9B29-C4EC77B211C3" name="Client" typeRef="tClient"/>
</dmn:inputData>
<dmn:inputData id="_A6007998-6106-493C-8728-E1986304B7FC" name="Loan">
<dmn:extensionElements/>
<dmn:variable id="_8ACB289B-4BCF-4B6D-B0C4-1DE4390CE4B7" name="Loan" typeRef="tLoan"/>
</dmn:inputData>
<dmn:decision id="_AF3816EA-29BE-417F-A83F-D77A74719369" name="Eligibility">
<dmn:extensionElements/>
<dmn:question>Is the client eligible for the loan?</dmn:question>
<dmn:allowedAnswers>"Yes" "No"</dmn:allowedAnswers>
<dmn:variable id="_51474B96-4904-4A5F-911C-C7803178BC31" name="Eligibility" typeRef="boolean"/>
<dmn:informationRequirement id="_3D11E284-712F-4E06-B3B1-E5A9B92999D5">
<dmn:requiredInput href="#_94A72ABB-E455-4F5C-A254-DB4B6D291944"/>
</dmn:informationRequirement>
<dmn:informationRequirement id="_415EBA81-5FDF-45D5-8783-CB97C0485672">
<dmn:requiredInput href="#_A6007998-6106-493C-8728-E1986304B7FC"/>
</dmn:informationRequirement>
<dmn:informationRequirement id="_F7C569BA-2AD3-4639-9831-E022F36B4985">
<dmn:requiredDecision href="#_55EF1E21-B94B-462D-83AA-E7CC0621AD37"/>
</dmn:informationRequirement>
<dmn:decisionTable id="_98FE50CB-F4CC-45BB-A7F4-58D97A14A957" hitPolicy="FIRST" preferredOrientation="Rule-as-Row">
<dmn:input id="_CDF02DAD-5492-4BF6-B275-9DD55D1C14C6">
<dmn:inputExpression id="_336FE6B0-8A50-4B62-B17A-E851FC1B13CD" typeRef="boolean">
<dmn:text>Credit Check</dmn:text>
</dmn:inputExpression>
</dmn:input>
<dmn:input id="_BA521F15-CED4-4B69-A163-E41684519129">
<dmn:inputExpression id="_FDF9C754-1ACD-4808-8364-50A2D03D3E49" typeRef="number">
<dmn:text>Client.age + (Loan.duration/12)</dmn:text>
</dmn:inputExpression>
</dmn:input>
<dmn:output id="_6919B10D-0B12-4B5E-9DF5-1A90F166CF9A">
<dmn:defaultOutputEntry id="_F19ECF67-98FC-4041-B8A0-E1A39C2BD0D9">
<dmn:text>"No"</dmn:text>
</dmn:defaultOutputEntry>
</dmn:output>
<dmn:annotation name=""/>
<dmn:rule id="_CE3825FE-A003-43F7-B124-FA360BD8CFB8">
<dmn:inputEntry id="_6FE7CEAC-E5FF-4298-9575-BF93CFE47E47">
<dmn:text>true</dmn:text>
</dmn:inputEntry>
<dmn:inputEntry id="_20AC69B3-B16F-483B-9F04-C55F6809AA80">
<dmn:text>&lt;= 80</dmn:text>
</dmn:inputEntry>
<dmn:outputEntry id="_E8F9174B-0F91-4F18-9A24-DEEE48FEB1B2">
<dmn:text>true
</dmn:text>
</dmn:outputEntry>
<dmn:annotationEntry>
<dmn:text/>
</dmn:annotationEntry>
</dmn:rule>
<dmn:rule id="_30A82FBE-4839-4CCD-81D7-E6143B5C266C">
<dmn:inputEntry id="_6AD0971D-18F5-402A-8F90-63A4F0AF50B6">
<dmn:text>false</dmn:text>
</dmn:inputEntry>
<dmn:inputEntry id="_FC38A913-9135-41A4-A209-B07C84F485A9">
<dmn:text>-</dmn:text>
</dmn:inputEntry>
<dmn:outputEntry id="_22C51C0E-A741-4BF2-828C-7CAAB5B3309A">
<dmn:text>false</dmn:text>
</dmn:outputEntry>
<dmn:annotationEntry>
<dmn:text/>
</dmn:annotationEntry>
</dmn:rule>
<dmn:rule id="_C6CF6BDC-F37C-4872-AB1F-5E4D73928CE9">
<dmn:inputEntry id="_9945555B-FF51-4649-82D1-37094056F3A7">
<dmn:text>-</dmn:text>
</dmn:inputEntry>
<dmn:inputEntry id="_B51FF86E-C424-44D5-BE92-0E67857B0FEB">
<dmn:text>-</dmn:text>
</dmn:inputEntry>
<dmn:outputEntry id="_66D8A173-F2AD-439A-9229-91122DCA9F54">
<dmn:text>false</dmn:text>
</dmn:outputEntry>
<dmn:annotationEntry>
<dmn:text/>
</dmn:annotationEntry>
</dmn:rule>
</dmn:decisionTable>
</dmn:decision>
<dmn:decision id="_55EF1E21-B94B-462D-83AA-E7CC0621AD37" name="Credit Check">
<dmn:extensionElements/>
<dmn:variable id="_5FF9B899-6BDE-4F86-90DB-D32A1CD70E88" name="Credit Check" typeRef="boolean"/>
<dmn:informationRequirement id="_D5D50A4E-9CB5-4EDA-8C7E-7D7413F6AC07">
<dmn:requiredInput href="#_348DC0EA-98BF-4529-BD70-13EDCC052BEF"/>
</dmn:informationRequirement>
<dmn:informationRequirement id="_7868C48F-7F70-4A8B-A8C1-A01DE4C74BB5">
<dmn:requiredInput href="#_A6007998-6106-493C-8728-E1986304B7FC"/>
</dmn:informationRequirement>
<dmn:decisionTable id="_61BBF19E-7D6F-4ED5-9916-66937C7DA9C8" hitPolicy="FIRST" preferredOrientation="Rule-as-Row">
<dmn:input id="_B0D7F07F-7008-49FF-8E16-FF93056EAC32">
<dmn:inputExpression id="_218858CA-8818-42B4-B591-EAA44DECAE1F" typeRef="boolean">
<dmn:text>FinancialSituation.employed</dmn:text>
</dmn:inputExpression>
</dmn:input>
<dmn:input id="_B6770FC2-C5F8-4A00-A22E-F675FBB3FA18">
<dmn:inputExpression id="_6FB143E9-32E2-48C8-BBA6-6BDDB0351AA1" typeRef="number">
<dmn:text>((FinancialSituation.existing payments + Loan.installment) / Loan.duration) / FinancialSituation.monthlyIncome</dmn:text>
</dmn:inputExpression>
</dmn:input>
<dmn:input id="_BF55BEF9-B36D-4B7C-8DF5-CA57E33BDEAD">
<dmn:inputExpression id="_331F5571-C572-44D3-B997-BACF56A66156" typeRef="number">
<dmn:text>Loan.duration</dmn:text>
</dmn:inputExpression>
</dmn:input>
<dmn:output id="_7BE4EEC0-147F-4D57-9E9A-FECF41FC87D1"/>
<dmn:annotation name="annotation-1"/>
<dmn:rule id="_0EECB646-0DA7-49C5-A0CE-F619C4B2CE1A">
<dmn:inputEntry id="_434CFADA-CAD2-4DA5-A20A-5A482E8BE07A">
<dmn:text>true</dmn:text>
</dmn:inputEntry>
<dmn:inputEntry id="_12BD8D8D-3F3A-418B-A23D-BC8A4AB14D92">
<dmn:text>&lt;= 0.4</dmn:text>
</dmn:inputEntry>
<dmn:inputEntry id="_5DE71874-6B11-4591-B3D6-90B42F40DCD7">
<dmn:text>&lt;= 120</dmn:text>
</dmn:inputEntry>
<dmn:outputEntry id="_B532A673-41A8-4A5B-AFE0-9753DE1A822F">
<dmn:text>true</dmn:text>
</dmn:outputEntry>
<dmn:annotationEntry>
<dmn:text/>
</dmn:annotationEntry>
</dmn:rule>
<dmn:rule id="_79EA0CFF-3A51-4975-9420-C0CDB335AF47">
<dmn:inputEntry id="_53E71652-F6AA-44DF-92A9-C3690C39E31E">
<dmn:text>false</dmn:text>
</dmn:inputEntry>
<dmn:inputEntry id="_C533DB56-8D53-43E0-8566-747D66651864">
<dmn:text>&lt;= 0.3</dmn:text>
</dmn:inputEntry>
<dmn:inputEntry id="_03E018BD-BF13-4EFF-A4BA-ADF420495E91">
<dmn:text>&lt;= 120</dmn:text>
</dmn:inputEntry>
<dmn:outputEntry id="_F75D0BAF-9472-49B3-AA9A-141BB3032E71">
<dmn:text>true</dmn:text>
</dmn:outputEntry>
<dmn:annotationEntry>
<dmn:text/>
</dmn:annotationEntry>
</dmn:rule>
<dmn:rule id="_1D82C437-611C-4F9A-B8C9-B4124634C90C">
<dmn:inputEntry id="_1570E4DD-934A-4CF1-9323-FFD6769EB98A">
<dmn:text>true</dmn:text>
</dmn:inputEntry>
<dmn:inputEntry id="_E1D77FEA-F129-4795-9ADE-39E80C322DC3">
<dmn:text>&lt;= 0.3</dmn:text>
</dmn:inputEntry>
<dmn:inputEntry id="_0600751D-912C-4268-B36F-8D18B365C8B9">
<dmn:text>&gt; 120</dmn:text>
</dmn:inputEntry>
<dmn:outputEntry id="_CFA293D2-3978-492C-A72A-162947927783">
<dmn:text>true</dmn:text>
</dmn:outputEntry>
<dmn:annotationEntry>
<dmn:text/>
</dmn:annotationEntry>
</dmn:rule>
<dmn:rule id="_173F6838-1FB1-400D-8CC5-3E6F01B27B45">
<dmn:inputEntry id="_AA91203B-1E54-4A49-AE0D-B82BCB4D30B9">
<dmn:text>false</dmn:text>
</dmn:inputEntry>
<dmn:inputEntry id="_F7D81E0B-45F3-4E33-9746-1F9B709B9056">
<dmn:text>&lt;= 0.1</dmn:text>
</dmn:inputEntry>
<dmn:inputEntry id="_255E3D6A-6A88-48C9-8F9D-ED8117B7CF49">
<dmn:text>&gt; 120</dmn:text>
</dmn:inputEntry>
<dmn:outputEntry id="_61A6851F-9E91-4F7F-9603-9E03E83FBE10">
<dmn:text>true</dmn:text>
</dmn:outputEntry>
<dmn:annotationEntry>
<dmn:text/>
</dmn:annotationEntry>
</dmn:rule>
<dmn:rule id="_7D57397B-FF6F-44BD-BA70-64B0983A1DF2">
<dmn:inputEntry id="_693BA49E-EE91-42B2-8B31-67EC3D044EE3">
<dmn:text>-</dmn:text>
</dmn:inputEntry>
<dmn:inputEntry id="_62273335-880E-4856-9889-78C86B4B589C">
<dmn:text>-</dmn:text>
</dmn:inputEntry>
<dmn:inputEntry id="_C1AF9551-62F3-469D-B698-8363AD658AEB">
<dmn:text>-</dmn:text>
</dmn:inputEntry>
<dmn:outputEntry id="_B7E1328B-AB57-4695-AEED-6EA0C7F5A378">
<dmn:text>false</dmn:text>
</dmn:outputEntry>
<dmn:annotationEntry>
<dmn:text/>
</dmn:annotationEntry>
</dmn:rule>
</dmn:decisionTable>
</dmn:decision>
<dmn:inputData id="_348DC0EA-98BF-4529-BD70-13EDCC052BEF" name="FinancialSituation">
<dmn:extensionElements/>
<dmn:variable id="_42DB3D7C-D4BB-4345-A841-45308BE15955" name="FinancialSituation" typeRef="tFinancialSituation"/>
</dmn:inputData>
<dmndi:DMNDI>
<dmndi:DMNDiagram id="_58F740EA-35D4-47BE-A02E-9C70F93D2646" name="DRG">
<di:extension>
<kie:ComponentsWidthsExtension>
<kie:ComponentWidths dmnElementRef="_98FE50CB-F4CC-45BB-A7F4-58D97A14A957">
<kie:width>50</kie:width>
<kie:width>100</kie:width>
<kie:width>451</kie:width>
<kie:width>100</kie:width>
<kie:width>100</kie:width>
</kie:ComponentWidths>
<kie:ComponentWidths dmnElementRef="_61BBF19E-7D6F-4ED5-9916-66937C7DA9C8">
<kie:width>50</kie:width>
<kie:width>229</kie:width>
<kie:width>475</kie:width>
<kie:width>500</kie:width>
<kie:width>170</kie:width>
<kie:width>100</kie:width>
</kie:ComponentWidths>
</kie:ComponentsWidthsExtension>
</di:extension>
<dmndi:DMNShape id="dmnshape-drg-_94A72ABB-E455-4F5C-A254-DB4B6D291944" dmnElementRef="_94A72ABB-E455-4F5C-A254-DB4B6D291944" isCollapsed="false">
<dmndi:DMNStyle>
<dmndi:FillColor red="255" green="255" blue="255"/>
<dmndi:StrokeColor red="0" green="0" blue="0"/>
<dmndi:FontColor red="0" green="0" blue="0"/>
</dmndi:DMNStyle>
<dc:Bounds x="739" y="218" width="100" height="50"/>
<dmndi:DMNLabel/>
</dmndi:DMNShape>
<dmndi:DMNShape id="dmnshape-drg-_A6007998-6106-493C-8728-E1986304B7FC" dmnElementRef="_A6007998-6106-493C-8728-E1986304B7FC" isCollapsed="false">
<dmndi:DMNStyle>
<dmndi:FillColor red="255" green="255" blue="255"/>
<dmndi:StrokeColor red="0" green="0" blue="0"/>
<dmndi:FontColor red="0" green="0" blue="0"/>
</dmndi:DMNStyle>
<dc:Bounds x="607.2990654205607" y="377" width="100" height="50"/>
<dmndi:DMNLabel/>
</dmndi:DMNShape>
<dmndi:DMNShape id="dmnshape-drg-_AF3816EA-29BE-417F-A83F-D77A74719369" dmnElementRef="_AF3816EA-29BE-417F-A83F-D77A74719369" isCollapsed="false">
<dmndi:DMNStyle>
<dmndi:FillColor red="255" green="255" blue="255"/>
<dmndi:StrokeColor red="0" green="0" blue="0"/>
<dmndi:FontColor red="0" green="0" blue="0"/>
</dmndi:DMNStyle>
<dc:Bounds x="607" y="74" width="100" height="50"/>
<dmndi:DMNLabel/>
</dmndi:DMNShape>
<dmndi:DMNShape id="dmnshape-drg-_55EF1E21-B94B-462D-83AA-E7CC0621AD37" dmnElementRef="_55EF1E21-B94B-462D-83AA-E7CC0621AD37" isCollapsed="false">
<dmndi:DMNStyle>
<dmndi:FillColor red="255" green="255" blue="255"/>
<dmndi:StrokeColor red="0" green="0" blue="0"/>
<dmndi:FontColor red="0" green="0" blue="0"/>
</dmndi:DMNStyle>
<dc:Bounds x="398.5" y="217" width="149" height="54"/>
<dmndi:DMNLabel/>
</dmndi:DMNShape>
<dmndi:DMNShape id="dmnshape-drg-_348DC0EA-98BF-4529-BD70-13EDCC052BEF" dmnElementRef="_348DC0EA-98BF-4529-BD70-13EDCC052BEF" isCollapsed="false">
<dmndi:DMNStyle>
<dmndi:FillColor red="255" green="255" blue="255"/>
<dmndi:StrokeColor red="0" green="0" blue="0"/>
<dmndi:FontColor red="0" green="0" blue="0"/>
</dmndi:DMNStyle>
<dc:Bounds x="281" y="377" width="140" height="51"/>
<dmndi:DMNLabel/>
</dmndi:DMNShape>
<dmndi:DMNEdge id="dmnedge-drg-_3D11E284-712F-4E06-B3B1-E5A9B92999D5" dmnElementRef="_3D11E284-712F-4E06-B3B1-E5A9B92999D5">
<di:waypoint x="789" y="218"/>
<di:waypoint x="657" y="124"/>
</dmndi:DMNEdge>
<dmndi:DMNEdge id="dmnedge-drg-_415EBA81-5FDF-45D5-8783-CB97C0485672" dmnElementRef="_415EBA81-5FDF-45D5-8783-CB97C0485672">
<di:waypoint x="657.2990654205607" y="377"/>
<di:waypoint x="657" y="124"/>
</dmndi:DMNEdge>
<dmndi:DMNEdge id="dmnedge-drg-_F7C569BA-2AD3-4639-9831-E022F36B4985" dmnElementRef="_F7C569BA-2AD3-4639-9831-E022F36B4985">
<di:waypoint x="473" y="244"/>
<di:waypoint x="657" y="124"/>
</dmndi:DMNEdge>
<dmndi:DMNEdge id="dmnedge-drg-_D5D50A4E-9CB5-4EDA-8C7E-7D7413F6AC07" dmnElementRef="_D5D50A4E-9CB5-4EDA-8C7E-7D7413F6AC07">
<di:waypoint x="351" y="402.5"/>
<di:waypoint x="473" y="271"/>
</dmndi:DMNEdge>
<dmndi:DMNEdge id="dmnedge-drg-_7868C48F-7F70-4A8B-A8C1-A01DE4C74BB5" dmnElementRef="_7868C48F-7F70-4A8B-A8C1-A01DE4C74BB5">
<di:waypoint x="657.2990654205607" y="402"/>
<di:waypoint x="473" y="271"/>
</dmndi:DMNEdge>
</dmndi:DMNDiagram>
</dmndi:DMNDI>
</dmn:definitions>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment