How to use LDAP connector of BonitaSoft?

My basic requirement for LDAP was to fetch the data of logged in user from LDAP server instead of getting it from the user. To use LDAP connector, follow the following steps:

1. First connect to LDAP Server.

 

2. Specify the attributes that you want to fetch from LDAP Server. I have chosen Common Name (cn) and Email-Id (mail).

3. The most important step is to get out the data from the predefined variable of bonita. Here ldapAttributeList is list of lists type variable, containing data like [[cn=Priyanka, mail=anjali@gmail.com]]. So it need to extract the data very carefully.

Here is the code that I used:

import org.bonitasoft.connectors.ldap.*
//def list = []
for (i in ldapAttributeList) {
  for (j in i) {
    if (j.getName() == "cn" ) {
      //list.add(j.getValue())
        applicant_name=j.getValue()
    }
  }}
return applicant_name

Here applicant_name is the global variable used in Bonita process with data type ‘text’. Return line is important, without it you will get empty list.

Advertisements

About Priyanka Kapoor

Simple, Hardworking & friendly.....
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s