Inter Process Communication using Wait for Notification and Notify Activities
This sample explains inter-process communication using the Notify and the Wait for Notification activities in different processes. One process notifies the other waiting process using these activities. These activities are co-related using the key configured on the General tab and the same Notify Configuration resource configured for both the activities.
- Procedure
- In the samples directory, select and double-click tibco.bw.sample.palette.generalactivities.WaitNotify. For more information, see Accessing Samples.
- In the Project Explorer view, expand the tibco.bw.sample.palette.generalactivities.WaitNotify project.
- Set the default ApplicationProfile to match the OS you are running on. For more information, see Setting the Default Application Profile.
- Fully expand the Processes directory.
- 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 the checkbox next to tibco.bw.sample.palette.generalactivities.WaitNotify.application.
- Click
Debug.
This runs the sample in Debug mode.
- Click the
Terminate
icon to stop the process.
A waitnotify.log file is created in the C:\tmp\WaitNotify folder of the default location, or the path you specified earlier. This file contains the information similar to the following:
Main Process: Started the main process
Main Process: Spawning non-inline sub process
Main Process: Activity Waiting for the notification
Sub Process : Non-inline sub process started
Sub Process : Notification sent for the waiting activity
Main Process: Notification Received from the other process with Data: Results sent from the notifying process
Understanding the Configuration
The scenario depicts a simple inter process communication use case.
- The main process is triggered through a Timer activity.
- The main process spawns a non-inline sub process.
- The main process then starts waiting, using a Wait for Notification activity.
- The spawned sub process sends the notification for the waiting activity using a Notify activity and proceeds further.
- The Wait for Notification activity in the main process receives the notification and proceeds further.