@@ -53,7 +53,7 @@ Those examples contain the following workflow patterns:
53534 . [ External Event Pattern] ( #external-event-pattern )
54545 . [ Child-workflow Pattern] ( #child-workflow-pattern )
55556 . [ Compensation Pattern] ( #compensation-pattern )
56- 7 . [ Cross -App Pattern] ( #cross -app-pattern )
56+ 7 . [ Multi -App Pattern] ( #multi -app-pattern )
5757
5858### Chaining Pattern
5959In the chaining pattern, a sequence of activities executes in a specific order.
@@ -682,49 +682,49 @@ Key Points:
6826824 . Each activity simulates work with a short delay for demonstration purposes
683683
684684
685- ### Cross -App Pattern
685+ ### Multi -App Pattern
686686
687- The cross -app pattern allows workflows to call activities that are hosted in different Dapr applications. This is useful for microservices architectures allowing multiple applications to host activities that can be orchestrated by Dapr Workflows.
687+ The multi -app pattern allows workflows to call activities that are hosted in different Dapr applications. This is useful for microservices architectures allowing multiple applications to host activities that can be orchestrated by Dapr Workflows.
688688
689- The ` CrossAppWorkflow ` class defines the workflow. It demonstrates calling activities in different apps using the ` appId ` parameter in ` WorkflowTaskOptions ` . See the code snippet below:
689+ The ` MultiAppWorkflow ` class defines the workflow. It demonstrates calling activities in different apps using the ` appId ` parameter in ` WorkflowTaskOptions ` . See the code snippet below:
690690``` java
691- public class CrossAppWorkflow implements Workflow {
691+ public class MultiAppWorkflow implements Workflow {
692692 @Override
693693 public WorkflowStub create () {
694694 return ctx - > {
695695 var logger = ctx. getLogger();
696696 logger. info(" === WORKFLOW STARTING ===" );
697- logger. info(" Starting CrossAppWorkflow : {}" , ctx. getName());
697+ logger. info(" Starting MultiAppWorkflow : {}" , ctx. getName());
698698 logger. info(" Workflow name: {}" , ctx. getName());
699699 logger. info(" Workflow instance ID: {}" , ctx. getInstanceId());
700700
701701 String input = ctx. getInput(String . class);
702- logger. info(" CrossAppWorkflow received input: {}" , input);
702+ logger. info(" MultiAppWorkflow received input: {}" , input);
703703 logger. info(" Workflow input: {}" , input);
704704
705705 // Call an activity in another app by passing in an active appID to the WorkflowTaskOptions
706- logger. info(" Calling cross -app activity in 'app2'..." );
707- logger. info(" About to call cross -app activity in app2..." );
708- String crossAppResult = ctx. callActivity(
706+ logger. info(" Calling multi -app activity in 'app2'..." );
707+ logger. info(" About to call multi -app activity in app2..." );
708+ String multiAppResult = ctx. callActivity(
709709 App2TransformActivity . class. getName(),
710710 input,
711711 new WorkflowTaskOptions (" app2" ),
712712 String . class
713713 ). await();
714714
715715 // Call another activity in a different app
716- logger. info(" Calling cross -app activity in 'app3'..." );
717- logger. info(" About to call cross -app activity in app3..." );
716+ logger. info(" Calling multi -app activity in 'app3'..." );
717+ logger. info(" About to call multi -app activity in app3..." );
718718 String finalResult = ctx. callActivity(
719719 App3FinalizeActivity . class. getName(),
720- crossAppResult ,
720+ multiAppResult ,
721721 new WorkflowTaskOptions (" app3" ),
722722 String . class
723723 ). await();
724- logger. info(" Final cross -app activity result: {}" , finalResult);
725- logger. info(" Final cross -app activity result: {}" , finalResult);
724+ logger. info(" Final multi -app activity result: {}" , finalResult);
725+ logger. info(" Final multi -app activity result: {}" , finalResult);
726726
727- logger. info(" CrossAppWorkflow finished with: {}" , finalResult);
727+ logger. info(" MultiAppWorkflow finished with: {}" , finalResult);
728728 logger. info(" === WORKFLOW COMPLETING WITH: {} ===" , finalResult);
729729 ctx. complete(finalResult);
730730 };
@@ -784,31 +784,31 @@ public class App3FinalizeActivity implements WorkflowActivity {
784784
785785** Important Limitations:**
786786- ** Cross-app calls are currently supported for activities only**
787- - ** Child workflow cross -app calls (suborchestration) are NOT supported**
787+ - ** Child workflow multi -app calls (suborchestration) are NOT supported**
788788- The app ID must match the Dapr application ID of the target service
789789
790790** Running the Cross-App Example:**
791791
792792This example requires running multiple Dapr applications simultaneously. You'll need to run the following commands in separate terminals:
793793
794- 1 . ** Start the main workflow worker (crossapp -worker):**
794+ 1 . ** Start the main workflow worker (multiapp -worker):**
795795``` sh
796- dapr run --app-id crossapp -worker --resources-path ./components/workflows --dapr-grpc-port 50001 -- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.crossapp.CrossAppWorker
796+ dapr run --app-id multiapp -worker --resources-path ./components/workflows --dapr-grpc-port 50001 -- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.multiapp.MultiAppWorker
797797```
798798
7997992 . ** Start app2 worker (handles App2TransformActivity):**
800800``` sh
801- dapr run --app-id app2 --resources-path ./components/workflows --dapr-grpc-port 50002 -- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.crossapp .App2Worker
801+ dapr run --app-id app2 --resources-path ./components/workflows --dapr-grpc-port 50002 -- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.multiapp .App2Worker
802802```
803803
8048043 . ** Start app3 worker (handles App3FinalizeActivity):**
805805``` sh
806- dapr run --app-id app3 --resources-path ./components/workflows --dapr-grpc-port 50003 -- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.crossapp .App3Worker
806+ dapr run --app-id app3 --resources-path ./components/workflows --dapr-grpc-port 50003 -- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.multiapp .App3Worker
807807```
808808
8098094 . ** Run the workflow client:**
810810``` sh
811- java -Djava.util.logging.ConsoleHandler.level=FINE -Dio.dapr.durabletask.level=FINE -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.crossapp.CrossAppWorkflowClient " Hello World"
811+ java -Djava.util.logging.ConsoleHandler.level=FINE -Dio.dapr.durabletask.level=FINE -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.multiapp.MultiAppWorkflowClient " Hello World"
812812```
813813
814814** Expected Output:**
@@ -819,15 +819,15 @@ The client will show:
819819Input: Hello World
820820Created DaprWorkflowClient successfully
821821Attempting to start new workflow...
822- Started a new cross -app workflow with instance ID: 001113f3-b9d9-438c-932a-a9a9b70b9460
822+ Started a new multi -app workflow with instance ID: 001113f3-b9d9-438c-932a-a9a9b70b9460
823823Waiting for workflow completion...
824824Workflow instance with ID: 001113f3-b9d9-438c-932a-a9a9b70b9460 completed with result: HELLO WORLD [TRANSFORMED BY APP2] [FINALIZED BY APP3]
825825```
826826
827827The workflow demonstrates:
828- 1 . The workflow starts in the main worker (crossapp -worker)
829- 2 . Calls an activity in 'app2' using cross -app functionality
830- 3 . Calls an activity in 'app3' using cross -app functionality
828+ 1 . The workflow starts in the main worker (multiapp -worker)
829+ 2 . Calls an activity in 'app2' using multi -app functionality
830+ 3 . Calls an activity in 'app3' using multi -app functionality
8318314 . The workflow completes with the final result from all activities
832832
833833This pattern is particularly useful for:
0 commit comments