【问题标题】:How to define Decison table in DMN如何在 DMN 中定义决策表
【发布时间】:2021-12-14 05:49:11
【问题描述】:

如何在 DMN 设计器中定义决策表,

这是标准决定之一:如果索赔金额 >10000 则 hradmin 批准 =Y 否则 hradmin 批准 =N

【问题讨论】:

    标签: camunda business-process-management dmn


    【解决方案1】:

    您可以将 xml 保存到文本文件中,上传,尝试并在此处修改:https://consulting.camunda.com/dmn-simulator/

    <?xml version="1.0" encoding="UTF-8"?>
    <definitions xmlns="https://www.omg.org/spec/DMN/20191111/MODEL/" xmlns:dmndi="https://www.omg.org/spec/DMN/20191111/DMNDI/" xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/" xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/" xmlns:camunda="http://camunda.org/schema/1.0/dmn" id="dinnerDecisions" name="HR Approval Decision" namespace="http://camunda.org/schema/1.0/dmn" exporter="Camunda Modeler" exporterVersion="4.0.0">
      <decision id="beverages" name="HR Approval">
        <informationRequirement id="InformationRequirement_1xvojck">
          <requiredInput href="#InputData_0pgvdj9" />
        </informationRequirement>
        <decisionTable id="DecisionTable_07q05jb">
          <input id="InputClause_0bo3uen" label="Amount" camunda:inputVariable="">
            <inputExpression id="LiteralExpression_0d6l79o" typeRef="integer">
              <text>amount</text>
            </inputExpression>
          </input>
          <output id="OuputClause_99999" label="HR Approval" name="hrApproval" typeRef="boolean" />
          <rule id="row-506282952-7">
            <description></description>
            <inputEntry id="UnaryTests_0jb8hau">
              <text>&gt;10000</text>
            </inputEntry>
            <outputEntry id="LiteralExpression_1kr45vj">
              <text>true</text>
            </outputEntry>
          </rule>
          <rule id="DecisionRule_05oqdbw">
            <description></description>
            <inputEntry id="UnaryTests_1vcdz6c">
              <text>&lt;=10000</text>
            </inputEntry>
            <outputEntry id="LiteralExpression_0g5cscd">
              <text>false</text>
            </outputEntry>
          </rule>
        </decisionTable>
      </decision>
      <inputData id="InputData_0pgvdj9" name="Amount" />
      <dmndi:DMNDI>
        <dmndi:DMNDiagram id="DMNDiagram_0i21c0s">
          <dmndi:DMNShape id="DMNShape_0a1lk6d" dmnElementRef="beverages">
            <dc:Bounds height="80" width="180" x="430" y="130" />
          </dmndi:DMNShape>
          <dmndi:DMNEdge id="DMNEdge_1czaglz" dmnElementRef="InformationRequirement_1xvojck">
            <di:waypoint x="500" y="287" />
            <di:waypoint x="520" y="230" />
            <di:waypoint x="520" y="210" />
          </dmndi:DMNEdge>
          <dmndi:DMNShape id="DMNShape_0aea4xy" dmnElementRef="InputData_0pgvdj9">
            <dc:Bounds height="45" width="125" x="437" y="287" />
          </dmndi:DMNShape>
        </dmndi:DMNDiagram>
      </dmndi:DMNDI>
    </definitions>
    

    【讨论】:

      【解决方案2】:

      在 DMN 中,

      DMN 设计器中的决策表使得 [...] 如果索赔金额 >10000 则 hradmin 批准 =Y 否则 hradmin 批准 =N

      对于 1 个名为 claim amount 的 InputData 和 1 个名为 hradmin approval 的表的决策,可以建模为以下 DRG:

      hradmin approval 决策表可以定义如下:

      屏幕截图还显示了示例数据,符合您的原始要求。

      您可以在此处下载 .dmn 示例:https://kiegroup.github.io/kogito-online/?file=https://gist.githubusercontent.com/tarilabs/f9655e2f8a2c4253e66ce661e5c79879/raw/so69764028.dmn#/editor/dmn

      【讨论】:

      • 我现在才注意到,这个问题有一个特定供应商的标签,但不清楚它是否与任何供应商特定的功能有关。无论如何,我提供的答案是纯粹基于 DMN,因此它应该在任何支持 DMN 的平台上以相同或类似的方式工作。希望对您有所帮助!
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-11-19
      • 2022-09-24
      • 1970-01-01
      • 1970-01-01
      • 2018-10-13
      • 1970-01-01
      • 2021-11-28
      相关资源
      最近更新 更多