@@ -142,13 +142,12 @@ expected_stdout_lines:
142142 - 'Message Received from input: Seattle'
143143 - 'Sending message to output: SEATTLE'
144144 - 'Workflow finished with result: TOKYO, LONDON, SEATTLE'
145+ timeout_seconds: 20
145146background: true
146- sleep: 60
147- timeout_seconds: 60
148147-->
149148Execute the following script in order to run DemoChainWorker:
150149``` sh
151- dapr run --app-id demoworkflowworker --resources-path ./components/workflows --dapr-grpc-port 50001 -- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.chain.DemoChainWorker
150+ dapr run --app-id demoworkflowworker --resources-path ./components/workflows --dapr-grpc-port 50001 -- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.chain.DemoChainWorker 50001
152151```
153152
154153Once running, the logs will start displaying the different steps: First, you can see workflow is starting:
@@ -158,9 +157,20 @@ Once running, the logs will start displaying the different steps: First, you can
158157== APP == INFO: Durable Task worker is connecting to sidecar at 127.0.0.1:50001.
159158```
160159
160+ <!-- END_STEP -->
161+
162+ <!-- STEP
163+ name: Execute Chaining Pattern workflow
164+ match_order: none
165+ output_match_mode: substring
166+ expected_stdout_lines:
167+ - 'completed with result: TOKYO, LONDON, SEATTLE'
168+ timeout_seconds: 20
169+ background: true
170+ -->
161171Then, execute the following script in order to run DemoChainClient:
162172``` sh
163- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.chain.DemoChainClient
173+ sleep 10 && java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.chain.DemoChainClient 50001
164174```
165175<!-- END_STEP -->
166176
@@ -241,7 +251,7 @@ public class CountWordsActivity implements WorkflowActivity {
241251}
242252```
243253<!-- STEP
244- name: Run Chaining Pattern workflow
254+ name: Run FanInOut Pattern workflow
245255match_order: none
246256output_match_mode: substring
247257expected_stdout_lines:
@@ -251,20 +261,30 @@ expected_stdout_lines:
251261 - 'Activity returned: 17.'
252262 - 'Activity returned: 11.'
253263 - 'Workflow finished with result: 60'
264+ timeout_seconds: 20
254265background: true
255- sleep: 60
256- timeout_seconds: 60
257266-->
258267
259268Execute the following script in order to run DemoFanInOutWorker:
260269``` sh
261- dapr run --app-id demoworkflowworker --resources-path ./components/workflows --dapr-grpc-port 50001 -- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.faninout.DemoFanInOutWorker
270+ dapr run --app-id demoworkflowworker --resources-path ./components/workflows --dapr-grpc-port 50002 -- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.faninout.DemoFanInOutWorker 50002
262271```
263272
273+ <!-- END_STEP -->
274+
275+ <!-- STEP
276+ name: Execute FanInOut Pattern workflow
277+ match_order: none
278+ output_match_mode: substring
279+ expected_stdout_lines:
280+ - 'completed with result: 60'
281+ timeout_seconds: 20
282+ background: true
283+ -->
264284Execute the following script in order to run DemoFanInOutClient:
265285
266286``` sh
267- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.faninout.DemoFanInOutClient
287+ sleep 10 && java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.faninout.DemoFanInOutClient 50002
268288```
269289<!-- END_STEP -->
270290
@@ -294,7 +314,6 @@ and the client:
294314Started a new fan out/fan in model model workflow with instance ID: 092c1928-b5dd-4576-9468-300bf6aed986
295315workflow instance with ID: 092c1928-b5dd-4576-9468-300bf6aed986 completed with result: 60
296316```
297-
298317### Continue As New Pattern
299318` ContinueAsNew ` API allows you to restart the workflow with a new input.
300319
@@ -606,8 +625,6 @@ expected_stdout_lines:
606625 - "Registered Activity: CancelCarActivity"
607626 - "Successfully built dapr workflow runtime"
608627 - "Start workflow runtime"
609- - "Durable Task worker is connecting to sidecar at 127.0.0.1:50001."
610-
611628 - "Starting Workflow: io.dapr.examples.workflows.compensation.BookTripWorkflow"
612629 - "Starting Activity: io.dapr.examples.workflows.compensation.BookFlightActivity"
613630 - "Activity completed with result: Flight booked successfully"
@@ -625,18 +642,28 @@ expected_stdout_lines:
625642 - "Starting Activity: io.dapr.examples.workflows.compensation.CancelFlightActivity"
626643 - "Activity completed with result: Flight canceled successfully"
627644background: true
628- sleep: 60
629- timeout_seconds: 60
645+ timeout_seconds: 30
630646-->
631647
632648Execute the following script in order to run the BookTripWorker:
633649``` sh
634- dapr run --app-id book-trip-worker --resources-path ./components/workflows --dapr-grpc-port 50001 -- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.compensation.BookTripWorker
650+ dapr run --app-id book-trip-worker --resources-path ./components/workflows --dapr-grpc-port 50003 -- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.compensation.BookTripWorker 50003
635651```
636652
653+ <!-- END_STEP -->
654+
655+ <!-- STEP
656+ name: Execute Compensation Pattern workflow
657+ match_order: none
658+ output_match_mode: substring
659+ expected_stdout_lines:
660+ - 'Workflow failed, compensation applied'
661+ timeout_seconds: 30
662+ background: true
663+ -->
637664Once running, execute the following script to run the BookTripClient:
638665``` sh
639- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.compensation.BookTripClient
666+ sleep 15 && java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.compensation.BookTripClient 50003
640667```
641668<!-- END_STEP -->
642669
@@ -656,7 +683,7 @@ Key Points:
656683
657684### Suspend/Resume Pattern
658685
659- Workflow instances can be suspended and resumed. This example shows how to use the suspend and resume commands.
686+ Workflow instances can be suspended and resumed. This example shows how to use the suspend and resume commands.
660687
661688For testing the suspend and resume operations we will use the same workflow definition used by the DemoExternalEventWorkflow.
662689
@@ -669,26 +696,35 @@ match_order: none
669696output_match_mode: substring
670697expected_stdout_lines:
671698 - "Waiting for approval..."
672- - "Suspending Workflow Instance"
673- - "Workflow Instance Status: SUSPENDED"
674- - "Let's resume the Workflow Instance before sending the external event"
675- - "Workflow Instance Status: RUNNING"
676- - "Now that the instance is RUNNING again, lets send the external event."
677699 - "approval granted - do the approved action"
678700 - "Starting Activity: io.dapr.examples.workflows.externalevent.ApproveActivity"
679701 - "Running approval activity..."
680702 - "approval-activity finished"
681703background: true
682- sleep: 60
683- timeout_seconds: 60
704+ timeout_seconds: 30
684705-->
685706
686707``` sh
687- dapr run --app-id demoworkflowworker --resources-path ./components/workflows --dapr-grpc-port 50001 -- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.suspendresume.DemoSuspendResumeWorker
708+ dapr run --app-id demoworkflowworker --resources-path ./components/workflows --dapr-grpc-port 50004 -- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.suspendresume.DemoSuspendResumeWorker 50004
688709```
689710
711+ <!-- END_STEP -->
712+
713+ <!-- STEP
714+ name: Execute Suspend/Resume workflow
715+ match_order: none
716+ output_match_mode: substring
717+ expected_stdout_lines:
718+ - "Suspending Workflow Instance"
719+ - "Workflow Instance Status: SUSPENDED"
720+ - "Let's resume the Workflow Instance before sending the external event"
721+ - "Workflow Instance Status: RUNNING"
722+ - "Now that the instance is RUNNING again, lets send the external event."
723+ timeout_seconds: 30
724+ background: true
725+ -->
690726``` sh
691- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.suspendresume.DemoSuspendResumeClient
727+ sleep 15 && java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.suspendresume.DemoSuspendResumeClient 50004
692728```
693729
694730<!-- END_STEP -->
0 commit comments