Mapping Resource Attributes to LDAP Attributes

When an organization model is created using the TIBCO Business Studio Organization Modeler, you can also create resource attributes. These attributes can contain data that the business process may access during runtime.

The following shows an example of some resource attributes that were created in TIBCO Business Studio:

These attributes are available for each resource that you create or map to groups or positions. For example, each resource’s cell phone number can be stored in the CellPhone attribute.

You may need to map one or more of these resource attributes to attributes in the LDAP sources you have defined in your LDAP container. You may need to do this because the business process does not have direct access to the attributes in the LDAP sources, but it does have access to the resource attributes in the organization model.

When you map a resource attribute to an LDAP attribute, it gives the business process access to the data in the LDAP attribute at runtime.(1)

The following diagram shows an example of how you can map resource attributes to LDAP attributes.

Mapping Resource Attributes to LDAP Attributes

The following step-by-step descriptions correspond to the numbered steps in Figure 8. Note that the descriptions are from a web service operation point of view, and provide an example of performing the operations using the web service API (SOAP). (For an equivalent example using the Service Connector API (Java), see Mapping Resource Attributes to LDAP Attributes — Service Connector API Example (Java).)

Procedure

  1. Use the getOrgModel operation to get details about the entities in an organization model

    The request identifies the major version number of the organization model, which can be obtained using the listOrgModelVersions operation.

    The response from the getOrgModel operation provides GUIDs for all entities in the organization model, including resource attributes defined in the model.

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:org="http://orgmodel.api.de.bpm.tibco.com">
       <soapenv:Header/>
       <soapenv:Body>
          <org:getOrgModel model-version="2" include-resource-counts="true" include-calendar-alias="false"/
       </soapenv:Body>
    </soapenv:Envelope>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
       <SOAP-ENV:Header/>
       <SOAP-ENV:Body>
          <getOrgModelResponse model-version="2" xmlns="http://orgmodel.api.de.bpm.tibco.com">
             <capability guid="_xI4ikMpPEd64gM7QE8RwxA" label="Can Travel" name="CanTravel" resource-count="0" xmlns=""/>
             <capability guid="_0K47AMpPEd64gM7QE8RwxA" label="Consulting Rate" name="ConsultingRate" resource-count="0" xmlns="">
                <qualifier guid="_WjnlAPl_Ed6Q1ZnFgJo3zg" label="Consulting Rate Qualifier" name="ConsultingRateQualifier" type="Decimal"/>
             </capability>
             <capability guid="_BJKvUMpQEd64gM7QE8RwxA" label="Degree" name="Degree" resource-count="0" xmlns="">
                <qualifier guid="_B55BoMpQEd64gM7QE8RwxA" label="Degree Qualifier" name="DegreeQualifier" type="String"/>
             </capability>
             <capability guid="_FhcXIMpQEd64gM7QE8RwxA" label="Extended End Of Day" name="ExtendedEndOfDay" resource-count="0" xmlns="">
                <qualifier guid="_G1L28MpQEd64gM7QE8RwxA" label="Extended End Of Day Qualifier" name="ExtendedEndOfDayQualifier" type="Time"/>
             </capability>
             <capability guid="_LlK0IMpQEd64gM7QE8RwxA" label="Language Spoken" name="LanguageSpoken" resource-count="0" xmlns="">
                <qualifier guid="_NwMhQMpQEd64gM7QE8RwxA" label="Language Spoken Qualifier" name="LanguageSpokenQualifier" type="EnumSet">
                   <enum-val>Chinese (Mandarin)</enum-val>
                   <enum-val>Japanese</enum-val>
                      .
                      .
                      .
             <resource-attribute guid="__HXIQMpSEd64gM7QE8RwxA" label="Last Name" name="LastName" type="String" xmlns=""/>
             <resource-attribute guid="_BBG4IMpTEd64gM7QE8RwxA" label="Full Name" name="FullName" type="String" xmlns=""/>
             <resource-attribute guid="_CRQ4cMpTEd64gM7QE8RwxA" label="Pay Hourly Rate" name="PayHourlyRate" type="Decimal" xmlns=""/>
             <resource-attribute guid="_FN6PwMpTEd64gM7QE8RwxA" label="Pay Is Hourly" name="PayIsHourly" type="Boolean" xmlns=""/>
             <resource-attribute guid="_HvSAUMpTEd64gM7QE8RwxA" label="Payments Per Year" name="PaymentsPerYear" type="Integer" xmlns=""/>
             <resource-attribute guid="_Jwwv4MpTEd64gM7QE8RwxA" label="Scheduled Break Time" name="ScheduledBreakTime" type="Time" xmlns=""/>
          </getOrgModelResponse>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
  2. Use the listContainers operation to list the LDAP containers to which you (the calling user) have access.

    The response from listContainers provides ldap-alias and ldap-query, which you will need to request the list of attributes from the LDAP source.

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dir="http://directory.api.de.bpm.tibco.com">
       <soapenv:Header/>
       <soapenv:Body>
          <dir:listContainers/
       </soapenv:Body>
    </soapenv:Envelope>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
       <SOAP-ENV:Header/>
       <SOAP-ENV:Body>
          <listContainersResponse xmlns="http://directory.api.de.bpm.tibco.com">
                   .
                   .
                   .
    <ldap-container active="true" description="Regional" id="4" last-accessed="2012-08-01T15:02:17.287Z" name="Regional" xmlns="">
                <primary-ldap ldap-alias="easyAs" ldap-query="(cn=*)" resource-name-attributes="ou"/>
                <secondary-ldap ldap-alias="deLdap2" ldap-query="(cn=*)" resource-name-attributes="cn">
                   <primary-link primary-attribute="ou" secondary-attribute="displayname"/>
                </secondary-ldap>
             </ldap-container>
             <ldap-container active="true" description="Southern District" id="5" last-accessed="2012-08-09T16:38:13.287Z" name="Southern" xmlns="">
                <primary-ldap ldap-alias="deLdap5" ldap-query="(objectClass=OrganizationalPerson)" resource-name-attributes="displayName"/>
             </ldap-container>
          </listContainersResponse>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
  3. Use the listAttributeNames operation to list the LDAP attributes in the identified LDAP source.
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dir="http://directory.api.de.bpm.tibco.com">
       <soapenv:Header/>
       <soapenv:Body>
          <dir:listAttributeNames ldap-alias="easyAs" base-dn="" ldap-query="(cn=*)" /
       </soapenv:Body>
    </soapenv:Envelope>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
       <SOAP-ENV:Header/>
       <SOAP-ENV:Body>
          <listAttributeNamesResponse entry-count="8" ldap-alias="easyAs" ldap-query="(cn=*)" xmlns="http://directory.api.de.bpm.tibco.com">
             <attribute binary="false" name="givenname" xmlns=""/>
             <attribute binary="false" name="sn" xmlns=""/>
             <attribute binary="true" name="userpassword" xmlns=""/>
             <attribute binary="false" name="ou" xmlns=""/>
             <attribute binary="false" name="departmentnumber" xmlns=""/>
             <attribute binary="false" name="employeetype" xmlns=""/>
             <attribute binary="false" name="manager" xmlns=""/>
             <attribute binary="false" name="mail" xmlns=""/>
             <attribute binary="false" name="carlicense" xmlns=""/>
             <attribute binary="false" name="objectClass" xmlns=""/>
             <attribute binary="false" name="postaladdress" xmlns=""/>
             <attribute binary="false" name="cn" xmlns=""/>
             <attribute binary="false" name="preferredlanguage" xmlns=""/>
             <attribute binary="false" name="employeenumber" xmlns=""/>
             <attribute binary="true" name="photo" xmlns=""/>
          </listAttributeNamesResponse>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
  4. Use the saveContainer operation to specify which resource attributes to map to named LDAP attributes.

    The saveContainer operation response indicates success by returning the container identifier.

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dir="http://directory.api.de.bpm.tibco.com">
       <soapenv:Header/>
       <soapenv:Body>
          <dir:saveContainer id="2" name="Eastern"  > <primary-ldap ldap-alias="easyAs" ldap-query="(cn=*)"  > <attribute-mapping resource-attr-guid="_7seVwMpSEd64gM7QE8RwxA" ldap-attribute="mail"/
             </primary-ldap>
          </dir:saveContainer>
       </soapenv:Body>
    </soapenv:Envelope>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
       <SOAP-ENV:Header/>
       <SOAP-ENV:Body>
          <saveContainerResponse container-id="2" xmlns="http://directory.api.de.bpm.tibco.com"/>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
1

Note that resource attributes of type "Enum" and "EnumSet" cannot be mapped to LDAP attributes.