On 08/07/19 16:20, Rainer Herbst wrote:
Dear all,
sorry for botherin, but I got stucked trying to manipulate some fields
while pulling user entries from a CSV file.
In the File, I have a field "passwd" containing values 0 and 1. I want
to map that into a field "isActive" of type boolean.
So, I tried to create a Pull Transformer like:
if (value == 1) { return true;} else { return false;}
What did I missed? Any help greatly appreciated!
Hi,
I don't have time to try right now, but the JEXL expression as follows
should work:
return value == "1"
First because CSV values are all strings, second to use ternary
expression with boolean.
HTH
Regards.
--
Francesco Chicchiriccò
Tirasa - Open Source Excellence
http://www.tirasa.net/
Member at The Apache Software Foundation
Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
http://home.apache.org/~ilgrosso/