Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi,
I am doing my first Talend course and I am in the process of trying to understand the functionality of the components. I the course, a tFileExist component is used to activate a subjob if a given file exists. Seems straightforward to me, but I can not get it working myself.
It seems that no matter what, the tFileExist component always fires the onSubJobOK action as well as the OnComponentOK action.
To check this, I have created a new job with a simplified version of the course lesson, only containing a tFileExist compent and two tMsgBox components. I linked the tMsgBox components using OnSubjobOK and OnSubjobError, with different messages. In the tFileExist compoment I specified a non existing file. But the OK message is always displayed, if the specified file exists or not.
My goal is trying to understand this component, trying to understand why it is not working right now, and the proper way to do a file test.
I am using Talend studio 6.5.1 on a linux machine right now. If I need to clarify, please let me know.
Thanks in advance,
Ruud
Share your job design with settings for tFileExists and the "if" triggers you wrote.
I have attached a screenshot of the job. It is really very simple. I managed to get a working version by connection the two tMsgBox components with a 'run if' connector and respectively condidtions
(Boolean)globalMap.get("tFileExist_1_EXISTS")
and
! (Boolean)globalMap.get("tFileExist_1_EXISTS")
but I cannot understand why the tFileExist component does not do this itself.
On the talend site, I found a tutorial that indicates that tFileExist should_work as I presumed: https://help.talend.com/reader/g8zdjVE7fWNUh3u4ztO6Dw/ziyLfSTQ51rpK6WIDGOkgQ
Is this sufficient to describe my configuration?
thanks, Ruud
tFileExists give you the answer, the file exists or not.
So you have to test the tFileExist_1_EXISTS using an "If" trigger to decide where to go.
That's the way it works.
Hi,
You need to use "Run if" trigger to know whether the file exist or not. In this way we will check the file exist validation. Attaching the screen shot for your reference.
Thanks,
Bharath.
I guess so. But the name suggests the component is there to do a file check. Why this has to be done explicitly again is a bit confusing to a novice like me.
Moreover, the tutorials and course material I found up til now advice to use the onSubJobOK connection. That is confusing too.
Hopefully talend proves to be intuitive again when I continue my course
Ruud
onComponentOK means the component doesn't failed, and it doesn't even if the file doesn't exists, right.
onComponentError means the component failed, but maybe the file exists...
So it's logic to have to check the dedicated variable associated to the component giving the answer to the question "does this file exists or not".
Not at all.
tFileExists does just 1 thing, testing a file exists or not.
Then it's your responsability to decide what to do after and how to use the variable proposed by the component.
Don't forget to mark your case as solved (Kudo also accepted).
@rgros thank's to mark your case as solved (Kudos also accepted).