Four Stars

tMap error Exception in thread "main" java.lang.Error: Unresolved comp

Hello
I have the following error when i run some code in the expression builder of tMap
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
this is my code, can anyone help?
while (StringHandling.LEN("row2.id") != Var.MaxLen)
{
row2.updatedID ="0" + row2.id ;
}

row2.id=string
var.MaxLen=int
row2.updatedId=string
Ashley
6 REPLIES
Community Manager

Re: tMap error Exception in thread "main" java.lang.Error: Unresolved comp

Hi
Try this expression in the expression field of column:
StringHandling.LEN(row2.id)==Var.MaxLen?row2.id:"0"+row2.id
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Four Stars

Re: tMap error Exception in thread "main" java.lang.Error: Unresolved comp

thank you for your reply Shong
can you be clear where to use this?
Four Stars

Re: tMap error Exception in thread "main" java.lang.Error: Unresolved comp

just realised that my code doesnt make sense.
it should be
(i am trying to make ids all with the same length)
row2.updatedID=row2.id;
while (StringHandling.LEN("row2.updatedId") < Var.MaxLen)
{
row2.updatedId ="0" + row2.updatedId ;
}


however i am still having errors
Four Stars

Re: tMap error Exception in thread "main" java.lang.Error: Unresolved comp

got it working!
many thanks
One Star

Re: tMap error Exception in thread "main" java.lang.Error: Unresolved comp

when i am trying to remove ? symbol from my data which is bigdecimal i am getting this exception
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
can you please tell me hoe to remove that symbol in tmap
Community Manager

Re: tMap error Exception in thread "main" java.lang.Error: Unresolved comp

when i am trying to remove ? symbol from my data which is bigdecimal i am getting this exception
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
can you please tell me hoe to remove that symbol in tmap

Can you please show us your expression? If you want to achieve some if...else statement in tMap, you have to use the following expression format:
condition?value if true: value if false
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business