error : cannot convert from string to boolean

One Star

error : cannot convert from string to boolean

Hello,
I've a problem with the tMap component. I have this error :
"Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Type mismatch: cannot convert from String to boolean"
Here is the tMap expression I use (everything is String)
row16.E_NOFINESS + StringHandling.LEFT((String) row11.NUMLOT,1) .equals("1") ? row11.NUMLOT : StringHandling.RIGHT((String) row11.NUMLOT,1)

Can someone help me to do it work ?
Thanks a lot
MarieO
One Star

Re: error : cannot convert from string to boolean

Hello,
Could you put some screenshots of your Tmap in your post?
Thanks
JC
One Star

Re: error : cannot convert from string to boolean

Here is the screenshot...
Thank you
MarieO
Employee

Re: error : cannot convert from string to boolean

Try this with additional brackets:
row16.E_NOFINESS  + ( StringHandling.LEFT((String) row11.NUMLOT,1) .equals("1") ? row11.NUMLOT : StringHandling.RIGHT((String) row11.NUMLOT,1) )

Calling Talend Open Studio Users

The first 100 community members completing the Open Studio survey win a $10 gift voucher.

Start the survey

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch