> {
+
+ /**
+ * The name of the variable used to store the index of the current item being enumerated. Defaults
+ * to index.
+ */
+ SELF at(String at);
+
+ /**
+ * `do` in the specification.
+ *
+ * The tasks to perform for each consumed item.
+ */
+ SELF tasks(Consumer doBuilderConsumer);
+}
diff --git a/fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/spi/ListenFluent.java b/fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/spi/ListenFluent.java
index c3d32e14..ec950456 100644
--- a/fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/spi/ListenFluent.java
+++ b/fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/spi/ListenFluent.java
@@ -19,7 +19,7 @@
import java.util.UUID;
import java.util.function.Consumer;
-public interface ListenFluent, LIST> {
+public interface ListenFluent, LIST> {
LIST listen(String name, Consumer itemsConfigurer);
diff --git a/fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/spi/OutputFluent.java b/fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/spi/OutputFluent.java
new file mode 100644
index 00000000..cc49a43c
--- /dev/null
+++ b/fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/spi/OutputFluent.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2020-Present The Serverless Workflow Specification Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.serverlessworkflow.fluent.spec.spi;
+
+import io.serverlessworkflow.fluent.spec.ExportBuilder;
+import io.serverlessworkflow.fluent.spec.OutputBuilder;
+import java.util.function.Consumer;
+
+public interface OutputFluent {
+
+ SELF output(Consumer outputConsumer);
+
+ SELF export(Consumer exportConsumer);
+
+ SELF exportAs(Object exportAs);
+}
diff --git a/fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/spi/SubscriptionIteratorFluent.java b/fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/spi/SubscriptionIteratorFluent.java
new file mode 100644
index 00000000..8323833a
--- /dev/null
+++ b/fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/spi/SubscriptionIteratorFluent.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2020-Present The Serverless Workflow Specification Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.serverlessworkflow.fluent.spec.spi;
+
+import io.serverlessworkflow.fluent.spec.BaseTaskItemListBuilder;
+
+public interface SubscriptionIteratorFluent>
+ extends IteratorFluent, OutputFluent {
+
+ SELF item(String item);
+}
diff --git a/fluent/spec/src/test/java/io/serverlessworkflow/fluent/spec/WorkflowBuilderTest.java b/fluent/spec/src/test/java/io/serverlessworkflow/fluent/spec/WorkflowBuilderTest.java
index dbb9f1d3..cfaeb260 100644
--- a/fluent/spec/src/test/java/io/serverlessworkflow/fluent/spec/WorkflowBuilderTest.java
+++ b/fluent/spec/src/test/java/io/serverlessworkflow/fluent/spec/WorkflowBuilderTest.java
@@ -183,7 +183,13 @@ void testDoTaskListenOne() {
d ->
d.listen(
"waitCheck",
- l -> l.one(f -> f.with(p -> p.type("com.fake.pet").source("mySource")))))
+ l ->
+ l.to(
+ to ->
+ to.one(
+ f ->
+ f.with(
+ p -> p.type("com.fake.pet").source("mySource"))))))
.build();
List items = wf.getDo();
diff --git a/impl/jackson/src/main/java/io/serverlessworkflow/impl/expressions/jq/JacksonModelCollection.java b/impl/jackson/src/main/java/io/serverlessworkflow/impl/expressions/jq/JacksonModelCollection.java
index b5420419..456db165 100644
--- a/impl/jackson/src/main/java/io/serverlessworkflow/impl/expressions/jq/JacksonModelCollection.java
+++ b/impl/jackson/src/main/java/io/serverlessworkflow/impl/expressions/jq/JacksonModelCollection.java
@@ -55,7 +55,7 @@ public boolean isEmpty() {
@Override
public boolean contains(Object o) {
- throw new UnsupportedOperationException();
+ throw new UnsupportedOperationException("contains() is not supported yet");
}
@Override
@@ -85,12 +85,12 @@ public WorkflowModel next() {
@Override
public Object[] toArray() {
- throw new UnsupportedOperationException();
+ throw new UnsupportedOperationException("toArray() is not supported yet");
}
@Override
public T[] toArray(T[] a) {
- throw new UnsupportedOperationException();
+ throw new UnsupportedOperationException("toArray() is not supported yet");
}
@Override
@@ -109,7 +109,7 @@ public boolean remove(Object o) {
@Override
public boolean containsAll(Collection> c) {
- throw new UnsupportedOperationException();
+ throw new UnsupportedOperationException("containsAll() is not supported yet");
}
@Override
@@ -127,7 +127,7 @@ public boolean removeAll(Collection> c) {
@Override
public boolean retainAll(Collection> c) {
- throw new UnsupportedOperationException();
+ throw new UnsupportedOperationException("retainAll() is not supported yet");
}
@Override