Skip to content

Add fluent DSL equivalents for core task types and expand coverage#1448

Open
matheusandre1 wants to merge 1 commit into
serverlessworkflow:mainfrom
matheusandre1:dsl-gap
Open

Add fluent DSL equivalents for core task types and expand coverage#1448
matheusandre1 wants to merge 1 commit into
serverlessworkflow:mainfrom
matheusandre1:dsl-gap

Conversation

@matheusandre1

Copy link
Copy Markdown
Contributor

Many thanks for submitting your Pull Request ❤️!

What this PR does / why we need it:
Closes: #1434

Special notes for reviewers:

#1206 (comment)

Additional information (if needed):

@fjtirado

Copy link
Copy Markdown
Collaborator

@matheusandre1 Are you working on this one or it is ready for review? (it is marked as draft, thats why Im asking)

@matheusandre1

Copy link
Copy Markdown
Contributor Author

@matheusandre1 Are you working on this one or it is ready for review? (it is marked as draft, thats why Im asking)

Yes, that part is correct, you can review it.

@fjtirado fjtirado marked this pull request as ready for review June 11, 2026 21:09
@fjtirado fjtirado self-requested a review as a code owner June 11, 2026 21:09
Copilot AI review requested due to automatic review settings June 11, 2026 21:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds standard (non-experimental) fluent DSL coverage for the Serverless Workflow “core task types” by introducing a comprehensive test suite that runs both YAML samples and their DSL-built equivalents, and by extending the fluent use DSL to support reusable error definitions needed by raise workflows.

Changes:

  • Added CoreTaskTypesTest to validate YAML sample parity with fluent DSL workflows for conditional-set, for, switch, fork, raise, and expression usage.
  • Implemented fluent use.errors(...) support (builder + DSL spec) to define reusable errors used by raise tasks.
  • Expanded test coverage for reusable error definitions via the new use.errors fluent API.

Reviewed changes

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

File Description
impl/test/src/test/java/io/serverlessworkflow/impl/test/CoreTaskTypesTest.java New parameterized tests exercising YAML-vs-DSL parity across core task types and expressions.
fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/UseBuilder.java Adds fluent builder support for use.errors and reusable error definitions.
fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/dsl/UseSpec.java Adds DSL-level use().errors(...) wiring to the underlying UseBuilder.

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

Comment thread impl/test/src/test/java/io/serverlessworkflow/impl/test/CoreTaskTypesTest.java Outdated
err ->
err.type("https://serverlessworkflow.io/errors/not-implemented")
.status(500)
.title("Not Implemented")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

here too

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines +429 to +431
error(URI.create("https://serverlessworkflow.io/errors/not-implemented"), 500)
.title("Not Implemented")
.detail(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I believe that's not correct; the method is a unified setter with automatic pattern matching detection.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Add Fluent DSL Equivalents for Core Task Types (set, wait, switch, for, fork, raise, conditional)

3 participants