One Star

[resolved] Refresh tMap lookup on loop iteration

I've got an infinite loop which, upon iteration, queries a data table for all records, and pipes those into a tMap. The tMap has as a lookup a tHashInput. Any inner join failures are logged and also update the tHash component. Next iteration, those new values are in the tHash, yet the tMap does not requery the tHash component. I can set the lookup model to "Reload at each row", but this causes an insane number of queries to my hash. Ideally, there would be some setting that causes a refresh of the tMap lookup on each iteration of the infinite loop (and not for each *row* of the main query).
Is there a way to do this? I'm not seeing a setting within the tMap configuration. Maybe there's some Java method that could get manually executed on each loop iteration to refresh the lookup?
Thanks in-advance for any help! -Ben
1 ACCEPTED SOLUTION

Accepted Solutions
Seven Stars

Re: [resolved] Refresh tMap lookup on loop iteration

I presume your current design is just tInfiniteLoop -iterate-> tInput --> tMap --> ...?
If so, then the lookup for tMap will be loaded only once for all iterations as you've experienced, which is efficient. To break the efficiency and cause the lookup to be loaded once for each iteration, you just need to tweak the design to tInfiniteLoop -iterate-> tJava -OnComponentOK-> tInput --> tMap --> ...
There is nothing in the tJava; it's just a place-holder to allow you to use the OnComponentOK trigger, breaking your subjob into two parts.
2 REPLIES
Seven Stars

Re: [resolved] Refresh tMap lookup on loop iteration

I presume your current design is just tInfiniteLoop -iterate-> tInput --> tMap --> ...?
If so, then the lookup for tMap will be loaded only once for all iterations as you've experienced, which is efficient. To break the efficiency and cause the lookup to be loaded once for each iteration, you just need to tweak the design to tInfiniteLoop -iterate-> tJava -OnComponentOK-> tInput --> tMap --> ...
There is nothing in the tJava; it's just a place-holder to allow you to use the OnComponentOK trigger, breaking your subjob into two parts.
One Star

Re: [resolved] Refresh tMap lookup on loop iteration

Exactly what I needed - thanks, alevy! And, just to explain the inefficiency: within the loop, I'm updating the tHash* component that's used in my tMap as a lookup - that's why I need the tMap to refresh - but just once per iteration.
I'm seeing a number of really helpful posts from you on other topics, so I'm sure to learn quite a bit from you. Thanks again, and regards, Ben