diff --git a/experimental/fluent/func/pom.xml b/experimental/fluent/func/pom.xml
deleted file mode 100644
index dcf2aa96f..000000000
--- a/experimental/fluent/func/pom.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
- 4.0.0
-
- io.serverlessworkflow
- serverlessworkflow-experimental-fluent
- 8.0.0-SNAPSHOT
-
-
- Serverless Workflow :: Experimental :: Fluent :: Functional
- serverlessworkflow-experimental-fluent-func
-
-
- 17
- 17
- UTF-8
-
-
-
-
- io.serverlessworkflow
- serverlessworkflow-experimental-types
-
-
- io.serverlessworkflow
- serverlessworkflow-impl-json
-
-
- io.serverlessworkflow
- serverlessworkflow-fluent-spec
-
-
- io.cloudevents
- cloudevents-core
-
-
-
- org.junit.jupiter
- junit-jupiter-api
- test
-
-
- org.mockito
- mockito-core
- ${version.org.mockito}
- test
-
-
-
\ No newline at end of file
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncCallGrpcTaskBuilder.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncCallGrpcTaskBuilder.java
deleted file mode 100644
index 6d3b377f0..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncCallGrpcTaskBuilder.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.func;
-
-import io.serverlessworkflow.api.types.CallGRPC;
-import io.serverlessworkflow.api.types.GRPCArguments;
-import io.serverlessworkflow.fluent.func.spi.ConditionalTaskBuilder;
-import io.serverlessworkflow.fluent.func.spi.FuncTaskTransformations;
-import io.serverlessworkflow.fluent.spec.TaskBaseBuilder;
-import io.serverlessworkflow.fluent.spec.spi.CallGrpcTaskFluent;
-
-public class FuncCallGrpcTaskBuilder extends TaskBaseBuilder
- implements CallGrpcTaskFluent,
- FuncTaskTransformations,
- ConditionalTaskBuilder {
-
- FuncCallGrpcTaskBuilder() {
- final CallGRPC callGRPC = new CallGRPC();
- callGRPC.setWith(new GRPCArguments());
- super.setTask(callGRPC);
- }
-
- @Override
- public FuncCallGrpcTaskBuilder self() {
- return this;
- }
-}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncCallHttpTaskBuilder.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncCallHttpTaskBuilder.java
deleted file mode 100644
index bf06e5897..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncCallHttpTaskBuilder.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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.func;
-
-import io.serverlessworkflow.api.types.CallHTTP;
-import io.serverlessworkflow.api.types.HTTPArguments;
-import io.serverlessworkflow.fluent.func.spi.ConditionalTaskBuilder;
-import io.serverlessworkflow.fluent.func.spi.FuncTaskTransformations;
-import io.serverlessworkflow.fluent.spec.TaskBaseBuilder;
-import io.serverlessworkflow.fluent.spec.spi.CallHttpTaskFluent;
-
-public class FuncCallHttpTaskBuilder extends TaskBaseBuilder
- implements CallHttpTaskFluent,
- FuncTaskTransformations,
- ConditionalTaskBuilder {
-
- FuncCallHttpTaskBuilder() {
- super.setTask(new CallHTTP().withWith(new HTTPArguments()));
- }
-
- @Override
- public FuncCallHttpTaskBuilder self() {
- return this;
- }
-}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncCallOpenAPITaskBuilder.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncCallOpenAPITaskBuilder.java
deleted file mode 100644
index 8c86af9b0..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncCallOpenAPITaskBuilder.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.func;
-
-import io.serverlessworkflow.api.types.CallOpenAPI;
-import io.serverlessworkflow.api.types.OpenAPIArguments;
-import io.serverlessworkflow.api.types.WithOpenAPIParameters;
-import io.serverlessworkflow.fluent.func.spi.ConditionalTaskBuilder;
-import io.serverlessworkflow.fluent.func.spi.FuncTaskTransformations;
-import io.serverlessworkflow.fluent.spec.TaskBaseBuilder;
-import io.serverlessworkflow.fluent.spec.spi.CallOpenAPITaskFluent;
-
-public class FuncCallOpenAPITaskBuilder extends TaskBaseBuilder
- implements CallOpenAPITaskFluent,
- FuncTaskTransformations,
- ConditionalTaskBuilder {
-
- FuncCallOpenAPITaskBuilder() {
- final CallOpenAPI callOpenAPI = new CallOpenAPI();
- callOpenAPI.setWith(new OpenAPIArguments().withParameters(new WithOpenAPIParameters()));
- super.setTask(callOpenAPI);
- }
-
- @Override
- public FuncCallOpenAPITaskBuilder self() {
- return this;
- }
-}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncCallTaskBuilder.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncCallTaskBuilder.java
deleted file mode 100644
index ab3cdf9df..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncCallTaskBuilder.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * 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.func;
-
-import io.serverlessworkflow.api.types.CallTask;
-import io.serverlessworkflow.api.types.func.CallJava;
-import io.serverlessworkflow.api.types.func.ContextFunction;
-import io.serverlessworkflow.api.types.func.FilterFunction;
-import io.serverlessworkflow.api.types.func.SerializableFunction;
-import io.serverlessworkflow.fluent.func.spi.ConditionalTaskBuilder;
-import io.serverlessworkflow.fluent.func.spi.FuncTaskTransformations;
-import io.serverlessworkflow.fluent.spec.TaskBaseBuilder;
-import java.util.function.Consumer;
-import java.util.function.Function;
-
-public class FuncCallTaskBuilder extends TaskBaseBuilder
- implements FuncTaskTransformations,
- ConditionalTaskBuilder {
-
- private CallTask callTaskJava;
-
- FuncCallTaskBuilder() {}
-
- @Override
- protected FuncCallTaskBuilder self() {
- return this;
- }
-
- public FuncCallTaskBuilder function(SerializableFunction function) {
- return function(function, null);
- }
-
- public FuncCallTaskBuilder function(Function function, Class argClass) {
- return function(function, argClass, null);
- }
-
- public FuncCallTaskBuilder function(
- Function function, Class argClass, Class returnClass) {
- this.callTaskJava =
- new CallTask().withCallFunction(CallJava.function(function, argClass, returnClass));
- super.setTask(this.callTaskJava.getCallFunction());
- return this;
- }
-
- public FuncCallTaskBuilder function(ContextFunction function) {
- return function(function, null);
- }
-
- public FuncCallTaskBuilder function(ContextFunction function, Class argClass) {
- return function(function, argClass, null);
- }
-
- public FuncCallTaskBuilder function(
- ContextFunction function, Class argClass, Class returnClass) {
- this.callTaskJava =
- new CallTask().withCallFunction(CallJava.function(function, argClass, returnClass));
- super.setTask(this.callTaskJava.getCallFunction());
- return this;
- }
-
- public FuncCallTaskBuilder function(FilterFunction function) {
- return function(function, null);
- }
-
- public FuncCallTaskBuilder function(FilterFunction function, Class argClass) {
- return function(function, argClass, null);
- }
-
- public FuncCallTaskBuilder function(
- FilterFunction function, Class argClass, Class outputClass) {
- this.callTaskJava =
- new CallTask().withCallFunction(CallJava.function(function, argClass, outputClass));
- super.setTask(this.callTaskJava.getCallFunction());
- return this;
- }
-
- /** Accept a side-effect Consumer; engine should pass input through unchanged. */
- public FuncCallTaskBuilder consumer(Consumer consumer) {
- this.callTaskJava = new CallTask().withCallFunction(CallJava.consumer(consumer));
- super.setTask(this.callTaskJava.getCallFunction());
- return this;
- }
-
- /** Accept a Consumer with explicit input type hint. */
- public FuncCallTaskBuilder consumer(Consumer consumer, Class argClass) {
- this.callTaskJava = new CallTask().withCallFunction(CallJava.consumer(consumer, argClass));
- super.setTask(this.callTaskJava.getCallFunction());
- return this;
- }
-
- public CallTask build() {
- if (this.callTaskJava == null) {
- throw new IllegalStateException(
- "Call task is not configured. Call function(...) or consumer(...) before build().");
- }
- return this.callTaskJava;
- }
-}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncDoTaskBuilder.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncDoTaskBuilder.java
deleted file mode 100644
index 8de4ff865..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncDoTaskBuilder.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * 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.func;
-
-import io.serverlessworkflow.fluent.func.spi.ConditionalTaskBuilder;
-import io.serverlessworkflow.fluent.func.spi.FuncDoFluent;
-import io.serverlessworkflow.fluent.func.spi.FuncTaskTransformations;
-import io.serverlessworkflow.fluent.spec.BaseDoTaskBuilder;
-import io.serverlessworkflow.fluent.spec.WorkflowTaskBuilder;
-import java.util.function.Consumer;
-
-public class FuncDoTaskBuilder extends BaseDoTaskBuilder
- implements FuncTaskTransformations,
- ConditionalTaskBuilder,
- FuncDoFluent {
-
- public FuncDoTaskBuilder(int listSizeOffset) {
- super(new FuncTaskItemListBuilder(listSizeOffset));
- }
-
- @Override
- public FuncDoTaskBuilder self() {
- return this;
- }
-
- @Override
- public FuncDoTaskBuilder emit(String name, Consumer itemsConfigurer) {
- this.listBuilder().emit(name, itemsConfigurer);
- return this;
- }
-
- @Override
- public FuncDoTaskBuilder listen(String name, Consumer itemsConfigurer) {
- this.listBuilder().listen(name, itemsConfigurer);
- return this;
- }
-
- @Override
- public FuncDoTaskBuilder raise(String name, Consumer itemsConfigurer) {
- this.listBuilder().raise(name, itemsConfigurer);
- return this;
- }
-
- @Override
- public FuncDoTaskBuilder forEach(String name, Consumer itemsConfigurer) {
- this.listBuilder().forEach(name, itemsConfigurer);
- return this;
- }
-
- @Override
- public FuncDoTaskBuilder set(String name, Consumer itemsConfigurer) {
- this.listBuilder().set(name, itemsConfigurer);
- return this;
- }
-
- @Override
- public FuncDoTaskBuilder set(String name, String expr) {
- this.listBuilder().set(name, expr);
- return this;
- }
-
- @Override
- public FuncDoTaskBuilder switchCase(
- String name, Consumer itemsConfigurer) {
- this.listBuilder().switchCase(name, itemsConfigurer);
- return this;
- }
-
- @Override
- public FuncDoTaskBuilder function(String name, Consumer cfg) {
- this.listBuilder().function(name, cfg);
- return this;
- }
-
- @Override
- public FuncDoTaskBuilder fork(String name, Consumer itemsConfigurer) {
- this.listBuilder().fork(name, itemsConfigurer);
- return this;
- }
-
- @Override
- public FuncDoTaskBuilder http(String name, Consumer itemsConfigurer) {
- this.listBuilder().http(name, itemsConfigurer);
- return this;
- }
-
- @Override
- public FuncDoTaskBuilder openapi(
- String name, Consumer itemsConfigurer) {
- this.listBuilder().openapi(name, itemsConfigurer);
- return this;
- }
-
- @Override
- public FuncDoTaskBuilder grpc(String name, Consumer itemsConfigurer) {
- this.listBuilder().grpc(name, itemsConfigurer);
- return this;
- }
-
- @Override
- public FuncDoTaskBuilder workflow(String name, Consumer itemsConfigurer) {
- this.listBuilder().workflow(name, itemsConfigurer);
- return this;
- }
-
- @Override
- public FuncDoTaskBuilder subflow(String name, Consumer itemsConfigurer) {
- this.listBuilder().subflow(name, itemsConfigurer);
- return this;
- }
-
- @Override
- public FuncDoTaskBuilder subflow(Consumer itemsConfigurer) {
- this.listBuilder().subflow(itemsConfigurer);
- return this;
- }
-
- @Override
- public FuncDoTaskBuilder tryCatch(String name, Consumer itemsConfigurer) {
- this.listBuilder().tryCatch(name, itemsConfigurer);
- return this;
- }
-}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncEmitEventPropertiesBuilder.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncEmitEventPropertiesBuilder.java
deleted file mode 100644
index a71e383ee..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncEmitEventPropertiesBuilder.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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.func;
-
-import io.cloudevents.CloudEventData;
-import io.serverlessworkflow.api.types.func.ContextFunction;
-import io.serverlessworkflow.api.types.func.EventDataFunction;
-import io.serverlessworkflow.api.types.func.FilterFunction;
-import io.serverlessworkflow.api.types.func.SerializableFunction;
-import io.serverlessworkflow.fluent.spec.AbstractEventPropertiesBuilder;
-import java.util.function.Function;
-
-public class FuncEmitEventPropertiesBuilder
- extends AbstractEventPropertiesBuilder {
-
- @Override
- protected FuncEmitEventPropertiesBuilder self() {
- return this;
- }
-
- public FuncEmitEventPropertiesBuilder data(SerializableFunction function) {
- this.eventProperties.setData(new EventDataFunction().withFunction(function));
- return this;
- }
-
- public FuncEmitEventPropertiesBuilder data(
- Function function, Class clazz) {
- this.eventProperties.setData(new EventDataFunction().withFunction(function, clazz));
- return this;
- }
-
- public FuncEmitEventPropertiesBuilder data(
- ContextFunction function, Class clazz) {
- this.eventProperties.setData(new EventDataFunction().withFunction(function, clazz));
- return this;
- }
-
- public FuncEmitEventPropertiesBuilder data(
- FilterFunction function, Class clazz) {
- this.eventProperties.setData(new EventDataFunction().withFunction(function, clazz));
- return this;
- }
-}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncEmitTaskBuilder.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncEmitTaskBuilder.java
deleted file mode 100644
index 13af9e883..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncEmitTaskBuilder.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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.func;
-
-import io.serverlessworkflow.fluent.func.spi.ConditionalTaskBuilder;
-import io.serverlessworkflow.fluent.func.spi.FuncTaskTransformations;
-import io.serverlessworkflow.fluent.spec.AbstractEmitTaskBuilder;
-
-public class FuncEmitTaskBuilder
- extends AbstractEmitTaskBuilder
- implements ConditionalTaskBuilder,
- FuncTaskTransformations {
- FuncEmitTaskBuilder() {
- super();
- }
-
- @Override
- protected FuncEmitTaskBuilder self() {
- return this;
- }
-
- @Override
- protected FuncEmitEventPropertiesBuilder newEventPropertiesBuilder() {
- return new FuncEmitEventPropertiesBuilder();
- }
-}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncEventFilterBuilder.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncEventFilterBuilder.java
deleted file mode 100644
index 1d033d86d..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncEventFilterBuilder.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * 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.func;
-
-import io.serverlessworkflow.fluent.spec.AbstractEventFilterBuilder;
-
-public class FuncEventFilterBuilder
- extends AbstractEventFilterBuilder {
-
- @Override
- protected FuncEventFilterBuilder self() {
- return this;
- }
-
- @Override
- protected FuncEventFilterPropertiesBuilder newEventPropertiesBuilder() {
- return new FuncEventFilterPropertiesBuilder();
- }
-}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncEventFilterPropertiesBuilder.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncEventFilterPropertiesBuilder.java
deleted file mode 100644
index 5bb8e64f7..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncEventFilterPropertiesBuilder.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * 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.func;
-
-import io.cloudevents.CloudEvent;
-import io.cloudevents.CloudEventData;
-import io.serverlessworkflow.api.types.func.ContextPredicate;
-import io.serverlessworkflow.api.types.func.EventDataPredicate;
-import io.serverlessworkflow.api.types.func.EventPropertiesPredicate;
-import io.serverlessworkflow.api.types.func.FilterPredicate;
-import io.serverlessworkflow.fluent.spec.AbstractEventPropertiesBuilder;
-import java.util.function.Predicate;
-
-public class FuncEventFilterPropertiesBuilder
- extends AbstractEventPropertiesBuilder {
-
- public FuncEventFilterPropertiesBuilder() {
- super(new EventPropertiesPredicate());
- }
-
- @Override
- protected FuncEventFilterPropertiesBuilder self() {
- return this;
- }
-
- public FuncEventFilterPropertiesBuilder data(Predicate predicate) {
- this.eventProperties.setData(
- new EventDataPredicate().withPredicate(predicate, CloudEventData.class));
- return this;
- }
-
- public FuncEventFilterPropertiesBuilder data(ContextPredicate predicate) {
- this.eventProperties.setData(
- new EventDataPredicate().withPredicate(predicate, CloudEventData.class));
- return this;
- }
-
- public FuncEventFilterPropertiesBuilder data(FilterPredicate predicate) {
- this.eventProperties.setData(
- new EventDataPredicate().withPredicate(predicate, CloudEventData.class));
- return this;
- }
-
- public FuncEventFilterPropertiesBuilder envelope(Predicate predicate) {
- ((EventPropertiesPredicate) eventProperties).withPredicate(predicate, CloudEvent.class);
- return this;
- }
-
- public FuncEventFilterPropertiesBuilder envelope(ContextPredicate predicate) {
- ((EventPropertiesPredicate) eventProperties).withPredicate(predicate, CloudEvent.class);
- return this;
- }
-
- public FuncEventFilterPropertiesBuilder envelope(FilterPredicate predicate) {
- ((EventPropertiesPredicate) eventProperties).withPredicate(predicate, CloudEvent.class);
- return this;
- }
-}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncForTaskBuilder.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncForTaskBuilder.java
deleted file mode 100644
index cf58071ac..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncForTaskBuilder.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * 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.func;
-
-import io.serverlessworkflow.api.types.CallTask;
-import io.serverlessworkflow.api.types.ForTask;
-import io.serverlessworkflow.api.types.ForTaskConfiguration;
-import io.serverlessworkflow.api.types.Task;
-import io.serverlessworkflow.api.types.TaskItem;
-import io.serverlessworkflow.api.types.func.CallJava;
-import io.serverlessworkflow.api.types.func.LoopFunction;
-import io.serverlessworkflow.api.types.func.LoopPredicate;
-import io.serverlessworkflow.api.types.func.LoopPredicateIndex;
-import io.serverlessworkflow.api.types.utils.ForTaskFunction;
-import io.serverlessworkflow.fluent.func.spi.ConditionalTaskBuilder;
-import io.serverlessworkflow.fluent.func.spi.FuncTaskTransformations;
-import io.serverlessworkflow.fluent.spec.TaskBaseBuilder;
-import io.serverlessworkflow.fluent.spec.spi.ForEachTaskFluent;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.function.Consumer;
-import java.util.function.Function;
-
-public class FuncForTaskBuilder extends TaskBaseBuilder
- implements FuncTaskTransformations,
- ConditionalTaskBuilder,
- ForEachTaskFluent {
-
- private final ForTask forTask;
- private final List items;
-
- FuncForTaskBuilder() {
- this.forTask = new ForTask();
- this.forTask.withFor(new ForTaskConfiguration());
- this.items = new ArrayList<>();
- super.setTask(forTask);
- }
-
- @Override
- protected FuncForTaskBuilder self() {
- return this;
- }
-
- public FuncForTaskBuilder whileC(LoopPredicate predicate) {
- ForTaskFunction.withWhile(forTask, predicate);
- return this;
- }
-
- public FuncForTaskBuilder whileC(LoopPredicateIndex predicate) {
- ForTaskFunction.withWhile(forTask, predicate);
- return this;
- }
-
- public FuncForTaskBuilder collection(Function> collectionF) {
- ForTaskFunction.withCollection(forTask, collectionF);
- return this;
- }
-
- public FuncForTaskBuilder collection(
- Function> collectionF, Class clazz) {
- ForTaskFunction.withCollection(forTask, collectionF, clazz);
- return this;
- }
-
- public FuncForTaskBuilder tasks(String name, LoopFunction function) {
- if (name == null || name.isBlank()) {
- name = "for-task-" + this.items.size();
- }
- this.items.add(
- new TaskItem(
- name,
- new Task()
- .withCallTask(
- new CallTask()
- .withCallFunction(
- CallJava.loopFunction(function, this.forTask.getFor().getEach())))));
- return this;
- }
-
- public FuncForTaskBuilder tasks(LoopFunction function) {
- return this.tasks(null, function);
- }
-
- @Override
- public FuncForTaskBuilder each(String each) {
- this.forTask.getFor().withEach(each);
- return this;
- }
-
- @Override
- public FuncForTaskBuilder in(String in) {
- this.forTask.getFor().withIn(in);
- return this;
- }
-
- @Override
- public FuncForTaskBuilder at(String at) {
- this.forTask.getFor().withAt(at);
- return this;
- }
-
- @Override
- public FuncForTaskBuilder whileC(String expression) {
- this.forTask.setWhile(expression);
- return this;
- }
-
- public FuncForTaskBuilder tasks(Consumer consumer) {
- final FuncTaskItemListBuilder builder = new FuncTaskItemListBuilder(this.items.size());
- consumer.accept(builder);
- this.items.addAll(builder.build());
- return this;
- }
-
- public ForTask build() {
- this.forTask.setDo(this.items);
- return this.forTask;
- }
-}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncForkTaskBuilder.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncForkTaskBuilder.java
deleted file mode 100644
index 9d43116ce..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncForkTaskBuilder.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * 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.func;
-
-import io.serverlessworkflow.api.types.CallTask;
-import io.serverlessworkflow.api.types.Task;
-import io.serverlessworkflow.api.types.TaskItem;
-import io.serverlessworkflow.api.types.func.CallJava;
-import io.serverlessworkflow.fluent.func.spi.ConditionalTaskBuilder;
-import io.serverlessworkflow.fluent.func.spi.FuncTaskTransformations;
-import io.serverlessworkflow.fluent.spec.AbstractForkTaskBuilder;
-import io.serverlessworkflow.fluent.spec.spi.ForkTaskFluent;
-import java.util.function.Function;
-
-public class FuncForkTaskBuilder
- extends AbstractForkTaskBuilder
- implements FuncTaskTransformations,
- ConditionalTaskBuilder,
- ForkTaskFluent {
-
- FuncForkTaskBuilder() {
- super();
- }
-
- @Override
- protected FuncForkTaskBuilder self() {
- return this;
- }
-
- @Override
- protected FuncTaskItemListBuilder newTaskItemListBuilder(int listOffsetSize) {
- return new FuncTaskItemListBuilder(listOffsetSize);
- }
-
- public FuncForkTaskBuilder branch(String name, Function function) {
- return branch(name, function, null);
- }
-
- public FuncForkTaskBuilder branch(
- String name, Function function, Class argParam) {
- return branch(name, function, argParam, null);
- }
-
- public FuncForkTaskBuilder branch(
- String name, Function function, Class argParam, Class returnClass) {
- this.appendBranch(
- new TaskItem(
- this.defaultBranchName(name, this.currentOffset()),
- new Task()
- .withCallTask(
- new CallTask()
- .withCallFunction(CallJava.function(function, argParam, returnClass)))));
- return this;
- }
-
- public FuncForkTaskBuilder branch(Function function) {
- return this.branch(null, function);
- }
-}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncListenTaskBuilder.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncListenTaskBuilder.java
deleted file mode 100644
index b2478157a..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncListenTaskBuilder.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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.func;
-
-import io.serverlessworkflow.api.types.utils.TaskPredicate;
-import io.serverlessworkflow.api.types.utils.TypesUtils;
-import io.serverlessworkflow.fluent.func.spi.ConditionalTaskBuilder;
-import io.serverlessworkflow.fluent.func.spi.FuncTaskTransformations;
-import io.serverlessworkflow.fluent.spec.AbstractListenTaskBuilder;
-import java.util.function.Predicate;
-
-public class FuncListenTaskBuilder
- extends AbstractListenTaskBuilder
- implements ConditionalTaskBuilder,
- FuncTaskTransformations {
-
- FuncListenTaskBuilder(FuncTaskItemListBuilder factory) {
- super(factory);
- }
-
- public FuncListenTaskBuilder until(Predicate predicate, Class predClass) {
- TaskPredicate.withPredicate(
- super.getListenTask(), TypesUtils.UNTIL_PRED_NAME, predicate, predClass);
- return this;
- }
-
- @Override
- protected FuncListenTaskBuilder self() {
- return this;
- }
-
- @Override
- protected FuncListenToBuilder newEventConsumptionStrategyBuilder() {
- return new FuncListenToBuilder(super.getListenTask());
- }
-}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncListenToBuilder.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncListenToBuilder.java
deleted file mode 100644
index 1f6585ca0..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncListenToBuilder.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * 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.func;
-
-import io.serverlessworkflow.api.types.AllEventConsumptionStrategy;
-import io.serverlessworkflow.api.types.AnyEventConsumptionStrategy;
-import io.serverlessworkflow.api.types.ListenTask;
-import io.serverlessworkflow.api.types.ListenTo;
-import io.serverlessworkflow.api.types.OneEventConsumptionStrategy;
-import io.serverlessworkflow.api.types.Until;
-import io.serverlessworkflow.api.types.func.ContextPredicate;
-import io.serverlessworkflow.api.types.func.FilterPredicate;
-import io.serverlessworkflow.api.types.utils.TaskPredicate;
-import io.serverlessworkflow.api.types.utils.TypesUtils;
-import io.serverlessworkflow.fluent.spec.AbstractEventConsumptionStrategyBuilder;
-import java.util.function.Predicate;
-
-public class FuncListenToBuilder
- extends AbstractEventConsumptionStrategyBuilder<
- FuncListenToBuilder, ListenTo, FuncEventFilterBuilder> {
-
- private final ListenTo listenTo = new ListenTo();
- private final ListenTask listenTask;
-
- public FuncListenToBuilder(ListenTask listenTask) {
- this.listenTask = listenTask;
- }
-
- @Override
- protected FuncEventFilterBuilder newEventFilterBuilder() {
- return new FuncEventFilterBuilder();
- }
-
- // TODO: move these methods to default on an interface
-
- @Override
- protected void setOne(OneEventConsumptionStrategy strategy) {
- this.listenTo.setOneEventConsumptionStrategy(strategy);
- }
-
- @Override
- protected void setAll(AllEventConsumptionStrategy strategy) {
- this.listenTo.setAllEventConsumptionStrategy(strategy);
- }
-
- @Override
- protected void setAny(AnyEventConsumptionStrategy strategy) {
- this.listenTo.setAnyEventConsumptionStrategy(strategy);
- }
-
- @Override
- protected ListenTo getEventConsumptionStrategy() {
- return this.listenTo;
- }
-
- @Override
- protected void setUntilForAny(Until until) {
- this.listenTo.getAnyEventConsumptionStrategy().setUntil(until);
- }
-
- public FuncListenToBuilder until(Predicate predicate, Class predClass) {
- TaskPredicate.withPredicate(listenTask, TypesUtils.UNTIL_PRED_NAME, predicate, predClass);
- return this;
- }
-
- public FuncListenToBuilder until(ContextPredicate predicate, Class predClass) {
- TaskPredicate.withPredicate(listenTask, TypesUtils.UNTIL_PRED_NAME, predicate, predClass);
- return this;
- }
-
- public FuncListenToBuilder until(FilterPredicate predicate, Class predClass) {
- TaskPredicate.withPredicate(listenTask, TypesUtils.UNTIL_PRED_NAME, predicate, predClass);
- return this;
- }
-}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncRaiseTaskBuilder.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncRaiseTaskBuilder.java
deleted file mode 100644
index 6afc5d62c..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncRaiseTaskBuilder.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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.func;
-
-import io.serverlessworkflow.fluent.func.spi.ConditionalTaskBuilder;
-import io.serverlessworkflow.fluent.func.spi.FuncTaskTransformations;
-import io.serverlessworkflow.fluent.spec.BaseRaiseTaskBuilder;
-
-public class FuncRaiseTaskBuilder extends BaseRaiseTaskBuilder
- implements FuncTaskTransformations,
- ConditionalTaskBuilder {
-
- FuncRaiseTaskBuilder() {
- super();
- }
-
- @Override
- protected FuncRaiseTaskBuilder self() {
- return this;
- }
-}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncSetTaskBuilder.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncSetTaskBuilder.java
deleted file mode 100644
index aaad58c84..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncSetTaskBuilder.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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.func;
-
-import io.serverlessworkflow.api.types.utils.MapSetTaskConfiguration;
-import io.serverlessworkflow.fluent.func.spi.ConditionalTaskBuilder;
-import io.serverlessworkflow.fluent.spec.SetTaskBuilder;
-import java.util.Map;
-
-public class FuncSetTaskBuilder extends SetTaskBuilder
- implements ConditionalTaskBuilder {
-
- public FuncSetTaskBuilder expr(Map map) {
- this.setTaskConfiguration = MapSetTaskConfiguration.map(map);
- return this;
- }
-}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncSwitchTaskBuilder.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncSwitchTaskBuilder.java
deleted file mode 100644
index 90fb37d5e..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncSwitchTaskBuilder.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * 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.func;
-
-import io.serverlessworkflow.api.types.FlowDirective;
-import io.serverlessworkflow.api.types.FlowDirectiveEnum;
-import io.serverlessworkflow.api.types.SwitchCase;
-import io.serverlessworkflow.api.types.SwitchItem;
-import io.serverlessworkflow.api.types.SwitchTask;
-import io.serverlessworkflow.api.types.utils.TaskPredicate;
-import io.serverlessworkflow.fluent.func.spi.ConditionalTaskBuilder;
-import io.serverlessworkflow.fluent.func.spi.FuncTaskTransformations;
-import io.serverlessworkflow.fluent.spec.TaskBaseBuilder;
-import io.serverlessworkflow.fluent.spec.spi.SwitchTaskFluent;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
-import java.util.function.Consumer;
-import java.util.function.Predicate;
-
-public class FuncSwitchTaskBuilder extends TaskBaseBuilder
- implements FuncTaskTransformations,
- ConditionalTaskBuilder,
- SwitchTaskFluent {
-
- private final SwitchTask switchTask;
- private final List switchItems;
-
- FuncSwitchTaskBuilder() {
- this.switchTask = new SwitchTask();
- this.switchItems = new ArrayList<>();
- super.setTask(switchTask);
- }
-
- @Override
- protected FuncSwitchTaskBuilder self() {
- return this;
- }
-
- public FuncSwitchTaskBuilder onPredicate(Consumer consumer) {
- return this.onPredicate(null, consumer);
- }
-
- public FuncSwitchTaskBuilder onPredicate(
- String name, Consumer consumer) {
- final SwitchCasePredicateBuilder switchCase =
- new SwitchCasePredicateBuilder(defaultItemNameIfBlank(name));
- consumer.accept(switchCase);
- final SwitchCase switchCaseValue = switchCase.build();
-
- // Handling default cases
- if (TaskPredicate.predicate(switchTask, switchCase.name) == null) {
- Objects.requireNonNull(switchCaseValue.getThen(), "Then is required");
- if (switchCaseValue.getThen().getFlowDirectiveEnum() != null) {
- return this.onDefault(switchCaseValue.getThen().getFlowDirectiveEnum());
- } else {
- return this.onDefault(switchCaseValue.getThen().getString());
- }
- }
- this.switchItems.add(new SwitchItem(switchCase.name, switchCase.build()));
- return this;
- }
-
- @Override
- public FuncSwitchTaskBuilder on(String name, Consumer switchCaseConsumer) {
- final SwitchCaseBuilder switchCase = new SwitchCaseBuilder();
- switchCaseConsumer.accept(switchCase);
- this.switchItems.add(new SwitchItem(defaultItemNameIfBlank(name), switchCase.build()));
- return this;
- }
-
- @Override
- public int switchItemCount() {
- return this.switchItems.size();
- }
-
- public SwitchTask build() {
- this.switchTask.setSwitch(this.switchItems);
- return switchTask;
- }
-
- public final class SwitchCasePredicateBuilder {
- private final SwitchCase switchCase;
- private final String name;
-
- SwitchCasePredicateBuilder(String name) {
- this.name = name;
- this.switchCase = new SwitchCase();
- }
-
- public SwitchCasePredicateBuilder when(Predicate when) {
- TaskPredicate.withPredicate(FuncSwitchTaskBuilder.this.switchTask, name, when);
- return this;
- }
-
- public SwitchCasePredicateBuilder when(Predicate when, Class whenClass) {
- TaskPredicate.withPredicate(FuncSwitchTaskBuilder.this.switchTask, name, when, whenClass);
- return this;
- }
-
- public SwitchCasePredicateBuilder then(String taskName) {
- this.switchCase.setThen(new FlowDirective().withString(taskName));
- return this;
- }
-
- public SwitchCasePredicateBuilder then(FlowDirectiveEnum then) {
- this.switchCase.setThen(new FlowDirective().withFlowDirectiveEnum(then));
- return this;
- }
-
- public SwitchCase build() {
- return this.switchCase;
- }
- }
-}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncTaskItemListBuilder.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncTaskItemListBuilder.java
deleted file mode 100644
index 86daac8cd..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncTaskItemListBuilder.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * 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.func;
-
-import io.serverlessworkflow.api.types.CallGRPC;
-import io.serverlessworkflow.api.types.CallHTTP;
-import io.serverlessworkflow.api.types.CallOpenAPI;
-import io.serverlessworkflow.api.types.CallTask;
-import io.serverlessworkflow.api.types.Task;
-import io.serverlessworkflow.api.types.TaskItem;
-import io.serverlessworkflow.fluent.func.spi.FuncDoFluent;
-import io.serverlessworkflow.fluent.spec.BaseTaskItemListBuilder;
-import io.serverlessworkflow.fluent.spec.TaskItemListBuilder;
-import io.serverlessworkflow.fluent.spec.WaitTaskBuilder;
-import io.serverlessworkflow.fluent.spec.WorkflowTaskBuilder;
-import java.util.List;
-import java.util.Map;
-import java.util.function.Consumer;
-
-public class FuncTaskItemListBuilder extends BaseTaskItemListBuilder
- implements FuncDoFluent {
-
- protected static final String TYPE_FUNCTION = "function";
-
- public FuncTaskItemListBuilder(final int listOffsetSize) {
- super(listOffsetSize);
- }
-
- public FuncTaskItemListBuilder(final List list) {
- super(list);
- }
-
- @Override
- protected FuncTaskItemListBuilder self() {
- return this;
- }
-
- @Override
- protected FuncTaskItemListBuilder newItemListBuilder(int listOffsetSize) {
- return new FuncTaskItemListBuilder(listOffsetSize);
- }
-
- @Override
- public FuncTaskItemListBuilder function(String name, Consumer consumer) {
- name = this.defaultNameAndRequireConfig(name, consumer, TYPE_FUNCTION);
- final FuncCallTaskBuilder callTaskJavaBuilder = new FuncCallTaskBuilder();
- consumer.accept(callTaskJavaBuilder);
- return addTaskItem(new TaskItem(name, new Task().withCallTask(callTaskJavaBuilder.build())));
- }
-
- @Override
- public FuncTaskItemListBuilder function(Consumer consumer) {
- return this.function(null, consumer);
- }
-
- @Override
- public FuncTaskItemListBuilder set(String name, Consumer itemsConfigurer) {
- name = this.defaultNameAndRequireConfig(name, itemsConfigurer, TYPE_SET);
- final FuncSetTaskBuilder funcSetTaskBuilder = new FuncSetTaskBuilder();
- itemsConfigurer.accept(funcSetTaskBuilder);
- return this.addTaskItem(new TaskItem(name, new Task().withSetTask(funcSetTaskBuilder.build())));
- }
-
- @Override
- public FuncTaskItemListBuilder set(String name, String expr) {
- return this.set(name, s -> s.expr(expr));
- }
-
- public FuncTaskItemListBuilder set(String name, Map map) {
- return this.set(name, s -> s.expr(map));
- }
-
- @Override
- public FuncTaskItemListBuilder emit(String name, Consumer itemsConfigurer) {
- name = this.defaultNameAndRequireConfig(name, itemsConfigurer, TYPE_EMIT);
- final FuncEmitTaskBuilder emitTaskJavaBuilder = new FuncEmitTaskBuilder();
- itemsConfigurer.accept(emitTaskJavaBuilder);
- return this.addTaskItem(
- new TaskItem(name, new Task().withEmitTask(emitTaskJavaBuilder.build())));
- }
-
- @Override
- public FuncTaskItemListBuilder listen(
- String name, Consumer itemsConfigurer) {
- name = this.defaultNameAndRequireConfig(name, itemsConfigurer, TYPE_LISTEN);
- final FuncListenTaskBuilder listenTaskJavaBuilder = new FuncListenTaskBuilder(this);
- itemsConfigurer.accept(listenTaskJavaBuilder);
- return this.addTaskItem(
- new TaskItem(name, new Task().withListenTask(listenTaskJavaBuilder.build())));
- }
-
- @Override
- public FuncTaskItemListBuilder raise(
- String name, Consumer itemsConfigurer) {
- name = this.defaultNameAndRequireConfig(name, itemsConfigurer, TYPE_RAISE);
- final FuncRaiseTaskBuilder raiseTaskJavaBuilder = new FuncRaiseTaskBuilder();
- itemsConfigurer.accept(raiseTaskJavaBuilder);
- return this.addTaskItem(
- new TaskItem(name, new Task().withRaiseTask(raiseTaskJavaBuilder.build())));
- }
-
- @Override
- public FuncTaskItemListBuilder forEach(
- String name, Consumer itemsConfigurer) {
- name = this.defaultNameAndRequireConfig(name, itemsConfigurer, TYPE_FOR);
- final FuncForTaskBuilder forTaskJavaBuilder = new FuncForTaskBuilder();
- itemsConfigurer.accept(forTaskJavaBuilder);
- return this.addTaskItem(new TaskItem(name, new Task().withForTask(forTaskJavaBuilder.build())));
- }
-
- @Override
- public FuncTaskItemListBuilder switchCase(
- String name, Consumer itemsConfigurer) {
- name = this.defaultNameAndRequireConfig(name, itemsConfigurer, TYPE_SWITCH);
- final FuncSwitchTaskBuilder funcSwitchTaskBuilder = new FuncSwitchTaskBuilder();
- itemsConfigurer.accept(funcSwitchTaskBuilder);
- return this.addTaskItem(
- new TaskItem(name, new Task().withSwitchTask(funcSwitchTaskBuilder.build())));
- }
-
- @Override
- public FuncTaskItemListBuilder fork(String name, Consumer itemsConfigurer) {
- name = this.defaultNameAndRequireConfig(name, itemsConfigurer, TYPE_FORK);
- final FuncForkTaskBuilder forkTaskJavaBuilder = new FuncForkTaskBuilder();
- itemsConfigurer.accept(forkTaskJavaBuilder);
- return this.addTaskItem(
- new TaskItem(name, new Task().withForkTask(forkTaskJavaBuilder.build())));
- }
-
- @Override
- public FuncTaskItemListBuilder http(
- String name, Consumer itemsConfigurer) {
- name = this.defaultNameAndRequireConfig(name, itemsConfigurer, TYPE_HTTP);
-
- final FuncCallHttpTaskBuilder httpTaskJavaBuilder = new FuncCallHttpTaskBuilder();
- itemsConfigurer.accept(httpTaskJavaBuilder);
-
- final CallHTTP callHTTP = httpTaskJavaBuilder.build();
- final CallTask callTask = new CallTask();
- callTask.setCallHTTP(callHTTP);
- final Task task = new Task();
- task.setCallTask(callTask);
-
- return this.addTaskItem(new TaskItem(name, task));
- }
-
- @Override
- public FuncTaskItemListBuilder openapi(
- String name, Consumer itemsConfigurer) {
- name = this.defaultNameAndRequireConfig(name, itemsConfigurer, TYPE_OPENAPI);
-
- final FuncCallOpenAPITaskBuilder openAPITaskBuilder = new FuncCallOpenAPITaskBuilder();
- itemsConfigurer.accept(openAPITaskBuilder);
-
- final CallOpenAPI callOpenAPI = openAPITaskBuilder.build();
- final CallTask callTask = new CallTask();
- callTask.setCallOpenAPI(callOpenAPI);
- final Task task = new Task();
- task.setCallTask(callTask);
-
- return this.addTaskItem(new TaskItem(name, task));
- }
-
- @Override
- public FuncTaskItemListBuilder grpc(
- String name, Consumer itemsConfigurer) {
- name = this.defaultNameAndRequireConfig(name, itemsConfigurer, TYPE_GRPC);
-
- final FuncCallGrpcTaskBuilder grpcTaskBuilder = new FuncCallGrpcTaskBuilder();
- itemsConfigurer.accept(grpcTaskBuilder);
-
- final CallGRPC callGRPC = grpcTaskBuilder.build();
- final CallTask callTask = new CallTask();
- callTask.setCallGRPC(callGRPC);
- final Task task = new Task();
- task.setCallTask(callTask);
-
- return this.addTaskItem(new TaskItem(name, task));
- }
-
- @Override
- public FuncTaskItemListBuilder workflow(
- String name, Consumer itemsConfigurer) {
- return this.addDelegatedWorkflow(name, itemsConfigurer, TYPE_WORKFLOW);
- }
-
- @Override
- public FuncTaskItemListBuilder workflow(Consumer itemsConfigurer) {
- return this.workflow(null, itemsConfigurer);
- }
-
- @Override
- public FuncTaskItemListBuilder subflow(
- String name, Consumer itemsConfigurer) {
- return this.addDelegatedWorkflow(name, itemsConfigurer, TYPE_WORKFLOW);
- }
-
- @Override
- public FuncTaskItemListBuilder subflow(Consumer itemsConfigurer) {
- return this.subflow(null, itemsConfigurer);
- }
-
- private FuncTaskItemListBuilder addDelegatedWorkflow(
- String name, Consumer itemsConfigurer, String delegateType) {
- name = this.defaultNameAndRequireConfig(name, itemsConfigurer, delegateType);
- // Preserve the original offset when delegating to avoid duplicate task names
- // across appended .tasks(...) blocks
- final int effectiveOffset = this.getOffset() + this.mutableList().size();
- final TaskItemListBuilder delegate = new TaskItemListBuilder(effectiveOffset);
- delegate.workflow(name, itemsConfigurer);
- final List taskItems = delegate.build();
- if (taskItems.size() != 1) {
- throw new IllegalStateException(
- String.format(
- "Expected %s delegate '%s' to build exactly 1 TaskItem, but got %d",
- delegateType, name, taskItems.size()));
- }
- return addTaskItem(taskItems.get(0));
- }
-
- @Override
- public FuncTaskItemListBuilder tryCatch(
- String name, Consumer itemsConfigurer) {
- name = this.defaultNameAndRequireConfig(name, itemsConfigurer, TYPE_TRY);
- final FuncTryTaskBuilder tryTaskBuilder = new FuncTryTaskBuilder();
- itemsConfigurer.accept(tryTaskBuilder);
- return this.addTaskItem(new TaskItem(name, new Task().withTryTask(tryTaskBuilder.build())));
- }
-
- public FuncTaskItemListBuilder wait(Consumer itemsConfigurer) {
- return wait(null, itemsConfigurer);
- }
-
- public FuncTaskItemListBuilder wait(String name, Consumer itemsConfigurer) {
- name = this.defaultNameAndRequireConfig(name, itemsConfigurer, TYPE_WAIT);
- final WaitTaskBuilder waitTaskBuilder = new WaitTaskBuilder();
- itemsConfigurer.accept(waitTaskBuilder);
- return this.addTaskItem(new TaskItem(name, new Task().withWaitTask(waitTaskBuilder.build())));
- }
-}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncTryTaskBuilder.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncTryTaskBuilder.java
deleted file mode 100644
index b9f8640b8..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncTryTaskBuilder.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * 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.func;
-
-import io.serverlessworkflow.fluent.func.spi.ConditionalTaskBuilder;
-import io.serverlessworkflow.fluent.func.spi.FuncTaskTransformations;
-import io.serverlessworkflow.fluent.spec.BaseTryTaskBuilder;
-import java.util.function.Consumer;
-
-public class FuncTryTaskBuilder
- extends BaseTryTaskBuilder
- implements FuncTaskTransformations,
- ConditionalTaskBuilder {
-
- FuncTryTaskBuilder() {
- super(new FuncTaskItemListBuilder(0));
- }
-
- @Override
- protected FuncTryTaskBuilder self() {
- return this;
- }
-
- /**
- * Defines the tasks to execute within the try.
- *
- * @param tryHandler a consumer that configures the tasks to be executed in the try
- * @return this builder instance for method chaining
- */
- public FuncTryTaskBuilder tryCatch(Consumer tryHandler) {
- return this.tryHandler(tryHandler);
- }
-
- /**
- * Defines a catch that handles specific errors and executes tasks when those errors occur.
- *
- * @param catchErrors a consumer that configures which errors to catch (e.g., by type, status
- * code)
- * @param catchHandler a consumer that configures the tasks to execute when the specified errors
- * are caught
- * @return this builder instance for method chaining
- */
- public FuncTryTaskBuilder catchError(
- Consumer catchErrors, Consumer catchHandler) {
- return this.catchHandler(handler -> handler.errorsWith(catchErrors).doTasks(catchHandler));
- }
-
- /**
- * Defines a conditional catch that executes tasks when a specific condition is met.
- *
- * @param expr a runtime expression that evaluates to a boolean, determining whether to execute
- * the catch handler
- * @param catchHandler a consumer that configures the tasks to execute when the condition
- * evaluates to true
- * @return this builder instance for method chaining
- */
- public FuncTryTaskBuilder catchWhen(String expr, Consumer catchHandler) {
- return this.catchHandler(handler -> handler.when(expr).doTasks(catchHandler));
- }
-
- /**
- * Defines a catch that handles errors of a specific type.
- *
- * @param type the error type to catch (e.g., "java.lang.NullPointerException")
- * @param catchHandler a consumer that configures the tasks to execute when an error of the
- * specified type is caught
- * @return this builder instance for method chaining
- */
- public FuncTryTaskBuilder catchType(String type, Consumer catchHandler) {
- return this.catchHandler(
- handler -> handler.errorsWith(err -> err.type(type)).doTasks(catchHandler));
- }
-}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncWorkflowBuilder.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncWorkflowBuilder.java
deleted file mode 100644
index 6f5dd62f7..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncWorkflowBuilder.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * 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.func;
-
-import static io.serverlessworkflow.types.Defaults.DEFAULT_NAMESPACE;
-import static io.serverlessworkflow.types.Defaults.DEFAULT_VERSION;
-
-import io.serverlessworkflow.fluent.func.spi.FuncTransformations;
-import io.serverlessworkflow.fluent.spec.BaseWorkflowBuilder;
-import java.util.UUID;
-
-public class FuncWorkflowBuilder
- extends BaseWorkflowBuilder
- implements FuncTransformations {
-
- protected FuncWorkflowBuilder(final String name, final String namespace, final String version) {
- super(name, namespace, version);
- }
-
- public static FuncWorkflowBuilder workflow(
- final String name, final String namespace, final String version) {
- return new FuncWorkflowBuilder(name, namespace, version);
- }
-
- public static FuncWorkflowBuilder workflow(final String name, final String namespace) {
- return new FuncWorkflowBuilder(name, namespace, DEFAULT_VERSION);
- }
-
- public static FuncWorkflowBuilder workflow(final String name) {
- return new FuncWorkflowBuilder(name, DEFAULT_NAMESPACE, DEFAULT_VERSION);
- }
-
- public static FuncWorkflowBuilder workflow() {
- return new FuncWorkflowBuilder(
- UUID.randomUUID().toString(), DEFAULT_NAMESPACE, DEFAULT_VERSION);
- }
-
- @Override
- protected FuncDoTaskBuilder newDo(int listSizeOffset) {
- return new FuncDoTaskBuilder(listSizeOffset);
- }
-
- @Override
- protected FuncWorkflowBuilder self() {
- return this;
- }
-}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/configurers/FuncCallGrpcConfigurer.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/configurers/FuncCallGrpcConfigurer.java
deleted file mode 100644
index a3e552f50..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/configurers/FuncCallGrpcConfigurer.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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.func.configurers;
-
-import io.serverlessworkflow.fluent.func.FuncCallGrpcTaskBuilder;
-import java.util.function.Consumer;
-
-@FunctionalInterface
-public interface FuncCallGrpcConfigurer extends Consumer {}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/configurers/FuncCallHttpConfigurer.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/configurers/FuncCallHttpConfigurer.java
deleted file mode 100644
index d852f82ca..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/configurers/FuncCallHttpConfigurer.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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.func.configurers;
-
-import io.serverlessworkflow.fluent.func.FuncCallHttpTaskBuilder;
-import java.util.function.Consumer;
-
-@FunctionalInterface
-public interface FuncCallHttpConfigurer extends Consumer {}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/configurers/FuncCallOpenAPIConfigurer.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/configurers/FuncCallOpenAPIConfigurer.java
deleted file mode 100644
index 210b5792b..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/configurers/FuncCallOpenAPIConfigurer.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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.func.configurers;
-
-import io.serverlessworkflow.fluent.func.FuncCallOpenAPITaskBuilder;
-import java.util.function.Consumer;
-
-@FunctionalInterface
-public interface FuncCallOpenAPIConfigurer extends Consumer {}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/configurers/FuncEmitConfigurer.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/configurers/FuncEmitConfigurer.java
deleted file mode 100644
index 44e5fbd95..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/configurers/FuncEmitConfigurer.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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.func.configurers;
-
-import io.serverlessworkflow.fluent.func.FuncEmitTaskBuilder;
-import java.util.function.Consumer;
-
-@FunctionalInterface
-public interface FuncEmitConfigurer extends Consumer {}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/configurers/FuncListenConfigurer.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/configurers/FuncListenConfigurer.java
deleted file mode 100644
index ee18a05bf..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/configurers/FuncListenConfigurer.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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.func.configurers;
-
-import io.serverlessworkflow.fluent.func.FuncListenTaskBuilder;
-import java.util.function.Consumer;
-
-@FunctionalInterface
-public interface FuncListenConfigurer extends Consumer {}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/configurers/FuncTaskConfigurer.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/configurers/FuncTaskConfigurer.java
deleted file mode 100644
index e3815ad77..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/configurers/FuncTaskConfigurer.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * 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.func.configurers;
-
-import io.serverlessworkflow.fluent.func.FuncTaskItemListBuilder;
-import java.util.function.Consumer;
-
-public interface FuncTaskConfigurer extends Consumer {}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/configurers/SwitchCaseConfigurer.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/configurers/SwitchCaseConfigurer.java
deleted file mode 100644
index 55cf25c5a..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/configurers/SwitchCaseConfigurer.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * 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.func.configurers;
-
-import io.serverlessworkflow.fluent.func.FuncSwitchTaskBuilder;
-import java.util.function.Consumer;
-
-@FunctionalInterface
-public interface SwitchCaseConfigurer
- extends Consumer {}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/BaseFuncListenSpec.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/BaseFuncListenSpec.java
deleted file mode 100644
index 95d3f4ef3..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/BaseFuncListenSpec.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * 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.func.dsl;
-
-import io.serverlessworkflow.api.types.func.ContextPredicate;
-import io.serverlessworkflow.api.types.func.FilterPredicate;
-import io.serverlessworkflow.fluent.func.FuncEventFilterBuilder;
-import io.serverlessworkflow.fluent.func.FuncListenToBuilder;
-import io.serverlessworkflow.fluent.spec.dsl.BaseListenSpec;
-import java.util.Objects;
-import java.util.function.Consumer;
-import java.util.function.Predicate;
-
-public abstract class BaseFuncListenSpec
- extends BaseListenSpec {
-
- protected BaseFuncListenSpec(ToInvoker toInvoker) {
- super(
- toInvoker,
- // allApplier
- (tb, filters) -> tb.all(castFilters(filters)),
- // anyApplier
- (tb, filters) -> tb.any(castFilters(filters)),
- // oneApplier
- FuncListenToBuilder::one);
- }
-
- @SuppressWarnings("unchecked")
- private static Consumer[] castFilters(Consumer>[] arr) {
- return (Consumer[]) arr;
- }
-
- public SELF until(Predicate predicate, Class predClass) {
- Objects.requireNonNull(predicate, "predicate");
- this.setUntilStep(u -> u.until(predicate, predClass));
- return self();
- }
-
- public SELF until(ContextPredicate predicate, Class predClass) {
- Objects.requireNonNull(predicate, "predicate");
- this.setUntilStep(u -> u.until(predicate, predClass));
- return self();
- }
-
- public SELF until(FilterPredicate predicate, Class predClass) {
- Objects.requireNonNull(predicate, "predicate");
- this.setUntilStep(u -> u.until(predicate, predClass));
- return self();
- }
-}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/CommonFuncOps.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/CommonFuncOps.java
deleted file mode 100644
index 1bc386294..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/CommonFuncOps.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * 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.func.dsl;
-
-import io.serverlessworkflow.api.types.FlowDirectiveEnum;
-import io.serverlessworkflow.api.types.func.SerializableFunction;
-import io.serverlessworkflow.api.types.func.SerializablePredicate;
-import io.serverlessworkflow.api.types.utils.ReflectionUtils;
-import io.serverlessworkflow.fluent.func.FuncCallTaskBuilder;
-import io.serverlessworkflow.fluent.func.FuncSwitchTaskBuilder;
-import io.serverlessworkflow.fluent.func.configurers.SwitchCaseConfigurer;
-import java.util.function.Consumer;
-import java.util.function.Function;
-import java.util.function.Predicate;
-
-interface CommonFuncOps {
-
- default Consumer fn(Function function, Class argClass) {
- return f -> f.function(function, argClass);
- }
-
- default Consumer fn(SerializableFunction function) {
- Class clazz = ReflectionUtils.inferInputType(function);
- return f -> f.function(function, clazz);
- }
-
- default Consumer cases(SwitchCaseConfigurer... cases) {
- return s -> {
- for (SwitchCaseConfigurer c : cases) {
- s.onPredicate(c);
- }
- };
- }
-
- default SwitchCaseSpec caseOf(Predicate when, Class whenClass) {
- return new SwitchCaseSpec().when(when, whenClass);
- }
-
- default SwitchCaseSpec caseOf(SerializablePredicate when) {
- return new SwitchCaseSpec().when(when, ReflectionUtils.inferInputType(when));
- }
-
- default SwitchCaseConfigurer caseDefault(String task) {
- return s -> s.then(task);
- }
-
- default SwitchCaseConfigurer caseDefault(FlowDirectiveEnum directive) {
- return s -> s.then(directive);
- }
-}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/ConsumeStep.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/ConsumeStep.java
deleted file mode 100644
index ae968ed91..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/ConsumeStep.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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.func.dsl;
-
-import io.serverlessworkflow.fluent.func.FuncCallTaskBuilder;
-import io.serverlessworkflow.fluent.func.FuncTaskItemListBuilder;
-import java.util.function.Consumer;
-
-public final class ConsumeStep extends Step, FuncCallTaskBuilder> {
- private final String name; // may be null
- private final Consumer consumer;
- private final Class argClass; // may be null
-
- ConsumeStep(Consumer consumer, Class argClass) {
- this(null, consumer, argClass);
- }
-
- ConsumeStep(String name, Consumer consumer, Class argClass) {
- this.name = name;
- this.consumer = consumer;
- this.argClass = argClass;
- }
-
- @Override
- protected void configure(FuncTaskItemListBuilder list, Consumer post) {
- if (name == null) {
- list.function(
- cb -> {
- // prefer the typed consumer if your builder supports it; otherwise fallback:
- if (argClass != null) cb.consumer(consumer, argClass);
- else cb.consumer(consumer);
- post.accept(cb);
- });
- } else {
- list.function(
- name,
- cb -> {
- if (argClass != null) cb.consumer(consumer, argClass);
- else cb.consumer(consumer);
- post.accept(cb);
- });
- }
- }
-}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/CtxBiFunction.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/CtxBiFunction.java
deleted file mode 100644
index 5668ab6ad..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/CtxBiFunction.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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.func.dsl;
-
-import io.serverlessworkflow.impl.WorkflowContextData;
-
-/**
- * Functions that expect a {@link WorkflowContextData} injection in runtime
- *
- * @param The task payload input
- * @param The task result output
- */
-@FunctionalInterface
-public interface CtxBiFunction {
- R apply(WorkflowContextData context, T payload);
-}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/EmitStep.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/EmitStep.java
deleted file mode 100644
index 89c2402d4..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/EmitStep.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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.func.dsl;
-
-import io.serverlessworkflow.fluent.func.FuncEmitTaskBuilder;
-import io.serverlessworkflow.fluent.func.FuncTaskItemListBuilder;
-import java.util.Objects;
-import java.util.function.Consumer;
-
-/** Chainable emit step; applies FuncEmitSpec then queued export/when. */
-public final class EmitStep extends Step {
-
- private final String name; // nullable
- private final Consumer cfg;
-
- EmitStep(String name, Consumer cfg) {
- this.name = name;
- this.cfg = Objects.requireNonNull(cfg, "cfg");
- }
-
- @Override
- protected void configure(FuncTaskItemListBuilder list, Consumer postApply) {
- if (name == null) {
- list.emit(
- e -> {
- cfg.accept(e);
- postApply.accept(e);
- });
- } else {
- list.emit(
- name,
- e -> {
- cfg.accept(e);
- postApply.accept(e);
- });
- }
- }
-}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/FuncCallGrpcStep.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/FuncCallGrpcStep.java
deleted file mode 100644
index daa93ad6f..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/FuncCallGrpcStep.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * 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.func.dsl;
-
-import io.serverlessworkflow.fluent.func.FuncCallGrpcTaskBuilder;
-import io.serverlessworkflow.fluent.func.FuncTaskItemListBuilder;
-import io.serverlessworkflow.fluent.spec.configurers.AuthenticationConfigurer;
-import io.serverlessworkflow.fluent.spec.spi.CallGrpcTaskFluent;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.function.Consumer;
-
-public class FuncCallGrpcStep extends Step {
-
- private final List>> steps = new ArrayList<>();
-
- private String name;
-
- public FuncCallGrpcStep(String name) {
- this.name = name;
- }
-
- public FuncCallGrpcStep() {}
-
- public void setName(String name) {
- this.name = name;
- }
-
- public FuncCallGrpcStep proto(String uri) {
- steps.add(b -> b.proto(uri));
- return this;
- }
-
- public FuncCallGrpcStep proto(String uri, AuthenticationConfigurer authenticationConfigurer) {
- steps.add(b -> b.proto(uri, authenticationConfigurer));
- return this;
- }
-
- public FuncCallGrpcStep service(String name, String host) {
- steps.add(b -> b.service(name, host));
- return this;
- }
-
- public FuncCallGrpcStep service(String name, String host, int port) {
- steps.add(b -> b.service(name, host, port));
- return this;
- }
-
- public FuncCallGrpcStep method(String method) {
- steps.add(b -> b.method(method));
- return this;
- }
-
- public FuncCallGrpcStep argument(String name, Object value) {
- steps.add(b -> b.argument(name, value));
- return this;
- }
-
- public FuncCallGrpcStep arguments(java.util.Map arguments) {
- steps.add(b -> b.arguments(arguments));
- return this;
- }
-
- public FuncCallGrpcStep authentication(AuthenticationConfigurer authenticationConfigurer) {
- steps.add(b -> b.authentication(authenticationConfigurer));
- return this;
- }
-
- @Override
- protected void configure(FuncTaskItemListBuilder list, Consumer post) {
- list.grpc(
- name,
- builder -> {
- for (Consumer> c : steps) {
- c.accept(builder);
- }
- post.accept(builder);
- });
- }
-}
diff --git a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/FuncCallHttpStep.java b/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/FuncCallHttpStep.java
deleted file mode 100644
index 5e7246281..000000000
--- a/experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/FuncCallHttpStep.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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.func.dsl;
-
-import io.serverlessworkflow.fluent.func.FuncCallHttpTaskBuilder;
-import io.serverlessworkflow.fluent.func.FuncTaskItemListBuilder;
-import io.serverlessworkflow.fluent.spec.dsl.BaseCallHttpSpec;
-import io.serverlessworkflow.fluent.spec.spi.CallHttpTaskFluent;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.function.Consumer;
-
-public class FuncCallHttpStep extends Step
- implements BaseCallHttpSpec {
-
- private final List>> steps = new ArrayList<>();
-
- private String name;
-
- public FuncCallHttpStep(String name) {
- this.name = name;
- }
-
- public FuncCallHttpStep() {}
-
- @Override
- public FuncCallHttpStep self() {
- return this;
- }
-
- protected void configure(FuncTaskItemListBuilder list, Consumer