Add metadata support to TaskBaseBuilder and implement TaskMetadataBuilder - #1694
Open
matheusandre1 wants to merge 1 commit into
Open
matheusandre1 wants to merge 1 commit into
matheusandre1 wants to merge 1 commit into
Conversation
…lder Signed-off-by: Matheus André <matheusandr2@gmail.com>
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Pull request overview
Adds fluent task metadata configuration to the builder DSL by introducing a TaskMetadataBuilder and wiring it into TaskBaseBuilder.metadata(), with a corresponding test to validate behavior.
Changes:
- Add
TaskMetadataBuilderfluent API for buildingTaskMetadataentries. - Add
TaskBaseBuilder.metadata(Consumer<TaskMetadataBuilder>)to configure task metadata in the DSL. - Add a unit test verifying metadata is set when configured and remains unset otherwise.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| fluent/spec/src/test/java/io/serverlessworkflow/fluent/spec/WorkflowBuilderTest.java | Adds coverage for task metadata being populated via the DSL and absent when not configured. |
| fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/TaskMetadataBuilder.java | Introduces a fluent builder for TaskMetadata with convenience helpers. |
| fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/TaskBaseBuilder.java | Exposes metadata() on tasks and applies built TaskMetadata onto the underlying task model. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+137
to
+142
| public T metadata(Consumer<TaskMetadataBuilder> metadataConsumer) { | ||
| final TaskMetadataBuilder metadataBuilder = new TaskMetadataBuilder(); | ||
| metadataConsumer.accept(metadataBuilder); | ||
| this.task.setMetadata(metadataBuilder.build()); | ||
| return self(); | ||
| } |
Comment on lines
+128
to
+136
| /** | ||
| * Configures additional information about this task, such as descriptions meant for UI | ||
| * visualization. Parallel to the `metadata` property in the Spec. | ||
| * | ||
| * @param metadataConsumer consumer used to populate the task metadata | ||
| * @see <a | ||
| * href="https://github.com/serverlessworkflow/specification/blob/main/dsl-reference.md#task">DSL | ||
| * Reference - Task</a> | ||
| */ |
Copilot stopped reviewing on behalf of
matheusandre1 due to an error
September 18, 2026 16:24
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: #1689
Adds a fluent
metadata()method toTaskBaseBuilderso task metadata can be configured directly in the builder DSL, following the existingDocumentBuilder.metadata()pattern.Special notes for reviewers:
Additional information (if needed):