Output - 图1

A decision table can have one or more outputs, also called output clauses. Anoutput clause defines the id, label, name and type of a decision table output.

An output clause is represented by an output element inside a decisionTableXML element.

  1. <definitions xmlns="http://www.omg.org/spec/DMN/20151101/dmn.xsd" id="definitions" name="definitions" namespace="http://camunda.org/schema/1.0/dmn">
  2. <decision id="dish" name="Dish">
  3. <decisionTable id="decisionTable">
  4. <!-- ... -->
  5. <output id="output1" label="Dish" name="desiredDish" typeRef="string" />
  6. <!-- ... -->
  7. </decisionTable>
  8. </decision>
  9. </definitions>

Output Id

The output id is a unique identifier of the decision table output. It is usedby the Camunda BPMN platform to reference the output in the history ofevaluated decisions. Therefore, it is required by the Camunda DMN engine. It isset as the id attribute of the output XML element.

  1. <output id="output1" label="Dish" name="desiredDish" typeRef="string" />

Output Label

Output - 图2

An output label is a short description of the output. It is set on the outputXML element in the label attribute. Note that the label is not required butrecommended, since it helps to understand the decision.

  1. <output id="output1" label="Dish" name="desiredDish" typeRef="string" />

Output Name

Output - 图3

The name of the output is used to reference the value of the output in thedecision table result. It is specified by the name attribute on theoutput XML element.

If the decision table has more than one output, then all outputs must have aunique name.

  1. <output id="output1" label="Dish" name="desiredDish" typeRef="string" />

Output Type Definition

Output - 图4

The type of the output clause can be specified by the typeRef attribute on theoutput XML element. After an output entry is evaluated by theDMN engine, it converts the result to the specified type. The supported typesare listed in the User Guide.

  1. <output id="output1" label="Dish" name="desiredDish" typeRef="string" />

Note that the type is not required but recommended, since it provides a typesafety of the output values.

Additionally, the type can be used to transform the output value into anothertype. For example, transform the output value 80% of type String into aDouble using a custom data type.

原文: https://docs.camunda.org/manual/7.9/reference/dmn11/decision-table/output/