rosemarYuan opened a new pull request, #756:
URL: https://github.com/apache/flink-agents/pull/756
Linked issue: #754
### Purpose of change
This PR introduces `EventType` constants and a registry for built-in and
user-defined event types, and unifies the Action trigger entry point across
Java and Python:
- Java: `@Action(value = ...)`
- Python: `@action(*trigger_conditions)`
This is a preparatory API and plan change for the CEL Action Condition
filtering feature tracked in #754. Follow-up PRs will add Java runtime CEL
evaluation, Python runtime CEL evaluation, and documentation.
### Scope
Since #709, `@Action` / `@action` carry two orthogonal concerns:
| concern | Java element | Python API | decides |
| --- | --- | --- | --- |
| trigger | `value()` | `*trigger_conditions` | when the action fires |
| dispatch | `target()` | `target=` | where it runs |
This PR only changes the trigger side:
- Java: `listenEventTypes` is renamed to `value()`.
- Python: `*listen_events` is renamed to `*trigger_conditions`.
The dispatch side is unchanged. `target`, `PythonFunction`, and
cross-language dispatch semantics are reused as-is.
### Tests
- Java: `EventTypeTest`, `AgentPlan*Test`, `Action*SerializerTest` — all
green
- Python: `api/tests` + `plan/tests` — 218 passed, 11 skipped
- Verified that cross-language `target` dispatch still works after the
trigger rename
### API
This is a source-level API rename on the trigger side.
Java:
- `@Action(listenEventTypes = {X.EVENT_TYPE})` → `@Action(EventType.X)`
- `@Action(listenEventTypes =..., target = @PythonFunction(...))` →
`@Action(value = ..., target = @PythonFunction(...))`
Python:
- `@action(*listen_events, target=None)` → `@action(*trigger_conditions,
target=None)`
- `target=` remains unchanged.
All in-tree Java and Python callers have been migrated.
- [x] `doc-included`
Updated 10 markdown files under `docs/content/docs/` to use the new
`EventType.X` / `@Action(EventType.X)` form while preserving the existing
cross-language `target` examples.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]