|
18 | 18 | import static io.serverlessworkflow.fluent.agentic.AgentWorkflowBuilder.workflow;
|
19 | 19 | import static io.serverlessworkflow.fluent.agentic.dsl.AgenticDSL.conditional;
|
20 | 20 | import static io.serverlessworkflow.fluent.agentic.dsl.AgenticDSL.doTasks;
|
21 |
| -import static io.serverlessworkflow.fluent.agentic.dsl.AgenticDSL.loop; |
22 |
| -import static io.serverlessworkflow.fluent.spec.dsl.DSL.tasks; |
23 | 21 | import static org.assertj.core.api.Assertions.assertThat;
|
24 | 22 | import static org.junit.jupiter.api.Assertions.assertEquals;
|
25 | 23 |
|
@@ -49,7 +47,7 @@ public void sequentialWorkflow() {
|
49 | 47 |
|
50 | 48 | Workflow wf =
|
51 | 49 | workflow("seqFlow")
|
52 |
| - .tasks(tasks -> tasks.sequence("process", creativeWriter, audienceEditor, styleEditor)) |
| 50 | + .sequence("process", creativeWriter, audienceEditor, styleEditor) |
53 | 51 | .build();
|
54 | 52 |
|
55 | 53 | List<TaskItem> items = wf.getDo();
|
@@ -120,8 +118,7 @@ public void loopWorkflowWithMaxIterations() {
|
120 | 118 |
|
121 | 119 | Predicate<AgenticScope> until = s -> s.readState("score", 0).doubleValue() >= 0.8;
|
122 | 120 |
|
123 |
| - Workflow wf = |
124 |
| - AgentWorkflowBuilder.workflow("retryFlow").tasks(loop(until, scorer, 5, editor)).build(); |
| 121 | + Workflow wf = workflow("retryFlow").loop(until, scorer, 5, editor).build(); |
125 | 122 |
|
126 | 123 | List<TaskItem> items = wf.getDo();
|
127 | 124 | assertThat(items).hasSize(1);
|
@@ -187,7 +184,7 @@ public void errorHandling() {
|
187 | 184 |
|
188 | 185 | Workflow wf =
|
189 | 186 | workflow("seqFlow")
|
190 |
| - .tasks(tasks -> tasks.sequence("process", creativeWriter, audienceEditor, styleEditor)) |
| 187 | + .sequence("process", creativeWriter, audienceEditor, styleEditor) |
191 | 188 | .build();
|
192 | 189 |
|
193 | 190 | List<TaskItem> items = wf.getDo();
|
|
0 commit comments