Bonitasoft Groovy Script

Bonitasoft Groovy Scripts to Get Users Data

Using below Groovy Script code you will get the complete information of a particular user in Bonitasoftt To get Manager Email address in Bonitasoft: ${import org.ow2.bonita.facade.IdentityAPI;import org.ow2.bonita.facade.identity.User;IdentityAPI api = apiAccessor.getIdentityAPI();User user = api.findUserByUserName(processInstance.getStartedBy());User manager1 = api.getUserByUUID(user.getManagerUUID());return manager1.email;} To get Professional Email of a user : ${import org.ow2.bonita.facade.IdentityAPI;import org.ow2.bonita.facade.identity.User;IdentityAPI api = apiAccessor.getIdentityAPI();User user = api.findUserByUserName(processInstance.getStartedBy());User manager1 […]

Groovy Script

Groovy Script SQL Connection Bonitasoft

Below is the SQL Connection for a Groovy Script for a SELECT Command in Bonitasoft BPM import groovy.sql.Sql;def host = “localhost”;def user = “bonita”;def pass = “bpm”;def schema = “bonita_journal”;def query = “SELECT * FROM BN_USER where USER_PRO_EMAIL_=’${email_Address__}’ limit 1”;def list=[];sql = providedscripts.BonitaSql.newInstance(“jdbc:mysql://${host}/${schema}”,user, pass, new com.mysql.jdbc.Driver())sql.eachRow(query,{row-> list.add(row.USER_USERNAME_)}); IdentityAPI api = apiAccessor.getIdentityAPI();User userObj = api.findUserByUserName(list[0]);User manager1 […]