Functional standard / Definition kinds / Constrains No resource. It configures the harness.
reaction
When a resource enters a state, and an optional expression matches, run effects.
Runtime
Clinical effects become proposals whose origin is reaction:<key>. Other effects are applied by the system actor. Chains stop at max_reaction_depth, default 4.
Elements
| Name | Card. | Type | Description |
|---|---|---|---|
| defaults | 0..1 | object | Fields copied onto a new instance. Values given at creation win. |
| approval_required_for | 0..* | code | Extra states that need an Approval to enter. |
| when_kind | 1..1 | code | Resource kind. |
| when_state | 1..1 | code | State just entered. Creation counts as entering the initial state. |
| condition | 0..1 | expression | safe_eval over the record's own fields. |
| effects | 1..* | Effect | op create or transition, kind, data, target_id, to, rationale. $field reads the source. |
Example
{ "when_kind": "assessment", "when_state": "finalized", "condition": "safety_flag == True", "effects": [{ "op": "create", "kind": "task", "data": { "title": "Safety review", "priority": "urgent" } }] }