Reputation: 3
I'm quite new to Talend and would like to read an expression from a given file and then execute it in tMap function.
The expressions are stored in a separate excel column like this:
row7.value1 + row7.value2 == 0 ? 0 : row7.value1/(row7.value1 + row7.value2)
I accomplished to read it as a string by global map:
((String) globalMap.get("row6.column_that_contains_expr"))
.
But I'm not able to execute the expression in tMap in order to get the resulting value.
My job looks like this:
tFileInputExcel =row6=> tFlowToIerate => tPostgresqlInput =row7=> tMap => tFileOutpuDelimited
Could you please tell me how to execute the expression from file and obtain the resulting double?
Greetings
Simon
Upvotes: 0
Views: 307
Reputation: 1767
What I would usually do is to have before the tFlowToIerate a tJavaRow Component where I would assign the values into context variables and use them in the tPostgresqlInput directly from the context
Upvotes: 0