Configuring a Conversation to Join a Wait for File Change Activity
The Wait For File Change activity initiates and joins conversation with a File Poller activity to implement a process conversation.
- Procedure
- In the samples directory, select and double-click tibco.bw.sample.core.conversation.WaitForFileChange. For more information, see Accessing Samples .
- In the Project Explorer view, expand the tibco.bw.sample.core.conversation.WaitForFileChange project.
- Fully expand tibco.bw.sample.core.conversation.WaitForFileChange.application and double-click Properties. The output file locations defined for the application displays in the dialog.
- 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.core.conversation.WaitForFileChange.application.
- Click
Debug.
This runs the sample in Debug mode.
- After completing the Scenario1 and 2, click the
Terminate
icon to stop the process.
ResultThe request is Approved.
Understanding the Configuration
- Procedure
- Trigger.bwp process creates Trigger.log and this triggers a job.
- Trigger.bwp process creates Req.log and writes "Approved" in the same file. This triggers event for the "Wait For File Change".
- When the
Wait for File Change activity runs, the process instance suspends and waits for the specified change to occur before resuming.
Output file gets created at: c:\tmp\WaitForFileChange\WaitForFileChange.log with content: "The request is Approved."
- The RemoveApprovalFile activity removes the Req.log file from c:\tmp\WaitForFileChange.
- TriggerAnotherJob: This activity triggers another job and process execution waits at Wait For File Change activity for matching the correlation keys.
- If the user creates
Req.log file at location
c:\tmp\WaitForFileChange with content "Rejected", then conversation gets executed successfully and the output file at
c:\tmp\WaitForFileChange\WaitForFileChange.log gets updated as mentioned below:
The request is Approved.
The request is Rejected.