Five Stars

tDie_1_DIE_CODE is null

Hello,

 

I am using a tdie component in my job and am setting a custom error code. I am trying to access this errorcode later in the job using ((Integer)globalMap.get("tDie_1_DIE_CODE")), but this value is always null.

 

Soon after tdie is triggered, the control goes to tLogCatcher and in the logCatcher schema, i am able to access this errorCode value which is available in code column, but anywhere downstream, if i try to access using, tDie_1_DIE_CODE, it returns null.

 

I am not sure if its normal or am i missing something. Can someone share your thoughts on the same

 

Thanks

Sen

Tags (2)
1 ACCEPTED SOLUTION

Accepted Solutions
Twelve Stars

Re: tDie_1_DIE_CODE is null

You have misunderstood. The tDie kills the job immediately. You cannot send an email afterwards as the tDie will kill the process. The last thing it will do is provide log details and then it will end.

 

However, if you place a tPostJob component in the job, the tDie will kill the processing of the rest of your functionality and jump to the tPostJob component. The tPostJob component is NOT connected to your main flow. This will mean you can send a mail with the error code inside from the same job.

Rilhia Solutions
4 REPLIES
Twelve Stars

Re: tDie_1_DIE_CODE is null

The tDie causes the job to die immediately. The Logcatcher will pick this up as you have seen, but no other component inside the job should unless you use a tPostJob component to perform some cleanup tasks. The tPostJob (and components linked to it) is guaranteed to run unless there is a power failure. However in the past (not sure if this is still the case), if you wanted to check the status of a child job from a parent job where a tPostJob component is used, you may experience issues seeing the actual error unless you re-call it at the end of the tPostJob.

Rilhia Solutions
Five Stars

Re: tDie_1_DIE_CODE is null

Thanks for your reply and I am completely inline with you.

 

In my case, the die aborts the job as the functionality was not satisfied. The logcatcher catches this and I am logging the info into a log table, after which i try to send an email based on the errorcode, because I want to send the email only when the exception is thrown from tdie and not for any other exception that occur in my job. Hence i try to read this errorcode that was set in tdie, but unable to retrieve it. I see the java code generated and it has been well defined as a global variable, but not sure where it gets reset.

 

So probably my option is to reset the code from logcatcher to another globalvariable and use it later to check if i can send email or not !

 

Thanks

Sen

Twelve Stars

Re: tDie_1_DIE_CODE is null

You have misunderstood. The tDie kills the job immediately. You cannot send an email afterwards as the tDie will kill the process. The last thing it will do is provide log details and then it will end.

 

However, if you place a tPostJob component in the job, the tDie will kill the processing of the rest of your functionality and jump to the tPostJob component. The tPostJob component is NOT connected to your main flow. This will mean you can send a mail with the error code inside from the same job.

Rilhia Solutions
Five Stars

Re: tDie_1_DIE_CODE is null

Many thanks on the clarification.

 

But my error handling, which has the following design executes after tdie. the subjob which sends email also executes perfectly. In my tpostJob i manage the filearchiving and it also works as required (Just to know, If tdie kills the job immediately, what component can be used in talend to throw an user exception and handle the exception as per the need ?)

 

 

LogCatcher ->Map-->toracleOutput

|

on subjobOk

|

JavaFlex to set all parameters for Email -->Runif-->trunJob (CommonEmailJob)

 

Thanks

Sen