Hi!

Thanks four your help!

Unfortunatly, the proposed solution does not work. I conducted a lot of tests, and are getting even more confused. E.g., if I want to add some strings to a mail attribute, the expression
value + '@aip.de'
does the job. But
value + '@aip.de';
returns nothing. I thougt the final semicolon is an optional part of a JEXL expression, but in Transformers, it is handled different, is'nt it?

Best regards,
Rainer


On Tue, 9 Jul 2019 14:29:24 +0200
 Francesco Chicchiriccò <[email protected]> wrote:
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/


Rainer Herbst
IT-Service
Phone: +49 331 7499-257
e-mail: [email protected]
https://www.aip.de

-----------------------------------------------------------------------------------------------
Leibniz-Institut für Astrophysik Potsdam (AIP)
An der Sternwarte 16, 14482 Potsdam

Vorstand: Prof. Dr. Matthias Steinmetz, Matthias Winker
Stiftung bürgerlichen Rechts
Stiftungsverzeichnis Brandenburg: 26 742-00/7026
-----------------------------------------------------------------------------------------------

Reply via email to