问题
I have the following flow:
- 1 Component that needs to be executed to extract from MYSQL a certain timestamp
- 3 MYSQL inputs that needs to use that timestamp
- 1 tMap which needs to get the 3 mysql input
However, I am not allowed to connect the 3 mysql into the single tMap because they are depending on the first component (through OnComponentOk) but with different order. How do I orchestrate this sort of situations?
回答1:
You could execute a query and set a global variable using the tSetGlobalVar component (referencing row1.mydate, for example), then in each of your queries going into tMap, reference the global variable like:
SELECT ...
FROM ...
WHERE mydate >= '" + (String) globalMap.get("myDate") + "';"
Two subjobs, one for getting the variable and storing it, and another for doing your three queries into tMap, etc.
来源:https://stackoverflow.com/questions/42704560/oncomponentorder-flow-and-tmap-connections-in-talend