Hi everybody,
In today’s blog I will be a little selfish and I will talk about some PI working we have been doing, but I promise to add some more entries of growing professionally as soon as I can.
Talking about developing interfaces, It’s been fun for me working on PI these days, since I have included some coding inside some of them, and I so love coding… 😀
My last requirement was to build a query to a LDAP server from PI. After making some research I’ve found that we could work with Java Proxies.
Although that is a solution to the requirement, We decided to try a more interesting maintainable UDF approach =)
After making some developing work in NWDS we came out with a program that we integrated as UDF’s to simulate a lookup behavior for our application:
Within this solution we took advantage of 3 features not commonly used within PI:
1. Call an UDF from another UDF:
This is possible if you include both functions within the graphical mapping, and then proceed to add the container parameter at the end of the call:
String DirectoriosString = ExplorarDirectorio(LdapServer[0], Usuario[0], Password[0], vNombreDirectorio, 10000, 1, container);
This behavior can even be recursive, which we used to go deep in the structure and bring more than 10,000 records for the result.
2. Take advantage of ResultLists:
We took advantage of the ResultLists to collect the corresponding results, and later, transform them to different rows for the XML we are delivering (Through some node functions)
3. Make a remote call from a UDF.
This was the feature that I enjoyed the most, due to, inside a single mapping we were able to reach another server (Kind of a lookup behavior) and bring back the data for our final result.
I will try reaching other kind of servers if I have the occasion some other day.
After reviewing this implementation the only thing missing is some java coding to connect to an LDAP server, fortunately, you can find some of those on the web (sample1, sample2), and Boila, you could implement your own LDAP UDF “Lookup” 🙂
So, this concludes with this episode, but keep the hardworking and keep finding new great things everyday,
See you on the next post,
Edgar Martinez.


