> ## 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.

# Required Rule

**Can be used with**: [Task](/reference/cmmn11/tasks), [Stage](/reference/cmmn11/grouping-tasks/stage) and [Milestone](/reference/cmmn11/milestone)

<img src="https://mintcdn.com/aseeflow/OpLRJy6TPnBLn55c/img/short-codes/cmmn-marker-required.png?fit=max&auto=format&n=OpLRJy6TPnBLn55c&q=85&s=82065b5a36595d25d5efa353d4c81e2a" alt="" width="21" height="27" data-path="img/short-codes/cmmn-marker-required.png" />

A plan item may be *required*, meaning that it has to reach an end-like state before the containing stage can complete. Whether a plan item is required can be specified by a *required rule*.

This rule is evaluated when the milestone, stage or task is instantiated and transitions to the state `AVAILABLE`, and its result value of type `boolean` is maintained throughout the remainder of the case instance. If this rule evaluates to `true`, the plan item's parent stage instance must not transition to `COMPLETED` state unless the plan item is in the `COMPLETED`, `TERMINATED` or `DISABLED` state. For example, a task that has not yet been worked on, i.e., is in state `ENABLED`, prevents its containing stage to complete. If the rule is not present, then it is considered to be `false`.

```xml theme={null}
<planItem id="PlanItem_HumanTask_1" definitionRef="HumanTask_1">
  <itemControl>
    <requiredRule>
      <condition>${true}</condition>
    </requiredRule>
  </itemControl>
</planItem>

<humanTask id="HumanTask_1">

</humanTask>
```

The specified expression `${true}` evaluates to the boolean value `true` and means that the plan item is required.

For a plan item definition, the following XML can be used:

```xml theme={null}
<planItem id="PlanItem_HumanTask_1" definitionRef="HumanTask_1"/>

<humanTask id="HumanTask_1">
  <defaultControl>
    <requiredRule>
      <condition>${true}</condition>
    </requiredRule>
  </defaultControl>
</humanTask>
```

The rule specified in the `humanTask` element is valid and individually evaluated for all plan items that reference it, here `PlanItem_HumanTask_1`.

As with any expression, you can use case variables to determine the result of a required rule. The following snippet expresses that the plan item is required when a variable `var` has a value greater than 100:

```xml theme={null}
<requiredRule>
  <condition>${var > 100}</condition>
</requiredRule>
```
