JNDI Examples

Searching Within the Directory Service

This example uses a common where statement to search for activities whose activity name is 'End'. The second example compares directory service entries to two conditions set in the method. The participant must be named 'Robert' AND must belong to the 'Documentation' Organizational Unit to be considered a match.
	//common where
	
	for each ad in activitydefinition
	where activityname = "End"
	do
	  display "This process has an End activity: " + ad.cn
	end
	
//Operand equivalence and
	for each hp in humanparticipant
	where hp.ou = "Documentation" and hp.cn = "Robert"
	do
	display "The participant: " + hp.cn
	end

Search in the Directory Service by dn

A search by dn cannot be done using the for each statement, as it is like the primary key of an entry in the Directory Service. To search by dn you must use the lookup statement, as shown below.
	data = "c=Argentina"
	result = lookup(country, dn : data)
	
	if (result) then
	    delete country
	end
	

Store a new Item in the Directory Service

This example shows how to store a new item in the directory.
	o1 = OrganizationalUnit()
	o1.ou = "test21"
	o1.description = "foo1"
	o1.dn = "ou=test21"
	o1.postalCode = "1001"
	o1.store()
	
Note: When you run JNDI component calls in the Method Debugger, a set of false information is returned. Actual information stored in directory services is not available until runtime, when the process is published and deployed.