One column editable table grid doesn't display variable contents in Bonita 6.2.6
When I assign value, through a script, to a variable Data type:java object, class: java.util.list; and then, in another task, used the variable in an Editable grid of one column (the variable contains 1 column also), I mean, that is not multiple, Why does not display the saved data? When the variable in a editable grid that is multiple is not problem at all and show it OK.
The script where the variable takes its value is:
import groovy.sql.Sql; def result = []; Sql sql = BonitaSql.newInstance("jdbc:firebirdsql://dbserver:3050/BPM", "consultas", "consultas", new org.firebirdsql.jdbc.FBDriver()); sql.eachRow("select atributo_pv from atributos_pv where id_segmento = " + idSegmento + " order by atributo_pv", { row -> result.add(row.atributo_pv); }); sql.close(); return result;
And the script return type of result is: java.util.list
Hello,
in order to show it Editable grid, your variable should be a list of lists (not a simple list of values), for example [["atributo_pv_1"],["atributo_pv_2"],["atributo_pv_3"]]. So, for each row, you should build a list first, and then add each list (row) to the result list.
As a general recommandation, it is advised to use a connector and not to run SQL queries within Groovy scripts.
Hope this helps, Haris
Comments
I generate a list of lists using a groovy script, and when I use that variable in a text area for example shows me properly armed list, but when I add it to the table editable process fails.