Skip to content

Commit 562e9d8

Browse files
committed
no try-catch-blocks
Signed-off-by: Dmitrii Tikhomirov <[email protected]>
1 parent 601fa63 commit 562e9d8

File tree

1 file changed

+7
-22
lines changed
  • experimental/fluent/agentic/src/test/java/io/serverlessworkflow/fluent/agentic

1 file changed

+7
-22
lines changed

experimental/fluent/agentic/src/test/java/io/serverlessworkflow/fluent/agentic/README.md

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,7 @@ String story = (String) novelCreator.invoke(input);
9797
&nbsp;
9898
&nbsp;
9999

100-
try (WorkflowApplication app = WorkflowApplication.builder().build()) {
101-
String result = app.workflowDefinition(wf).instance(input).start().get().asText().orElseThrow();
102-
} catch (Exception e) {
103-
throw new RuntimeException("Workflow execution failed", e);
104-
}
100+
String result = app.workflowDefinition(wf).instance(input).start().get().asText().orElseThrow();
105101

106102
</code>
107103
</pre>
@@ -194,11 +190,7 @@ Workflow wf = workflow("retryFlow")
194190
&nbsp;
195191
&nbsp;
196192
&nbsp;
197-
try (WorkflowApplication app = WorkflowApplication.builder().build()) {
198-
String result = app.workflowDefinition(wf).instance(input).start().get().asText().orElseThrow();
199-
} catch (Exception e) {
200-
throw new RuntimeException("Workflow execution failed", e);
201-
}
193+
String result = app.workflowDefinition(wf).instance(input).start().get().asText().orElseThrow();
202194

203195
</code>
204196
</pre>
@@ -304,13 +296,10 @@ Workflow wf = workflow("forkFlow")
304296
&nbsp;
305297
&nbsp;
306298
&nbsp;
299+
&nbsp;
307300
Map&lt;String, Object> input = Map.of("mood", "I am hungry and bored");
308301

309-
try (WorkflowApplication app = WorkflowApplication.builder().build()) {
310-
Map<String, Object> result = app.workflowDefinition(wf).instance(input).start().get().asMap().orElseThrow();
311-
} catch (Exception e) {
312-
throw new RuntimeException("Workflow execution failed", e);
313-
}
302+
Map<String, Object> result = app.workflowDefinition(wf).instance(input).start().get().asMap().orElseThrow();
314303

315304
</code>
316305
</pre>
@@ -390,13 +379,9 @@ Workflow wf = workflow("seqFlow")
390379
.sequence(astrologyAgent, humanInTheLoop)
391380
.build();
392381

393-
Map<String, Object> input = Map.of("request", "My name is Mario. What is my horoscope?");
394-
395-
try (WorkflowApplication app = WorkflowApplication.builder().build()) {
396-
String result = app.workflowDefinition(wf).instance(input).start().get().asMap().orElseThrow();
397-
} catch (Exception e) {
398-
throw new RuntimeException("Workflow execution failed", e);
399-
}
382+
&nbsp;
383+
&nbsp;
384+
String result = app.workflowDefinition(wf).instance("My name is Mario. What is my horoscope?").start().get().asMap().orElseThrow();
400385

401386
</code>
402387
</pre>

0 commit comments

Comments
 (0)