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 decisionTable
XML 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.
<input id="input1" label="Season">
<inputExpression id="inputExpression1" typeRef="string">
<text>season</text>
</inputExpression>
</input>
Input Label
An input label is a short description of the input. It is set on the input
XML 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.
<input id="input1" label="Season">
<text>season</text>
</input>
Input Type Definition
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 .
<input id="input1" label="Season">
<inputExpression id="inputExpression1" typeRef="string" expressionLanguage="groovy">
<text>season</text>
</inputExpression>
</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.
name="definitions"
xmlns="http://www.omg.org/spec/DMN/20151101/dmn.xsd"
namespace="http://camunda.org/schema/1.0/dmn">
<decision id="dish" name="Dish">
<decisionTable id="decisionTable">
<input id="input1"
label="Season"
camunda:inputVariable="currentSeason">
<!-- ... -->
</input>
<!-- ... -->
</decisionTable>
</decision>
The variable can be used in an expression of an . For example, theJUEL expression checks if the season input is not"Fall"
.