AVIO Insights

Oracle BPM 11g (11.1.1.4.0) Exposing Identity Service XPath Functions

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 11.1.1.4.0 (PS3).  The Identity Service XPath functions are not automatically exposed in this version of JDeveloper.  I believe that in JDeveloper version 11.1.1.5.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: 

http://download.oracle.com/docs/cd/E12839_01/integration.1111/e10224/bp_workflow.htm#BABGJDEE

 In the upcoming example I will explain the following:

  1. How to update the existing BPM XPath function configuration for JDeveloper
  2. The new list of functions
  3. How to get an email address using a new Identity Service XPath function

Example:

  1. Download the new BPM XPath function configuration file:

    https://www.avioconsulting.com/sites/default/files/bpm-xpath-functions-config.xml_.txt
  2. Copy the downloaded file to the following locaction of your JDeveloper installation: <jdevhome>\jdeveloper\integration\seed\soa\configuration  
  3. Close JDeveloper if you have it open
  4. 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.
  5. Rename the new configuration file from "bpm-xpath-functions-config.xml_.txt" to "bpm-xpath-functions-config.xml"
  6. Start JDeveloper
  7. 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.
  8. 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.

    Function Options



    New Identity Service Functions:

    Identity Service Functions

     

  9. 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.

    Get Email Address Of User

     

  10. 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: 

"bpmn:getDataOutput('execData')/ns:systemAttributes/ns:updatedBy/ns:id" 

   used within the XPath function:

"id1:getUserProperty(bpmn:getDataOutput('execData')/ns:systemAttributes/ns:updatedBy/ns:id, 'mail')"

   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.

2 minute read