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
Hello tMap can't accept a trigger connector, it must be a input flow, so you can't link a runIf to tMap. You can use a tFixedFlowInput to lead to tMap. .... | RunIf | tFixedFlowInput---tMap---tLogRow
Thank you for fast reply, Shong.
I implemented your suggestion. However it does not work as intended.
FixedFlowInput reads only a single row from my MysqlInput which has hundreds of thousands rows. How do I read all rows and pass values for each column as if MysqlInput was directly connected to tMap.
Please see screenshot attached.
Hello
Where's your screenshot? I don't know why you will use the RunIf connector, please describe your requirement with more details.
Best regards
Shong
Here is screenshot. Two tMap have different transformations sets configured. Based on user decision I need to execute only one set of transformations, hence conditional execution. Your forum site does not pick up images. Can you see what is going on?
if you need to base your transform on the incoming data, you should use the output filters inside the tmap to split the output into two different output tables: step04_mapping --> tMap +--(condition 1)--> output | +--(condition 2)--> output
You need to have a complete subjob (input --> tMap --> output) for each possible transformation with RunIf leading to the input component to control which is executed.
@alevy Doesn't it contradict with what John suggested above? @John John, can you explain how to branch execution within tMap? I have prompted context variable which is defined by user input. How to put it inside tMap?
it depends on what you are checking with your if condition. if you are checking the value of a column of your input, you should persue my suggestion. if you are not checking a column of your input data, please use alevy's suggestion.
With my IF condition I am checking the value of a context variable set by user. Based on this variable value (either 'Yes' or 'No') I need to pass my data flow through different transformations which I coded in tMap. The output should go into the same output table. Thank you, Peter.