When working with Oracle BPM 11g you may find that there is an overwhelming amount of functionality that is available. Learning every trick and every secret is a constant effort that will never end due to new patches, patch sets, and product releases coming down the pipe. In any case, I have a nice little trick of exposing the existing Identity Service XPath functions within the BPM Expression Builder editor for JDeveloper version 11g 126.96.36.199.0 (PS3). The Identity Service XPath functions are not automatically exposed in this version of JDeveloper. I believe that in JDeveloper version 188.8.131.52.0 PS4 the services are available without having to do anything but I will let you confirm whether or not the functions are actually there.
The Identity Service XPath functions will allow you to access LDAP information (internal Weblogic or 3rd party LDAP configured for your Weblogic domain) such as existing groups/roles, users assigned to groups/roles, user profile properties, etc. See the following documentation to understand all of the documented functionality that the Identity Service provides:
In the upcoming example I will explain the following:
- How to update the existing BPM XPath function configuration for JDeveloper
- The new list of functions
- How to get an email address using a new Identity Service XPath function
- Download the new BPM XPath function configuration file:
- Copy the downloaded file to the following locaction of your JDeveloper installation: <jdevhome>\jdeveloper\integration\seed\soa\configuration
- Close JDeveloper if you have it open
- Rename the existing configuration file from "bpm-xpath-functions-config.xml" to another name or cut and paste the existing file to a different directory. DO NOT delete the file. In the chance that something goes wrong and you need the original file, you should keep it available to undo any changes.
- Rename the new configuration file from "bpm-xpath-functions-config.xml_.txt" to "bpm-xpath-functions-config.xml"
- Start JDeveloper
- Create a BPM process model or open an existing application that contains a BPM process model. This example will reference an existing BPM application that I have created.
- The new Identity Service XPath functions will be available in any associations mapping of any BPM activity. For this example, I am opening an Interactive Activity (a green activity) to use one of the new functions.
New Identity Service Functions:
- I am going to take the user id of the user who executes this activity (or more correctly the human task associated to the BPM instance of this activity) and I will use the user id with one of the newly exposed Identity Service XPath functions to get the email address of the user.
- You may wonder how I have access to the user Id of the user who executed the activity. There is a tiny bit of information available within the "execData" field that is returned upon execution of any BPM Interactive Activity. The following segment of code:
used within the XPath function:
will give you the email address of the user.
Now that you have the steps for exposing and using the Identity Service XPath functions you can save yourself the trouble of adding external service references, LDAP api's, etc. to your SOA composites in order to get the identity information that you need.