Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] PROBLEM WITH RUNIF FOR UPLOAD WITH tFileExist

Hi,
I'm new with Talend, only one week and I try to:
1) Connect on FTP => OK
2) Check if file exist on server ftp => OK
3) I try to use the Runif condition but I have a problem there...


As you can see on the schema, I use the  tJava to make the condition :

Boolean condition = true;
globalMap.put("tFTPFileExist_1_EXISTS",condition);



On the Runif order 1:


(Boolean)globalMap.get("tFTPFileExist_1_EXISTS")==true




On the Runif order 2:

(Boolean)globalMap.get("tFTPFileExist_1_EXISTS")==false



I just want to check if the file is present on the server, if Yes "order1" else "order2"

Thanks
Burnside

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

HI,
Thank's for your answer, but I have found the solution, and forgot to post it...
I have just remove the tJava and put two run if with the same condition as you propose me but one with "!" before on one runif.
Everything run perfectly.
Regards
Burnside

View solution in original post

2 Replies
willm1
Creator
Creator

Try the following: 
For true condition: ((Boolean)globalMap.get("tFTPFileExist_1_EXISTS"))
For false condition: !((Boolean)globalMap.get("tFTPFileExist_1_EXISTS"))

You don't need to create a global variable to do this - as I think you were doing. Connect your two components where you want to conditionally do something, then do Ctrl + Spacebar in the If condition box and select the Talend-provided global variable.
0683p000009MGRk.png
Anonymous
Not applicable
Author

HI,
Thank's for your answer, but I have found the solution, and forgot to post it...
I have just remove the tJava and put two run if with the same condition as you propose me but one with "!" before on one runif.
Everything run perfectly.
Regards
Burnside