Skip to content

[Fix #1612] Adding test with fixed collection - #1614

Open
fjtirado wants to merge 1 commit into
open-workflow-specification:mainfrom
fjtirado:Fix_#1612
Open

[Fix #1612] Adding test with fixed collection#1614
fjtirado wants to merge 1 commit into
open-workflow-specification:mainfrom
fjtirado:Fix_#1612

Conversation

@fjtirado

Copy link
Copy Markdown
Collaborator

Fix #1612

Copilot AI lite review requested due to automatic review settings August 11, 2026 11:21

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 a regression test (per #1612) to ensure for tasks can iterate over a hard-coded (inline) collection, validating the runtime/schema support for fixed collections.

Changes:

  • Added a new workflow sample (for-sum-fixed.yaml) that uses an inline collection for a for loop.
  • Extended WorkflowDefinitionTest parameterization to execute and assert the new sample’s output and exported context.

Reviewed changes

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

File Description
impl/test/src/test/resources/workflows-samples/for-sum-fixed.yaml New workflow sample exercising for.in as a hard-coded collection.
impl/test/src/test/java/io/serverlessworkflow/impl/test/WorkflowDefinitionTest.java Adds a new parameterized test case to run/assert the new sample.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +8 to +19
for:
each: number
in:
- item: 1
- item: 2
- item: 3
do:
- accumulate:
set:
counter: ${.counter+$number.item}
export:
as: if .incr==null then {incr:[$number.item+1]} else .incr+=[$number.item+1] end

@fjtirado fjtirado Aug 11, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

And how Im supposed to do that if the schema requires an object there?, probably schema should be changed to any

@fjtirado fjtirado Aug 11, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@ricardozanini After writing the example, I feel that, for maximun flexibility, the type of the array should be any in the workflow schema, so lets keep thisPR opened while we evaluate that and update it if the schema is finally updated.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Signed-off-by: Francisco Javier Tirado Sarti <ftirados@ibm.com>
Copilot AI review requested due to automatic review settings August 11, 2026 11:24

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

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

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 test for hard coded collections in For task

2 participants