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 = api.getUserByUUID(userObj.getManagerUUID());
return manager1.email;