Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I'm trying to make a condition in my tmap for the filter expression.
I checked my condition it seems correct but I show it below:
(((String)globalMap.get("tMsgBox_1_RESULT")).equals("1")?(row9.Agence)==((String)globalMap.get("tMsgBox_2_RESULT")):((String)globalMap.get("tMsgBox_4_RESULT")).equals("1")?(row9.Agence)==((String)globalMap.get("tForeach_1_CURRENT_VALUE")):())
And you will find an image of my designer below :
And finally here is the error when I run my script:
I would like to have some help because I do not understand the error and all of my condition looks correct. Unless the nested conditions can not be achieved as well. If you need more information, do not hesitate to ask me for clarification not knowing for the moment not too much what to specify others.
Thank you in advance for your return.
Fabien
Hi,
The issue says that you are trying to insert incompatible data type to a boolean variable.
(((String)globalMap.get("tMsgBox_1_RESULT")).equals("1") ?(row9.Agence)==((String)globalMap.get("tMsgBox_2_RESULT")) :((String)globalMap.get("tMsgBox_4_RESULT")).equals("1") ?(row9.Agence)==((String)globalMap.get("tForeach_1_CURRENT_VALUE")) :())
If you refer your if-else condition, you are not trying to bring the target value to a boolean type. For example, the last part of else is just (). I would recommend you to convert your business logic to make sure that each output of the above condition results in boolean value. Please add a tLogrow to print the output at each stage to validate the results.
Could you please verify the need of a message box in the production environment? If you need to print any data or control the flow, tjava component is more optimal.
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂