feat: Implement correlation on event filter#1386
Open
matheusandre1 wants to merge 1 commit into
Open
Conversation
a138648 to
ba7cffc
Compare
fjtirado
reviewed
May 19, 2026
fjtirado
reviewed
May 19, 2026
fjtirado
reviewed
May 19, 2026
fjtirado
reviewed
May 19, 2026
fjtirado
requested changes
May 19, 2026
Collaborator
fjtirado
left a comment
There was a problem hiding this comment.
You need to separate the DSL gap PR you were working on from the Correlation one.
d8d98e5 to
77143c1
Compare
77143c1 to
17ca1de
Compare
Contributor
Author
|
@fjtirado I will send the other file separately after you review this one. |
fjtirado
reviewed
May 20, 2026
fjtirado
reviewed
May 20, 2026
fjtirado
reviewed
May 20, 2026
fjtirado
reviewed
May 20, 2026
fjtirado
reviewed
May 20, 2026
fjtirado
reviewed
May 20, 2026
fjtirado
reviewed
May 20, 2026
fjtirado
reviewed
May 20, 2026
fjtirado
reviewed
May 20, 2026
b6a2c10 to
e25550f
Compare
e25550f to
37affd2
Compare
fjtirado
reviewed
May 21, 2026
fjtirado
reviewed
May 21, 2026
fjtirado
reviewed
May 21, 2026
fjtirado
reviewed
May 21, 2026
fjtirado
reviewed
May 21, 2026
37affd2 to
89bf4f0
Compare
fjtirado
reviewed
May 22, 2026
fjtirado
reviewed
May 22, 2026
fjtirado
approved these changes
May 22, 2026
89bf4f0 to
a2e10ea
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/AbstractEventFilterBuilder.java:51
- AbstractEventFilterBuilder always sets an EventFilterCorrelate instance on the filter in build(), even when correlate() was never called. This can change serialization output (emitting an empty correlate object) and, more importantly, can surface null-map cases downstream (e.g., engine code that assumes correlate.additionalProperties is non-null). Consider only setting correlate when at least one correlation entry was added, or ensure the correlate builder initializes an empty map so getters never return null.
protected final EventFilter filter = new EventFilter();
protected final EventFilterCorrelate correlate = new EventFilterCorrelate();
protected abstract SELF self();
protected abstract P newEventPropertiesBuilder();
public SELF with(Consumer<P> c) {
P pb = this.newEventPropertiesBuilder();
c.accept(pb);
filter.setWith(pb.build());
return self();
}
public SELF correlate(
String key, Consumer<? super AbstractListenTaskBuilder.CorrelatePropertyBuilder> c) {
AbstractListenTaskBuilder.CorrelatePropertyBuilder cb =
new AbstractListenTaskBuilder.CorrelatePropertyBuilder();
c.accept(cb);
correlate.setAdditionalProperty(key, cb.build());
return self();
}
public EventFilter build() {
filter.setCorrelate(correlate);
return filter;
}
a2e10ea to
bd8aedf
Compare
bd8aedf to
46186f9
Compare
- Add CorrelationPredicate for evaluating correlation expressions - Add correlate support in AbstractEventFilterBuilder and AbstractEventFilterSpec - Update TypeEventRegistration and TypeEventRegistrationBuilder with correlation predicates - Implement correlation matching in AbstractTypeConsumer - Add CorrelationTest and listen-correlate.yaml - Add correlate tests in WorkflowBuilderTest and DSLTest Signed-off-by: Matheus André <[email protected]>
46186f9 to
2fbc66a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Many thanks for submitting your Pull Request ❤️!
What this PR does / why we need it: Closes: #1206
Special notes for reviewers:
Additional information (if needed):