> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aseeflow.org/llms.txt
> Use this file to discover all available pages before exploring further.

# DMN Decision Literal Expression

<img src="https://mintcdn.com/aseeflow/EOmYJq0E21aelwRy/reference/dmn/decision-literal-expression/img/decision-literal-expression.png?fit=max&auto=format&n=EOmYJq0E21aelwRy&q=85&s=d6fe6e66924be07ed0fd48a7cb1eb535" alt="Decision Literal Expression" width="499" height="276" data-path="reference/dmn/decision-literal-expression/img/decision-literal-expression.png" />

A decision literal expression represents decision logic which can be depicted as an expression in DMN 1.3.
It consists of a [literal expression] and a [variable].

A decision literal expression is represented by a `literalExpression` element inside a `decision` XML element.

```xml theme={null}
<definitions xmlns="https://www.omg.org/spec/DMN/20191111/MODEL/" id="definitions" name="definitions" namespace="http://camunda.org/schema/1.0/dmn">
  <decision id="season" name="Season">
    <variable name="season" typeRef="string" />
    <literalExpression>
      <text>calendar.getSeason(date)</text>
    </literalExpression>
  </decision>
</definitions>
```

## Decision Name

<img src="https://mintcdn.com/aseeflow/EOmYJq0E21aelwRy/reference/dmn/decision-literal-expression/img/decision-name.png?fit=max&auto=format&n=EOmYJq0E21aelwRy&q=85&s=94822ba648bd710f37f447a6e9d6a832" alt="Decision Name" width="1100" height="548" data-path="reference/dmn/decision-literal-expression/img/decision-name.png" />

The name describes the decision for which the literal expression provides the
decision logic. It is set as the `name` attribute on the `decision` element.

```xml theme={null}
<decision id="season" name="Season">
    <!-- ... -->
</decision>
```

## Decision Id

<img src="https://mintcdn.com/aseeflow/EOmYJq0E21aelwRy/reference/dmn/decision-literal-expression/img/decision-id.png?fit=max&auto=format&n=EOmYJq0E21aelwRy&q=85&s=b48577a2b373ea24326f3e5c0eae8b1a" alt="Decision Id" width="1100" height="546" data-path="reference/dmn/decision-literal-expression/img/decision-id.png" />

The id is the technical identifier of the decision. It is set in the `id`
attribute on the `decision` element.

Each decision should have an unique id when it is [deployed] to ASEE Flow.
The engine uses the id as the decision key of the deployed
`DecisionDefinition`.

```xml theme={null}
<decision id="season" name="Season">
    <!-- ... -->
</decision>
```

## Literal Expression

The literal expression specifies how the value of the decision is generated. It is an expression which will be evaluated by the DMN engine.
It can be used to do a complex calculation, to invoke a bean which provides decision logic, or to combine the output values of [required decisions].

The expression is set inside a `text` element that is a child of the `literalExpression` XML element.

```xml theme={null}
<literalExpression>
  <text>calendar.getSeason(date)</text>
</literalExpression>
```

### Literal Expression Language

The expression language of the literal expression can be specified by the
`expressionLanguage` attribute on the `literalExpression` XML element. The
supported expression languages are listed in the [User Guide][supported EL].

```xml theme={null}
<literalExpression expressionLanguage="groovy">
  <text>calendar.getSeason(date)</text>
</literalExpression>
```

If no expression language is set then the global expression language is used
which is set on the `definitions` XML element.

```xml theme={null}
<definitions id="definitions"
             name="definitions"
             xmlns="https://www.omg.org/spec/DMN/20191111/MODEL/"
             expressionLanguage="groovy"
             namespace="http://camunda.org/schema/1.0/dmn">
  <!-- ... -->
</definitions>
```

In case no global expression language is set, the default expression language
is used instead. The default expression language for literal expressions is JUEL.
Please refer to the [User Guide][default EL] to read more about expression
languages.

## Variable

A decision literal expression must have a variable which specifies the name and the type of the decision result.
A variable is represented by a `variable` element inside a `decision` XML element.

```xml theme={null}
<decision id="season" name="Season">
  <variable name="season" />
</decision>
```

### Variable Name

The name of the variable is used to reference the value of the literal expression in the decision result.
It is specified by the `name` attribute on the `variable` XML element.

```xml theme={null}
<variable name="season" />
```

### Variable Type Definition

The type of the decision result can be specified by the `typeRef` attribute on the
`variable` XML element. After the expression is evaluated by the
DMN engine it converts the result to the specified type. The supported types
are listed in the [User Guide][supported DT].

```xml theme={null}
<variable name="season" typeRef="string" />
```

Note that the type is not required but recommended since it provides a type
safety of the expression result.

[literal expression]: /reference/dmn/decision-literal-expression#literal-expression

[variable]: /reference/dmn/decision-literal-expression#variable

[supported EL]: /user-guide/dmn-engine/expressions-and-scripts#supported-expression-languages

[default EL]: /user-guide/dmn-engine/expressions-and-scripts#default-expression-languages

[supported DT]: /user-guide/dmn-engine/data-types#supported-data-types

[deployed]: /user-guide/process-engine/decisions/repository

[required decisions]: /reference/dmn/drg#required-decisions
