Skip to content

docs: Make sure the DSL documentation reflects clearly the code#1336

Open
matheusandre1 wants to merge 1 commit intoserverlessworkflow:mainfrom
matheusandre1:issue1284
Open

docs: Make sure the DSL documentation reflects clearly the code#1336
matheusandre1 wants to merge 1 commit intoserverlessworkflow:mainfrom
matheusandre1:issue1284

Conversation

@matheusandre1
Copy link
Copy Markdown
Contributor

@matheusandre1 matheusandre1 commented Apr 22, 2026

Many thanks for submitting your Pull Request ❤️!

What this PR does / why we need it: Closes: #1284
Special notes for reviewers:

Additional information (if needed):

I had forgotten to take care of that....

Copilot AI review requested due to automatic review settings April 22, 2026 16:28
@matheusandre1 matheusandre1 requested a review from fjtirado as a code owner April 22, 2026 16:28
Copy link
Copy Markdown
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

Updates fluent DSL documentation/examples to clarify that context-aware outputAs lambdas receive the task result as their first parameter (aligning docs with runtime behavior and the discussion in #1284).

Changes:

  • Update Step.outputAs(...) JavaDoc examples/wording to name the first lambda parameter taskOutput and describe it explicitly as the task result.
  • Adjust FuncDSLDataFlowTransformationHelpersTest to use a typed taskOutput parameter for outputAs(...).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
experimental/lambda/src/test/java/io/serverless/workflow/impl/executors/func/FuncDSLDataFlowTransformationHelpersTest.java Updates DSL usage in tests; outputAs now uses the task output parameter explicitly (but exportAs tests still rely on output(taskContextData, ...)).
experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/Step.java Refines outputAs JavaDoc to clearly state and demonstrate that the first parameter is the task result.
Comments suppressed due to low confidence (1)

experimental/lambda/src/test/java/io/serverless/workflow/impl/executors/func/FuncDSLDataFlowTransformationHelpersTest.java:186

  • Same issue as above: exportAs(FilterFunction) receives the task output as its first parameter, but the test ignores it and re-reads output from taskContextData. This makes the test not validate the documented/expected contract and can cause ReflectionUtils.inferInputType(...) to infer Object for the lambda input type. Prefer typing/using the first parameter (e.g., Long taskOutput) and remove the output(...) helper call in this test.
                    .exportAs(
                        (object, workflowContext, taskContextData) -> {
                          Long taskOutput = output(taskContextData, Long.class);
                          softly.assertThat(taskOutput).isEqualTo(15L);
                          Long input = input(workflowContext, Long.class);
                          softly.assertThat(input).isEqualTo(10L);
                          return input + taskOutput;

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

@matheusandre1 matheusandre1 marked this pull request as draft April 22, 2026 16:46
@matheusandre1 matheusandre1 marked this pull request as ready for review April 22, 2026 16:51
Copilot AI review requested due to automatic review settings April 22, 2026 16:51
Copy link
Copy Markdown
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 3 out of 3 changed files in this pull request and generated 3 comments.


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

Comment thread impl/core/src/main/java/io/serverlessworkflow/impl/WorkflowUtils.java Outdated
Signed-off-by: Matheus André <matheusandr2@gmail.com>
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.

Make sure the DSL documentation reflects clearly the code

2 participants