Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,22 @@ public static TasksConfigurer call(CallOpenAPIConfigurer configurer) {
return list -> list.openapi(configurer);
}

public static TasksConfigurer workflow(WorkflowConfigurer configurer) {
/**
* Create a {@link TasksConfigurer} that adds a sub-workflow call task using a {@link
* WorkflowConfigurer}.
*
* <p>
*
* <pre>{@code
* tasks(
* subflow(workflow("org.acme", "sub-workflow", "0.1.0").input(...)
* );
* }</pre>
*
* @param configurer
* @return
*/
public static TasksConfigurer subflow(WorkflowConfigurer configurer) {
return list -> list.workflow(configurer);
}
Comment thread
mcruzdev marked this conversation as resolved.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import static io.serverlessworkflow.fluent.spec.dsl.DSL.openapi;
import static io.serverlessworkflow.fluent.spec.dsl.DSL.produced;
import static io.serverlessworkflow.fluent.spec.dsl.DSL.secrets;
import static io.serverlessworkflow.fluent.spec.dsl.DSL.subflow;
import static io.serverlessworkflow.fluent.spec.dsl.DSL.to;
import static io.serverlessworkflow.fluent.spec.dsl.DSL.workflow;
import static org.assertj.core.api.Assertions.assertThat;
Expand Down Expand Up @@ -308,7 +309,7 @@ void when_dsl_subflow_workflow_task() {
Workflow wf =
WorkflowBuilder.workflow("parent", "ns", "1")
.tasks(
workflow(
subflow(
workflow("child.ns", "child-flow", "2.3.4")
.input("id", 99)
.await(false)
Expand All @@ -330,7 +331,7 @@ void when_dsl_subflow_workflow_task_with_map_input() {
Workflow wf =
WorkflowBuilder.workflow("parent", "ns", "1")
.tasks(
workflow(
subflow(
workflow("child.ns", "child-flow", "2.3.4")
.input(Map.of("id", 7, "region", "eu"))
.input("extra", true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public void runSubWorkflowFromDslTest() throws Exception {
Workflow parent =
WorkflowBuilder.workflow("parentFlow", "org.acme", "1.0.0")
.tasks(
DSL.workflow(
DSL.subflow(
DSL.workflow("org.acme", "childFlow", "1.0.0")
.input(Map.of("id", 42, "region", "us-east"))))
.build();
Expand Down
Loading