Using Stream Selector
When more than one input stream is connected to an activity, Stream Selector is used to specify the input stream to be consumed by the activity. To understand the use of Stream Selector, consider the following process flow.
In this process flow, you can see that two input streams are passed to the File_Target. The desirable execution sequence is that first File_Source will be executed then File_Target and thereafter the Gateway. Now, if the condition specified at the Gateway is satisfied, the process flow will be finished. If the condition specified at Gateway is not satisfied, the control will be passed to the FTP _Source and further to File_Target. Practically, when this process flow will be executed, the File_Target activity will get confused whether to take input from File_Source or from FTP_Source. Thus, this process flow will fail.
To avoid such a situation, Stream Selector is used. Streams from File_Source and FTP_Source are passed to the Stream Selector and then from the Stream Selector to the File_Target.Â
Stream Selector takes input from the activity that has just executed. If the File_Source has executed before the execution of the Stream Selector, it will take input from the File_Source. If the FTP_Source has just executed, it will take input from the FTP_Source.
To use Stream Selector:
- In the Process Designer, in the Repository View panel, expand Activities.
- Expand Selector.
Click Stream Selector Service and drag it to the Graph Canvas.Â
- Connect the required activities with the Stream Selector Service.