Problem with true/false function PostgreSQL

1
0
-1

Hi.

I have this error while trying to assign to a data variable(BOOLEAN) created at the pool level, true/false value from a postgreSQL function (returns BOOLEAN).

Caused by: org.bonitasoft.engine.expression.exception.SInvalidExpressionException: Declared return type class java.lang.Boolean is not compatible with evaluated type class org.postgresql.jdbc4.Jdbc4ResultSet for expression resultset

I've set my connector output as resultset and return type as java.lang.boolean. Whenever I want to assign to a data variable (LIST) the value of the resultset I use BonitaDBTools in order to obtain the list from the resultset. Is there something similar for this case?

Thanks in advance for any help.

2 answers

1
+2
-1
This one is the BEST answer!

Hello, the connector return a ResultSet. If you want to assign a BOOLEAN, you have to write the Groovy script to search the information from the resultset. I assume your request return one row, and in this row, you have only one columns where your boolean is saved. So, your groovy should be something like boolean myBoolean=false; if (resultSet.next()) { myBoolean = resultSet.getBoolean("NameOfTheSqlColumn"); } resultSet.close(); return myBoolean;

1
0
-1

thank you so much pierre-yves. I'll try that code right now and I'll let you know.

thanks a lot, you r the best.

Notifications