Six Stars

Write Processing component with conditional output

Hello,

 

I want to write a component, that reads data from the data flow, analyses it and if it satisfies a certain condition it gives the data to the next component.

My problem is that I can only analyse the data when I have all of then thus the analysis can only take place in the end file.

To my understanding the output has be managed in the main file.

 

Is there any workaround for this? 

 

Thanks for your helf.

1 ACCEPTED SOLUTION

Accepted Solutions
Twelve Stars

Re: Write Processing component with conditional output

You might want to prototype this in the following way.

 

1) Use a tJavaFlex component

2) In the Start Code section, create a collection object. Use whichever one suits your needs. You may want to create a class using a routine to store your data in a suitable object for your processing, then store the data in your collection.

3) In the Main Code section, this is where you will receive your data. Pass it to your object and add it to your collection (if you choose to do it that way).

4) In the End Code section, carry out your analysis over the records in your collection. Save your collection in the globalMap.

5) In another tJavaFlex, get a reference to your collection from the globalMap in the Start Code section.

6) In the Start Code section, create the beginning of a For or While loop based on your collection.

7)The Main Code is where your loop will act. So for every iteration do whatever you want with your collection data. This is where the datarows will be passed to the next component.

8) In the End Code section, close your loop.

 

Doing it this way will allow you to process your entire record set in two components. You will need to keep an eye on memory though.

Rilhia Solutions
1 REPLY
Twelve Stars

Re: Write Processing component with conditional output

You might want to prototype this in the following way.

 

1) Use a tJavaFlex component

2) In the Start Code section, create a collection object. Use whichever one suits your needs. You may want to create a class using a routine to store your data in a suitable object for your processing, then store the data in your collection.

3) In the Main Code section, this is where you will receive your data. Pass it to your object and add it to your collection (if you choose to do it that way).

4) In the End Code section, carry out your analysis over the records in your collection. Save your collection in the globalMap.

5) In another tJavaFlex, get a reference to your collection from the globalMap in the Start Code section.

6) In the Start Code section, create the beginning of a For or While loop based on your collection.

7)The Main Code is where your loop will act. So for every iteration do whatever you want with your collection data. This is where the datarows will be passed to the next component.

8) In the End Code section, close your loop.

 

Doing it this way will allow you to process your entire record set in two components. You will need to keep an eye on memory though.

Rilhia Solutions