# uip maestro case task-entry-conditions

> Syntax and options for `uip maestro case task-entry-conditions get`, which reads the rules that gate when a task becomes runnable in a case management definition JSON file, plus the JSON field reference for hand-editing one.

A **task entry condition** is a named rule set attached to a [task](./uip-maestro-case-tasks.md) that determines when the task becomes eligible to run — for example, only after every other task in the stage has completed, or only after specific named tasks finish. `uip maestro case task-entry-conditions` reads these conditions from a case-definition JSON file.

For the tasks these conditions gate, see [`uip maestro case tasks`](./uip-maestro-case-tasks.md). For the overall Case Management concept model, see [`uip maestro case`](./uip-maestro-case.md).

## Concepts

- **Rule type** — the real, source-validated set is `current-stage-entered`, `selected-tasks-completed`, `wait-for-connector`, `adhoc`, `runs-sequentially`. `selected-tasks-completed` additionally requires a list of task IDs. **Note:** this command's own built-in `--help` example demonstrates `--rule-type all-previous-tasks-completed`, which is not in the validated list above — treat that specific value as a bug in the source's own example, not a valid rule type.

## Synopsis

```text
uip maestro case task-entry-conditions get <file> <stage-id> <task-id> <condition-id>
```

## uip maestro case task-entry-conditions get

Print an entry condition by ID.

### Arguments

| Name | Required | Purpose |
|---|---|---|
| `<file>` | yes | Path to the case management JSON file. |
| `<stage-id>` | yes | ID of the stage node. |
| `<task-id>` | yes | ID of the task. |
| `<condition-id>` | yes | ID of the entry condition to retrieve. |

### Example

```bash
uip maestro case task-entry-conditions get case.json Stage_1 Task_1 Condition_a1b2c3d4
```

### Data shape (--output json)

```json
{
  "Code": "TaskEntryConditionFound",
  "Data": {
    "Condition": { "id": "Condition_a1b2c3d4", "displayName": "Start", "rules": [[{ "id": "Rule_e5f6a7b8", "type": "current-stage-entered" }]] }
  }
}
```

`Condition` is the raw node object as stored on disk — use this shape as a reference when hand-editing `caseplan.json`. `rules` is a nested array — one inner array per OR-branch rule group.

## Task-entry-condition JSON fields

Conditions are added, edited, and removed by hand in `caseplan.json`'s task-entry-conditions array. Field reference:

| Field | Value | Notes |
|---|---|---|
| `displayName` | string | Display name for the condition. |
| rule `type` | `current-stage-entered`\|`selected-tasks-completed`\|`wait-for-connector`\|`adhoc`\|`runs-sequentially` | Goes inside a `rules[][]` entry. |
| condition expression | string | Free-form expression on a rule, when the rule type supports one. |
| `selectedTasksIds` | array of strings | Required alongside a `selected-tasks-completed` rule. |

After editing `caseplan.json`'s task-entry-conditions array directly, run [`uip maestro case validate`](./uip-maestro-case.md#uip-maestro-case-validate).

## Related

- [uip maestro case](./uip-maestro-case.md) — concepts and the full subsystem directory.
- [uip maestro case tasks](./uip-maestro-case-tasks.md) — the tasks these conditions gate.
- [uip maestro case cases & stages](./uip-maestro-case-cases-stages.md) — the stage a task lives inside.
- [uip maestro case conditions](./uip-maestro-case-conditions.md) — the case-level and stage-level equivalents.

## See also

- [Maestro tool overview](./uip-maestro-bpmn.md)
- [Global options](./global-options.md)
- [Exit codes](./exit-codes.md)
