Post a reply

Write your message and submit

Options

Click in the dark area of the image to send your post.

Go back

Topic review (newest first)

kzone
2009-05-26 13:42:28

....

work fine with tFlowToIterate !!
I was looking "midi à 14 heures" or "to make a mountain out of a mole hill" at the end !

result

not exist so do something else ...
not exist so do something else ...
not exist so do something else ...
not exist so do something else ...
exist so do something ...

thanks a lot ...

kzone
2009-05-26 13:01:58

thanks to both of you,

files are in fact attachment part mail . I rename the file due to getFrom javamail's method and associated name
Sometimes partners change those values without telling us .In those case file keep the real "getfrom value" for naming file , but I don't know by advance which one.

I want to keep jobs and applications still running 'til the end for "the good ones" and take "the wrong ones" out of the flow!

So I can look after filename that I know with tFileList (with pattern)  and copy them somewhere else ... and it's why the reason for "else" smile

Perhaps parse twice the file list , first with pattern that I know, and another time with a pattern like "*.unknown" wherein "unknown" is the extension that i've added to unrecognized partners (getfrom value) !

laurent

ps : in the generated code there is

Code:

java.io.File file_tFileExist_1 = new java.io.File(
                            "/home/raulier/TALEND_TEST/"
                                    + ((String) globalMap
                                            .get("tFileList_1_CURRENT_FILE")));
                    if (!file_tFileExist_1.exists()) {
                        globalMap.put("tFileExist_1_EXISTS", false);
                    } else {
                        globalMap.put("tFileExist_1_EXISTS", true);
                    }

so boolean value exist for my  "if ...else" solution , isnt' it ?

nevermind , i'm going to test your solution bcourtine ...

bcourtine
2009-05-26 12:17:34

I think it's normal : the tFileList components reads the real content of your folder. So only existing files matching the filemask will send be in the flow.

For your purpose you should replace your tFileList component by a tFileInputDelimited (containing a list of absolute paths) and next a tFlowToIterate.

shong
2009-05-26 12:12:17

Hello

ps.odt doesn't exist !!)

As you said, the file doesn't exist, so the tFileList will not pass the file path of ps.odt to tFileExist, that means tFileExist don't check this file.

Best regards

          shong

kzone
2009-05-26 11:54:55

hi,

I have to check if some files exist ...
If file exist do something
if not (else) do something !

But flow 's never gone in "else" . (ps.odt doesn't exist !!)
conition I use :
if

Code:

((Boolean)globalMap.get("tFileExist_1_EXISTS"))

else

Code:

!((Boolean)globalMap.get("tFileExist_1_EXISTS"))

looks so simple , but didn't found solution !
thanks

Board footer

Powered by FluxBB