One Star

While condition on tLoop with context variables

I am creating a job that needs to run a subjob if a specific condition exists between two context variable. Basically, if context.local_user_count >= context.local_page_size, then I need the subjob to get called.
This is my first attempt using a tLoop like this. I am newer to Talend and need some help on how to set the parameters for the loop condition. I have tried a few things but nothing has worked.
I will attach an image of the job and the tLoop settings.

Thank you
Amy McGreal
7 REPLIES
Five Stars

Re: While condition on tLoop with context variables

I think you need a little more explanation of the problem.
You've said ">=" but your screen shot is "<=".
So you're modifying one or both of these variables in your tJava?
One Star

Re: While condition on tLoop with context variables

I had been testing a few things and grabbed the screen shot with the wrong condition. I actually want to have it run if the user count side is >= page size. Then I have more data to pull.
One Star

Re: While condition on tLoop with context variables

Attached is the code for the tJava. I increment the page number each time the subjob is called with a subjob value that is passed back. I have also attached the overall job.
Five Stars

Re: While condition on tLoop with context variables

I can't see what you loop says...
You're incrementing page_number but say "user count side is >= page size"...it sounds a bit back to front...
I'd select the code tab in the design window so that you can actually see the while loop that has been constructed.
Maybe things will become clearer. Post that piece of code.
One Star

Re: While condition on tLoop with context variables

I was able to get it figured out. I'm very new to using many of these operators and know little about java so I apologize if my post was confusing. Thank you for trying.
Four Stars

Re: While condition on tLoop with context variables

Hi,
I am trying to achieve similar what you were trying to. Can you post the solution?
One Star

Re: While condition on tLoop with context variables

Hey I'm able to use the tLoop without any issue...
Thanks
Sreenivasa