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 scenario (see Figure 147).
Figure 147: Scenario
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 there after 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 File Source1 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 File Source1. Thus, this process flow will fail.
To avoid such a situation, Stream Selector is used. Streams from File Source and File Source1 are passed to Stream Selector and then from Stream Selector to the File Target. The use of Stream Selector is displayed in Figure 148.
Figure 148: Stream Selector
Stream Selector takes input from the activity, which has just executed. If File Source has executed before the execution of stream selector, it will take input from File Source. If File Source1 has just executed, it will take input from File Source1.
Steps to use a Stream Selector
- Click hierarchy structure in the Repository View panel. Expand the Activities list of the Adeptia Server and select Selector. A list of selector activities is displayed.
- Click Stream Selector Service and drag it to the Graph Canvas. The Stream Selector Service node is displayed in the Graph Canvas area (see Figure 149).
Figure 149: Drag Stream Selector to Graph Canvas
- Connect the required activities with the Stream Selector Service node (see Figure 150).
Figure 150: Connect Activities with Stream Selector Node