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