How to set termination of phases on condition based?

I developed a graph which contains two phases.
1st phase reads a CSV file and
2nd phase process the uploads to third party server.

Here my requirement is : if 1st phase contains data in the csv file then 2nd phase should run.
if 1st phase does not contains any data the 2nd phase should terminate the running.

Can anybody help me out as soon as possible. Thanks in advance.

-Raj

Hi Raj,

You will want to create two streams using the SimpleCopy, one side will be phase 1 and the second will be phase 2. I have taken the liberty of attaching a sample graph with your use case. Basically the Aggregate component will count the incoming records, if no records come in then I use the DataGenerator to create a record with count 0. I use the Combine component to merge the data and determine if no records are available in the Aggregate then take the record from the DataGenerator. Finally I use a ExtFilter component that determines if count is equal to 0 then the Fail component will be trigger, thus failing my graph before phase 2 commences.