Hello, Please take a look at my job screenshot. I have a simple requirement: Run the data flow through one of the tMap components based on user input. I can't accomplish the first step of creating Run If connectors. Talend does not allow me to create Run If connector betwee tMysqlInput and with tMap components. Please explain me how it should be done. Thank you, Peter.
Then Alevy has the correct solution for you. You may need to insert a "dummy" component at the start of the job to get the "if" connector. This can be an empty tJava component. tJava(empty) +-- if(context.user_input == "Yes" ) --> Input-->tMap-->Output | +-- if(context.user_input == "No" ) --> Input-->tMap-->Output
A conditional flow connector would possibly be a useful feature to have - a number of topics have asked about it - but you can only have multiple flows directly from tMap or tReplicate anyway. You could always submit a feature request on the BugTracker
A couple of other points:
-- You can achieve the same result as a conditional flow connector by having a tReplicate after your input component with each branch then having a tFilterRow containing your If condition before continuing on to the tMaps. However, this is not as efficient as a proper conditional flow connector would be because the flow is first duplicated before one branch is filtered out of existence.
-- The If condition should probably be context.user_input.equalsIgnoreCase("Yes"); == should not be used for Strings.
-- Depending on the complexity of and differences between the two different tMap transformations, you could still use Garrett's suggestion by having two output tables in tMap with an expression filter for each based on your context variable.