I have created a workflow using kaleo workflow.In this i am trying to assign a task to multiple users,I used groovy script in scripted assignment tag for this.But its not working .when am putting two userid's in user object,first one gets replaced and second user got the approvel task. also i used users arraylist for this,like roles in kaleo single approver scripted assignment definition.but no use.
How can i manage this.
This is my code.
roles=null;
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
String secondid;
try
{
Class.forName(dbDriver);
con= (Connection) DriverManager.getConnection(dbUrl,dbUser,dbPwd);
stmt = con.createStatement();
rs = stmt.executeQuery("select ap1,ap2 from test where id = '"+userId+"'");
users=new ArrayList<User>();
while (rs.next())
{
println "approverid one"+rs.getInt(1);
println "approverid two"+rs.getInt(2);
user=UserLocalServiceUtil.getUser(Long.parseLong(rs.getString(1)));
user=UserLocalServiceUtil.getUser(Long.parseLong(rs.getString(2)));
users.add(user);
println "array list:"+users;
}
rs.close();
con.close();
}
catch(SQLException e)
{
e.printStackTrace();
}
catch(ClassNotFoundException e)
{
e.printStackTrace();
}
]]>
</script>
<script-language>groovy</script-language>
</scripted-assignment>
when am adding two user id in user tag.also it indicate error in definition while uploading.