Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to Using variable declared in tJava to next componet

I want to use variable declared in tJava, so I tried "tMap" and tSetGlobalVar.

But It doesn't work

I want to use location variable in tSystem

Thanks in advance

0683p000009MaAn.jpg0683p000009MaAs.png

 

Labels (2)
12 Replies
Anonymous
Not applicable
Author

Hi
If you want to call tSystem for each iteration, link tjava to tSystem using a OnComponentOK connector.
tFileList--iterate--tJava--Oncomponentok--tSystem.

If you want to call tSystem after all iterations finishes, link tFileList to tSystem using OnsubjobOK connector.
tFileList--iterate--tJava
|Onsubjobok
tSystem.

To declare a global variable and put value, use this expression:
globalMap.put("key",value);

To get the value, use
(String)globalMap.get("key")
//for String type.

Hope it helps you.

Regards
Shong
Anonymous
Not applicable
Author

Thanks for reply, but still doesn't work.

I set like your solution except "Iterate" between tFileList_1 and tJava becauseof  Path difference

0683p000009Ma98.jpg0683p000009MaAx.jpg0683p000009MaAt.jpg0683p000009Ma7G.jpg

 

This Error massage


0683p000009MaB2.jpg 

Anonymous
Not applicable
Author

See the Qbicware.java 635 Line
"String dirName =((String)globalMap.get("tFileList_1_CURRENT_FILEPATH")).replace("\\", "/").substring(2);
System.out.println(dirName);
globalMap.put("dirName", dirName);
"
I think they can not call ther tFileList_CURRENT_FILEPATH..
is there another way to recognize it in tSystem?
Anonymous
Not applicable
Author

From the error, I see it is NPE on tJava, it is a design issue, the connector should be iterate rather than onComponnetOK from tFileList to tJava.

Anonymous
Not applicable
Author

First

I run this job in linux environment, (.sh file)

but there isn't "D:/FTPTest "(tFileList) things in linux.

 

Second

as you said.. "Iterate" things between tFileList and tJava could be a problem

but there's a issue if "Iterate" is real problem.

I tested both "Iterate" and "onComponentOK" and Path that I wanted appear when only use "ComponentOK" 

ex)

use Iterate

"D:/FTPTest/NAVI"

 

use onComponentOK

"D:/FTPTest/NAVI/Barnum"

 

and I want to below path.. so I used onComponentOK.

 

 

 

 

Anonymous
Not applicable
Author

If you want to iterate each file, you should use Iterate, it depends on your requirement. If you use onComponentOK, it only process the last file. 

 

 

Anonymous
Not applicable
Author

when I running .sh file on server, I want to check the log.

is it okay  if  I link each component  to tWarn?

like this 0683p000009MaBM.jpg

Anonymous
Not applicable
Author

yes, you can link the components to a tWarn and customize the log messages if needed.

Anonymous
Not applicable
Author

Thanks...

Last question

workflow is looks fine but can't insert it.

please let us know if you know 

0683p000009MaBR.jpg0683p000009Ma3A.jpg