[docs] Document Action trigger conditions - #977
Conversation
| static membership with `"a.b.c" in attributes`. Dynamic access at the root, such as | ||
| `attributes[key]`, and expressions over the whole `attributes` map are not supported. Dynamic access |
There was a problem hiding this comment.
"Not supported" sits in the same register as line 398's "remains absent", but this one is a hard failure: ConditionExpressionCompiler.classifyIdent throws from the ActionMatcher constructor, so the job fails at operator initialization. The fixture dynamic_whole_attributes_index captures the split, plan_validation: pass with runtime_compilation: fail.
Would naming the outcome help a reader tell the two apart? Maybe something like "rejected when the runtime compiles the condition, so the job fails to start", if that reads right to you.
| attribute envelope under `attributes`. Referenced top-level entries from `Event.attributes` are also | ||
| available directly. Nested values stay under their top-level attribute path and are never flattened. | ||
| For an input event whose attributes are `{input: {status: "ok"}}`, both `input.status` and | ||
| `attributes.input.status` are valid, while bare `status` is not. Other event payloads follow the same |
There was a problem hiding this comment.
"is not" reads as rejected, though nothing rejects bare status. It clears plan validation and the type check (ConditionExpressionCompiler.java:124 declares non-framework idents SimpleType.DYN), then throws unbound at evaluation. Under the default WARN_AND_SKIP that is logged and treated as false, so the action just never fires.
That default lives only in the configuration.md row this PR adds, and neither page links to it. Would a sentence on the failure semantics plus a link fit here, the way monitoring.md:335 points at event-log.level? Same two gaps on workflow_agent.md, if so.
| ### Provider aliases | ||
|
|
||
| For `clazz:` on resource descriptors and for event names in `trigger_conditions:`, you can use a short alias instead of a fully-qualified class path. | ||
| For `clazz:` on resource descriptors and for complete event-type entries in `trigger_conditions:`, you can use a short alias instead of a fully-qualified class path. Event alias replacement is an exact complete-entry lookup: `input` is replaced, while `type == input`, `attributes.kind == 'input'`, and the quoted event type `'input'` remain unchanged. |
There was a problem hiding this comment.
This sentence now frames the alias table below as the menu of legal trigger_conditions values, and that table offers output. An action triggered on output never runs: ActionExecutionOperator.java:247 sends OutputEvents downstream in the if branch, so the getActionsTriggeredBy call in the else at :269 is never reached. Nothing fails and nothing logs.
You document exactly this at workflow_agent.md:472-474. Should the caveat follow the alias table here, or hang off the pointer at 350-351?
Clarify trigger-condition matching and failure semantics. Deduplicate YAML guidance and document OutputEvent routing behavior. Generated-by: Codex CLI 0.144.5 (GPT-5.6-sol)
|
Thanks for the detailed comments, @weiqingy. I refactored the two pages to keep the trigger-condition contract in Could you please take another look and let me know if you have any further suggestions? |
weiqingy
left a comment
There was a problem hiding this comment.
Thanks for addressing the comments. All three are closed, and moving the trigger-condition rules onto one page with yaml.md pointing at it reads much better.
One thing inline that doesn't need to hold this up, otherwise LGTM.
| underscores, or hyphens. Quote a name that contains other punctuation or would otherwise be parsed as | ||
| an expression, for example `'order:created'`, `'true'`, or `'EventType.custom'`. A quoted name matches | ||
| the literal event-type string; it does not reference a built-in `EventType` constant. Quoted names | ||
| must be non-empty and cannot contain whitespace, quotes, backslashes, or control characters. |
There was a problem hiding this comment.
In Java and Python you pass the condition as a string, so an event type that needs quotes ends up with two layers: @Action("'order:created'"). This paragraph shows 'order:created' but never says the inner quotes belong in the string, and the example that made that clear came out in this commit. Drop a layer and @Action("order:created") looks right, but it gets read as an expression rather than an event type (TriggerCondition.java:32 leaves : out of the bare-name pattern), so the plan fails to build. The YAML page still says it outright at yaml.md:292. Since this page owns the rule now, would one line here help? Maybe: "In Java and Python the quotes are part of the condition string, for example @Action("'order:created'")."
Linked issue: #754
Purpose of change
This is the third PR in the three-PR stack tracked by #754:
PR #821 introduced Action trigger conditions, but the existing documentation still described Actions mainly as event-type listeners. This PR documents the user-visible trigger-condition contract consistently across Java, Python, and YAML.
A trigger condition can be either an exact event type or a condition expression, which uses Common Expression Language (CEL). This change:
action.trigger-condition.evaluate-failure-strategy; andTests
This is a documentation-only change. No Tests.
API
No public API or runtime behavior is changed. This PR documents the Action trigger-condition APIs and configuration introduced by #821.
Documentation
doc-neededdoc-not-neededdoc-included