Skip to content

no-issue: Infer types in place of Class<T> on Steps interface#1223

Merged
fjtirado merged 2 commits intoserverlessworkflow:mainfrom
ricardozanini:missing-class-steps
Mar 16, 2026
Merged

no-issue: Infer types in place of Class<T> on Steps interface#1223
fjtirado merged 2 commits intoserverlessworkflow:mainfrom
ricardozanini:missing-class-steps

Conversation

@ricardozanini
Copy link
Member

Many thanks for submitting your Pull Request ❤️!

What this PR does / why we need it:
We missed the transformation interfaces inference on the other PR (#1219)

Special notes for reviewers:

Additional information (if needed):

@ricardozanini ricardozanini requested a review from fjtirado as a code owner March 10, 2026 20:06
Copilot AI review requested due to automatic review settings March 10, 2026 20:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the fluent Func DSL Step chaining API to infer lambda input types at runtime (instead of requiring Class<T> arguments), and adjusts executor tests to use the inferred-type overloads.

Changes:

  • Update Step chaining methods (when, exportAs, outputAs, inputFrom) to use ReflectionUtils.inferInputType(...) and pass inferred classes into the underlying builders.
  • Switch several Step overloads to accept serializable functional interfaces to enable SerializedLambda-based inference.
  • Update data-flow transformation helper tests to remove explicit Class<T> parameters and add explicit lambda parameter types where needed.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
experimental/lambda/src/test/java/io/serverless/workflow/impl/executors/func/FuncDSLDataFlowTransformationHelpersTest.java Updates tests to use inferred-type DSL overloads and explicitly typed lambda parameters for context-aware functions.
experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/Step.java Adds runtime type inference for chained transformations/conditions and updates method signatures to use serializable functional interfaces.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings March 11, 2026 15:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fjtirado
Copy link
Collaborator

fjtirado commented Mar 16, 2026

@ricardozanini I tried to resolve the merge conflict to save you work, but I broke it (missing imports) and also we need the DCO. Sorry about that

Signed-off-by: Ricardo Zanini <ricardozanini@gmail.com>
Signed-off-by: Ricardo Zanini <ricardozanini@gmail.com>
Copilot AI review requested due to automatic review settings March 16, 2026 16:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -47,8 +47,11 @@ protected SELF self() {
// ---------------------------------------------------------------------------

/** Queue a {@code when(predicate)} to be applied on the concrete builder. */
*/
public <T, V> SELF exportAs(Function<T, V> function) {
postConfigurers.add(b -> ((FuncTaskTransformations<?>) b).exportAs(function));
public <T, R> SELF exportAs(SerializableFunction<T, R> function) {
*/
public <T, V> SELF outputAs(Function<T, V> function) {
postConfigurers.add(b -> ((FuncTaskTransformations<?>) b).outputAs(function));
public <T, R> SELF outputAs(SerializableFunction<T, R> function) {
*/
public <T, V> SELF inputFrom(Function<T, V> function) {
postConfigurers.add(b -> ((FuncTaskTransformations<?>) b).inputFrom(function));
public <T, R> SELF inputFrom(SerializableFunction<T, R> function) {
@fjtirado fjtirado merged commit 94d713a into serverlessworkflow:main Mar 16, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants