BigDecimal Problem

 

Hi Community!

I'm trying to use some groovy code to do an update according to a list. Well, I'm having some bad time, probably because my code have something wrong.

import groovy.sql.Sql

<p>
	def lista = []</p>

<p>
	Sql sql = BonitaSql.newInstance("jdbc:oracle:thin:@MYIPADRESS:orcl1", "NAME", "PASS",new oracle.jdbc.OracleDriver())<br />
	sql.eachRow "SELECT CD_USUARI FROM VULTIMOLOG WHERE DAT &lt; (sysdate - 20)", {lista +=it.CD_USUARI}<br />
	sql.close()</p>

<p>
	def Integer n = lista.size();<br />
	for (int i=0; i&lt;n; i++)<br />
	{<br />
	Sql sql2 = BonitaSql.newInstance("jdbc:oracle:thin:@MYIPADRESS:orcl1", "NAME", "PASS",new oracle.jdbc.OracleDriver())<br />
	def Integer s1 = lista.getAt(i).get(1)<br />
	def query="UPDATE NAME.SIUSUARI SET CH_ATIVO = 'I' WHERE CH_ATIVO ='A' AND &amp;${s1} "<br />
	sql2.execute(query);<br />
	}<br />
	return lista</p>

I keep getting this error:

Exception was:org.bonitasoft.engine.expression.exception.SExpressionEvaluationException: groovy.lang.MissingMethodException: No signature of method: java.math.BigDecimal.get() is applicable for argument types: (java.lang.Integer) values: [1]
Possible solutions: grep(), next(), pow(int), grep(java.lang.Object), getAt(java.lang.String), wait()

 

Any clues?

TIA.

Hi everyone!

Kinda solved my problem by removing the "get(1)"  from my code, since my list have only 1 column.