Seven Stars

Query Regarding tJavaRow Code

Hi,

As shown in attached the job design we have tFilterRow component connected to tJavaRow component. But tFilterRow component is not returning any row because rows are not satisfying the condition mentioned in tFilterRow component . Here is the code snippet I have written in tJavaRow component.

 

if(input_row != null && input_row.AccountNumber != null)

{

context.AccountNumber = input_row.AccountNumber;

System.out.println("New AccountNumber Is " + context.AccountNumber);

}

else

{

System.out.println("No Data Fetched");

}

 

But when I ran the job the console didn’t print any thing. Actually I was expecting “No Data Fetched” to be printed as no row is being returned. As per my understanding either input_row is null or input_row.AccountNumber is null.

Both of these two should not be null when row is being returned from tFilterRow component. Here AccountNumber is a field of Accounts table in Sales Force.

 

Please help me where I am wrong?

6 REPLIES
Fifteen Stars

Re: Query Regarding tJavaRow Code

The flow is not getting to the tJavaRow. If a row is filtered, the next component will not do anything. There is no row to process. It won't pass a null row. This suggests that you tFilterRow is not allowing anything through. Can you elaborate on the tFilterRow?

Rilhia Solutions
Seven Stars

Re: Query Regarding tJavaRow Code

Hi,

 

Just for your information tFilterRow is working fine as per current scenario it will not return any row. There is no problem with tJavaRow. 

 

Did you mean that as no row is being getting passed to tJavaRow from tFilterRow hence flow is not passed to tJavaRow?

 

But I have noticed there is "Run IF" component being applied from tJavaRow  component which connects to other sub job. And this "Run IF" component is returning true causing the subjob to run.

 

If I go by your answer then flow is getting passed to tJavaRow component. I am not sure why then "Run IF" component is returning true. Flow should not get passed to  "Run IF" component also?

Fifteen Stars

Re: Query Regarding tJavaRow Code

The RunIf does not rely on a row of data. It is a True/False decision trigger. It fires once the component has finished (got to the end of the flow). Since the tJavaRow was triggered but did not receive any rows, it completed immediately. 

 

Unless the job fails, all components start and end. But they may not receive rows. This is an important concept to grasp. You will notice perceived weirdness like this and will have to build around it. Knowing about it and considering it helps a lot :-)

Rilhia Solutions
Seven Stars

Re: Query Regarding tJavaRow Code

Hi,

 

Here is my understanding :-

 

a. Unless Job fails all components will start and end.

b. In case component which rely on a row of data doesn't receive any row then that component will end immediately without executing any logic associated with it.

 

Please tell me if my understanding is correct.

Fifteen Stars

Re: Query Regarding tJavaRow Code

Yes, that pretty much sums it up. There are other rules involving tPostJob components and tDies, etc, but you pretty much have the main logic there.

Rilhia Solutions
Fifteen Stars

Re: Query Regarding tJavaRow Code

Did this answer your question?

Rilhia Solutions