5.3. Defining decision states
Prev | 5. Executing actions | Next

## 5.3. Defining decision states

Use the `decision-state` element as an alternative to the action-state to make a routing decision using a convenient if/else syntax. The example below shows the `moreAnswersNeeded` state above now implemented as a decision state instead of an action-state:

    <decision-state id="moreAnswersNeeded">
        <if test="interview.moreAnswersNeeded()" then="answerQuestions" else="finish" />
    </decision-state>

Prev | Up | Next
5.2. Defining action states | Home | 5.4. Action outcome event mappings