Dynamically Invoking Subprocesses Using SetEPR Activity
This sample illustrates the Dynamic Invocation of the Subprocess using Set EPR activity. The Set EPR activity generates the Endpoint Reference and determines the service to be invoked at runtime. In this sample, the Service Consumer and Service provider reside in different applications.
Setup
Import the sample project into the workspace. Ensure that both applications are in the workspace. For more information, see Accessing Samples.
Description of the Project
This sample comprises two applications. Service Provider (Provider.bwp) and Service Consumer (Consumer.bwp).
- The Service Consumer invokes the service using Dynamic Process Reference, which is located in the Service Provider application.
- Service Consumer has one process, Consumer.bwp. This process has the Dynamic Reference to the Service. The Consumer process contains a Sleep activity which ensures that consumer waits to invoke the service, till the service gets deployed and is ready to process the request.
- Service Provider has one process, Provider.bwp. This process uses the Hello.wsdl file to implement the service and sends a response message to the incoming request.
The following image shows the configuration details of the Set EPR activity in the Consumer.bwp.

- Procedure
- In the samples directory, select and double-click tibco.bw.sample.core.dynamic.processInvocation.ServiceConsumer.
- In Project Explorer, expand the tibco.bw.sample.core.dynamic.processInvocation.ServiceConsumer project.
- Fully expand the Processes directory and click Consumer.bwp.
- Click .
- At the left hand tree of Debug Configuration wizard, expand BusinessWorks Application and select BWApplication
- Click the Applications tab and then click the Deselect All button if you have multiple applications. Select tibco.bw.sample.core.dynamic.processInvocation.ServiceConsumer and tibco.bw.sample.core.dynamic.processInvocation.ServiceProvider applications.
- Click
Debug.
This runs the sample in a Debug mode.
- Click the
Terminate
icon to stop the process.