Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everybody,
I have a question, I know how to use the run if on Talend, using a tSetGlobalVar, but I want to do a more difficoult job.
I want to make a join between two different metadata tables, to know which tables I have to refresh, with the relative tRunJob.
I am trying this solution using a file, in which I put the name of the tables, putting them on a
tSetGlobalVar, but it doesn't work, so there is a method that I can use to make this thing?
Example: I have to refresh table 1 and table 3, my file tells me:
table1
table3
And I want to make a "Run if" trigger without losing any records.
I am using these condition:
((String)globalMap.get("test2")).equals("table1")
((String)globalMap.get("test2")).equals("table3")
But only the job of table3 starts.
Does anybody know how can I do?
Thanks
This is because the last value will overwrite the previous values, if you want to iterate each table, change the job design as below;
tFileInputDelimitd--main(row1)--tFlowToiterate--iterate--tJava--runif1--tRunJob3
--runif2---tRunJob4
set the condition of runIf1 as:
row1.columnName.equals("table1")
set the condition of runIf2 as:
row1.columnName.equals("table3")
How do you load the value of file? Using tContextLoad? Can you please share a screenshot of your job?
Hello,
already to start, it is advisable to compare the variable to the fixed value
so "test1" .equals (...) to avoid null values
Then, can you share your job because there is no particular difficulty?
you can have for example this pattern
tWarn1 - RunIf_1 (condition) -> tRunJob_1
|
|
tWarn2 - RunIf_2 (condition) -> tRunJob_2
...
with : |
|
OnSubjobOk
I am using a little job to better understand how can I do.
It is so simple, but when I run it, it doesn't work for the first if (although there is "table1" on the file)
This is because the last value will overwrite the previous values, if you want to iterate each table, change the job design as below;
tFileInputDelimitd--main(row1)--tFlowToiterate--iterate--tJava--runif1--tRunJob3
--runif2---tRunJob4
set the condition of runIf1 as:
row1.columnName.equals("table1")
set the condition of runIf2 as:
row1.columnName.equals("table3")
It works!
Thank you so much!