Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

global variable in tLoop

Hi,
I use Talend 3.0.2 + java.
I declare "start=1" with tSetGlobalVar and I would like to start my tLoop with i=start.
I put "int i="((Integer)globalMap.get("start")) in tLoop declaration but I receive error in code: Start cannot be resolved.
It is a little weird because I use it in some components later and error doesn't occur.
Could anyone tell me what I am doing wrong, please?
Thanks in advance.
Kind regards,
Marcin K.
Labels (3)
13 Replies
Anonymous
Not applicable
Author

Try
int i=Integer.parseInt(globalMap.get("start"));
Anonymous
Not applicable
Author

Hello
It was a 5871 and I have fixed it.
Please update the change and restart TOS.
Then, set the declaration expression like this:
"int i=Integer.parseInt((String)globalMap.get("start"))"
Best regards

shong
Anonymous
Not applicable
Author

jholman - thanks for your answer, it still brings an error message: Start cannot be resolved.
shong - thank you too, I try to update but I get error message from Eclipse:
Network connection problems encountered during search.
Unable to access " http://talendforge.org/core/updatesite/3.0/testing/".
Error parsing site stream.
White spaces are required between publicId and systemId.
Error parsing site stream.
White spaces are required between publicId and systemId.
Shong, Any fix for this?
Anonymous
Not applicable
Author

Hi Shong,
I downloaded latest TOS from SVN - I copied http://talendforge.org/svn/tos/trunk into features directory and restarted TOS but it looks like problem still occurs.
I am attaching 2 screenshots: tSetGlobalVar + settinngs and tLoop + error message.
Any idea how what I do wrong?
Kind regards,
Marcin K.
Anonymous
Not applicable
Author

Shong,
I successfully updated talend from SVN repository.
I uploaded files into features directory instead of plugins which was wrong.
I get different error message now:
Exception in component tLoop_1
java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
Anonymous
Not applicable
Author

Some more info: it looks like I can't access any variables set with tSetGlobalVar using (String)globalMap.get("start") which also causes a problem with updated tLoop component.
Strange because it worked before.
Anonymous
Not applicable
Author

Hello
I have committed the update file on trunk:20689, you can go to http://talendforge.org/trac/tos/changeset/20689 and download the new files to your local machine.(see screenshot) Then, copy the two new files: tLoop_begin.javajet and tLoop_end.javaject, go to \plugins\org.talend.designer.components.localprovider_3.0.2.r20205\components\tLoop located on your install folder and paste them, restart TOS.
Best regards

shong
Anonymous
Not applicable
Author

Hi Shong,
it works fantastic!
Thank you very much for your help and fix.
For people who will take a look here in the future: I use "int i=((Integer)globalMap.get("start"))" in tLoop fields.
Kind regards,
Marcin K.
Anonymous
Not applicable
Author

Hi,
I wanted to do incremental extraction using global variables. Can anyone please help me out