@@ -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,19 @@ 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+ -->
161170Then, execute the following script in order to run DemoChainClient:
162171``` sh
163- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.chain.DemoChainClient
172+ sleep 10 && java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.chain.DemoChainClient 50001
164173```
165174<!-- END_STEP -->
166175
@@ -241,7 +250,7 @@ public class CountWordsActivity implements WorkflowActivity {
241250}
242251```
243252<!-- STEP
244- name: Run Chaining Pattern workflow
253+ name: Run FanInOut Pattern workflow
245254match_order: none
246255output_match_mode: substring
247256expected_stdout_lines:
@@ -251,20 +260,29 @@ expected_stdout_lines:
251260 - 'Activity returned: 17.'
252261 - 'Activity returned: 11.'
253262 - 'Workflow finished with result: 60'
263+ timeout_seconds: 20
254264background: true
255- sleep: 60
256- timeout_seconds: 60
257265-->
258266
259267Execute the following script in order to run DemoFanInOutWorker:
260268``` 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
269+ 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
262270```
263271
272+ <!-- END_STEP -->
273+
274+ <!-- STEP
275+ name: Execute FanInOut Pattern workflow
276+ match_order: none
277+ output_match_mode: substring
278+ expected_stdout_lines:
279+ - 'completed with result: 60'
280+ timeout_seconds: 20
281+ -->
264282Execute the following script in order to run DemoFanInOutClient:
265283
266284``` sh
267- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.faninout.DemoFanInOutClient
285+ sleep 10 && java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.faninout.DemoFanInOutClient 50002
268286```
269287<!-- END_STEP -->
270288
@@ -294,7 +312,6 @@ and the client:
294312Started a new fan out/fan in model model workflow with instance ID: 092c1928-b5dd-4576-9468-300bf6aed986
295313workflow instance with ID: 092c1928-b5dd-4576-9468-300bf6aed986 completed with result: 60
296314```
297-
298315### Continue As New Pattern
299316` ContinueAsNew ` API allows you to restart the workflow with a new input.
300317
@@ -606,8 +623,6 @@ expected_stdout_lines:
606623 - "Registered Activity: CancelCarActivity"
607624 - "Successfully built dapr workflow runtime"
608625 - "Start workflow runtime"
609- - "Durable Task worker is connecting to sidecar at 127.0.0.1:50001."
610-
611626 - "Starting Workflow: io.dapr.examples.workflows.compensation.BookTripWorkflow"
612627 - "Starting Activity: io.dapr.examples.workflows.compensation.BookFlightActivity"
613628 - "Activity completed with result: Flight booked successfully"
@@ -625,18 +640,27 @@ expected_stdout_lines:
625640 - "Starting Activity: io.dapr.examples.workflows.compensation.CancelFlightActivity"
626641 - "Activity completed with result: Flight canceled successfully"
627642background: true
628- sleep: 60
629- timeout_seconds: 60
643+ timeout_seconds: 30
630644-->
631645
632646Execute the following script in order to run the BookTripWorker:
633647``` 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
648+ 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
635649```
636650
651+ <!-- END_STEP -->
652+
653+ <!-- STEP
654+ name: Execute Compensation Pattern workflow
655+ match_order: none
656+ output_match_mode: substring
657+ expected_stdout_lines:
658+ - 'Workflow failed, compensation applied'
659+ timeout_seconds: 30
660+ -->
637661Once running, execute the following script to run the BookTripClient:
638662``` sh
639- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.compensation.BookTripClient
663+ sleep 15 && java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.compensation.BookTripClient 50003
640664```
641665<!-- END_STEP -->
642666
@@ -656,7 +680,7 @@ Key Points:
656680
657681### Suspend/Resume Pattern
658682
659- Workflow instances can be suspended and resumed. This example shows how to use the suspend and resume commands.
683+ Workflow instances can be suspended and resumed. This example shows how to use the suspend and resume commands.
660684
661685For testing the suspend and resume operations we will use the same workflow definition used by the DemoExternalEventWorkflow.
662686
@@ -669,26 +693,34 @@ match_order: none
669693output_match_mode: substring
670694expected_stdout_lines:
671695 - "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."
677696 - "approval granted - do the approved action"
678697 - "Starting Activity: io.dapr.examples.workflows.externalevent.ApproveActivity"
679698 - "Running approval activity..."
680699 - "approval-activity finished"
681700background: true
682- sleep: 60
683- timeout_seconds: 60
701+ timeout_seconds: 30
684702-->
685703
686704``` 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
705+ 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
688706```
689707
708+ <!-- END_STEP -->
709+
710+ <!-- STEP
711+ name: Execute Suspend/Resume workflow
712+ match_order: none
713+ output_match_mode: substring
714+ expected_stdout_lines:
715+ - "Suspending Workflow Instance"
716+ - "Workflow Instance Status: SUSPENDED"
717+ - "Let's resume the Workflow Instance before sending the external event"
718+ - "Workflow Instance Status: RUNNING"
719+ - "Now that the instance is RUNNING again, lets send the external event."
720+ timeout_seconds: 30
721+ -->
690722``` sh
691- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.suspendresume.DemoSuspendResumeClient
723+ sleep 15 && java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.suspendresume.DemoSuspendResumeClient 50004
692724```
693725
694726<!-- END_STEP -->
0 commit comments