A decision table can have one or more inputs, also called input clauses. Aninput clause defines the id, label, expression and type of a decision tableinput.

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

Input Id

The input id is a unique identifier of the decision table input. It is used bythe Camunda BPMN platform to reference the input in the history of evaluateddecisions. Therefore, it is required by the Camunda DMN engine. It is set asthe id attribute of the input XML element.

  1. <input id="input1" label="Season">
  2. <inputExpression id="inputExpression1" typeRef="string">
  3. <text>season</text>
  4. </inputExpression>
  5. </input>

Input Label

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

Input Expression

An input expression specifies how the value of the input clause is generated.It is an expression which will be evaluated by the DMN engine. It is usuallysimple and references a variable which is available during the evaluation. Theexpression is set inside a text element that is a child of theinputExpression XML element.

  1. <input id="input1" label="Season">
  2. <text>season</text>
  3. </input>

Input Type Definition

Input - 图1

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

Note that the type is not required but recommended, since it helps to understandthe possible input values and provides a type safety to be aware of unexpectedinput values.

Input Expression Language

The expression language of the input expression can be specified by theexpressionLanguage attribute on the inputExpression XML element. Thesupported expression languages are listed in the .

  1. <input id="input1" label="Season">
  2. <inputExpression id="inputExpression1" typeRef="string" expressionLanguage="groovy">
  3. <text>season</text>
  4. </inputExpression>
  5. </input>

In case no global expression language is set, the default expression languageis used instead. The default expression language for input expressions is JUEL.Please refer to the User Guide to read more about expressionlanguages.

Input Variable Name

When the input expression is evaluated then the return value is stored in a variable.The name of the variable can be specified by the camunda:inputVariable on the input element. By default, thename is cellInput.

To use the attribute you have to define the Camunda DMN namespacexmlns:camunda="http://camunda.org/schema/1.0/dmn in the XML.

  1. name="definitions"
  2. xmlns="http://www.omg.org/spec/DMN/20151101/dmn.xsd"
  3. namespace="http://camunda.org/schema/1.0/dmn">
  4. <decision id="dish" name="Dish">
  5. <decisionTable id="decisionTable">
  6. <input id="input1"
  7. label="Season"
  8. camunda:inputVariable="currentSeason">
  9. <!-- ... -->
  10. </input>
  11. <!-- ... -->
  12. </decisionTable>
  13. </decision>

The variable can be used in an expression of an . For example, theJUEL expression checks if the season input is not"Fall".