Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Goal: build a data filter in context, and use the context value in a talend componant.
I use a context to create a filter expression. The value of context is correctly builded
When I show the value
System.out.println( " string : " + context.sSearchExpr );
Result :
string : ( !( input_row.isIntern ) ) && ( !( input_row.isExternalEmail )
Now, how do use my context value in any talend componant( tFilterRow or tJavaRow)
Help me
Thanks.
Hello
It will not work. the filter expression will be treated as a string, however, the filter expression field requires a boolean value.
Regards,
Shicong
Shicong_Hong is correct. It will be treated as a string. But, in java you can convert a string into a statement, execute it. From the web:
String javaCode = "if (polishScreenHeight >= 200 && polishScreenHeight <= 235 && polishScreenWidth >= 220) { }";
// Convert the Java String to a Java statement
Statement statement = new Statement(null, javaCode, null);
// Execute the statement
statement.execute();
Can you provide me more insight on the use case?