Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I've the context variable result in my child job and I would like to verify the result (Null/not null) in the parent Job and send email of the child job result in the body if it is not null or continue with another tRunjob in the parent job.
My design looks like this:
1. I have passed the child job result in tBuffer output in my child job
2. My parent job
tJavaRow
tSendMail will have variable"var" in the message section
But the variable is not passing any data.
Ideally both should give you same results. May be we will have to test with a simple sample job and verify the results.
Unfortunately I am in back to back meetings this afternoon and may not be able to check it. I would appreciate if you could mark the topic as resolved since my post helped to close your issue.
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved
While I tried if((String)globalMap.get("var") == null) System.out.println("test"); in tJava [ Instead of tlogRow in the above screenshot] which gives the output as "test" .
The same condition in RunIf condition to tSendMail
"(String)globalMap.get("var") == null"
is giving me false.
Why is the Runif condition not succeeding for the same condition in tJava?
Hi,
Below link will provide a sample scenario about how to send the data back to parent job.
https://help.talend.com/reader/jomWd_GKqAmTZviwG_oxHQ/q0zMmIuFx3zpGzwX0QE5Gw
I assume that you are getting data back in parent job and your issue is related to null handling of the data.
I would recommend to use the relational function below to do the comparison of null
Relational.ISNULL(row1.input_data)? "Null match condition passed": "Null match condition failed"
for Run if condition, you can use Relational.ISNULL(row1.input_data) directly which will bring either true or false.
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved
Thanks, Nikhil for your response.
The problem is only in Runif part. I tried using Relational.ISNULL(row1.input_data) directly as suggested but it didn't work.
Job Design:
tJava : if((String)globalMap.get("var") == null) System.out.println("test");
Runif ( To tSendMail) : Relational.ISNULL((String)globalMap.get("var"))
Run Job Log:
[statistics] connecting to socket on port 3504
[statistics] connected
test
[statistics] disconnected
My tJava is giving "test" result which means it satisfies the condition (String)globalMap.get("var") == null but the same is not working in RUNIF .
Hi,
Its working fine for me in both conditions.
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved
I think I figured out the issue. Used context variable instead of globalMap.put/get and it is working fine.
The reason is because of using variable globalMap.put("var",input_row.data); inside tJavarow and getting the result as (String)globalMap.get("var") in RUNIF instead of creating a context as used in your case.
But why does it give a different result for a context variable and globalMap variable?
Ideally both should give you same results. May be we will have to test with a simple sample job and verify the results.
Unfortunately I am in back to back meetings this afternoon and may not be able to check it. I would appreciate if you could mark the topic as resolved since my post helped to close your issue.
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved