Fix #1451 - Resolve duration expressions; Improve wait DSL contract#1454
Open
ricardozanini wants to merge 7 commits into
Open
Fix #1451 - Resolve duration expressions; Improve wait DSL contract#1454ricardozanini wants to merge 7 commits into
ricardozanini wants to merge 7 commits into
Conversation
Signed-off-by: Ricardo Zanini <ricardozanini@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes #1449 by making WaitExecutor correctly support inline, literal, and expression-based durations (with runtime evaluation for expressions) and by expanding the fluent DSLs (DSL + FuncDSL) with ergonomic wait* convenience methods.
Changes:
- Updated
WaitExecutorto parse/validate inline + literal durations at build time and evaluate duration expressions at runtime with clearer error messages. - Added
waitSeconds/minutes/hours/days/millisandwait(Duration)convenience methods tofluent/specDSL andexperimentalFuncDSL. - Added new unit/integration tests plus YAML workflow samples and accompanying design/plan docs.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| impl/core/src/main/java/io/serverlessworkflow/impl/executors/WaitExecutor.java | Adds literal parsing + runtime evaluation for duration expressions; refactors wait duration handling. |
| impl/test/src/test/java/io/serverlessworkflow/impl/test/WaitExecutorTest.java | Adds integration tests for wait durations (inline/literal/expression) and workflow status transitions. |
| impl/test/src/test/resources/workflows-samples/wait-expression-input.yaml | New YAML sample: wait duration read from workflow input via expression. |
| impl/test/src/test/resources/workflows-samples/wait-expression-context.yaml | New YAML sample: wait duration read from workflow context via expression. |
| fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/dsl/DSL.java | Adds wait convenience methods (waitSeconds, waitMillis, wait(Duration), etc.). |
| fluent/spec/src/test/java/io/serverlessworkflow/fluent/spec/dsl/DSLWaitTest.java | Adds unit tests validating the new DSL wait convenience methods. |
| experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncTaskItemListBuilder.java | Adds wait(...) task builder methods needed by FuncDSL. |
| experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/FuncDSL.java | Adds FuncDSL wait support + convenience methods mirroring DSL. |
| experimental/fluent/func/src/test/java/io/serverlessworkflow/fluent/func/FuncDSLWaitTest.java | Adds unit tests validating FuncDSL wait methods. |
| docs/superpowers/specs/2026-06-11-waittask-ergonomics-design.md | Design spec documenting the intended WaitTask ergonomics and executor behavior. |
| docs/superpowers/plans/2026-06-11-waittask-ergonomics.md | Implementation plan describing the step-by-step rollout and tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Ricardo Zanini <ricardozanini@gmail.com>
Signed-off-by: Ricardo Zanini <ricardozanini@gmail.com>
Signed-off-by: Ricardo Zanini <ricardozanini@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Ricardo Zanini <ricardozanini@gmail.com>
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.
Fix #1451