Adding Values to Organization Model Attributes

If you have attributes defined for the resources in your organization model, you can use operations from the OrgResourceService to work with those attributes.

The following diagram shows an example of how calls to the OrgResourceService APIs can be used to add values to attributes.

Adding Values to Organization Model Attributes

The following step-by-step descriptions correspond to the numbered steps in Figure 6. 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 Adding Values to Organization Model Attributes — Service Connector API Example (Java).)

Procedure

  1. Search for resources using the findResources operation.

    The request can include either resource names to search for, or one or more organization model entities for which associated resources are returned. (If required, the request can include a combination of entity GUIDs and resource names.)

    The response identifies the resources found in the search.

     <soapenv:Body>
         <res:findResources model-version="2" current-only="true" > <entity-ref guid="_ulVdsGOREeG8wf89r27lCA" deep-search="false"/ >      </res:findResources
    </soapenv:Body>
     <SOAP-ENV:Body>
         <findResourcesResponse model-version="2" xmlns="http://resource.api.de.bpm.tibco.com" >          <resource guid="A05FBD1A-2B14-4AA8-B2FB-0E2A11ADFC7D" label="Clint Hill" name="Clint Hill" xmlns=""/ > <resource guid="4B1E8028-F0BC-416F-9BAE-454FBC54DEA9" label="John Eustace" name="John Eustace" xmlns=""/ >      </findResourcesResponse
    </SOAP-ENV:Body>
  2. Get details, including all current attribute values, for the desired resources using the getResource operation.
     <soapenv:Body>
          <res:getResource model-version="2" > <guid > A05FBD1A-2B14-4AA8-B2FB-0E2A11ADFC7D</guid >       </res:getResource
    </soapenv:Body>
  3. Use the updateResource operation to set any attribute values for the desired resources, as well as add or remove privileges and capabilities, or assign or remove the resources from the specified groups and positions.

    The response returns all details for the updated resources.

    <soapenv:Body>
      <res:updateResource model-version="2" > <resource guid="A05FBD1A-2B14-4AA8-B2FB-0E2A11ADFC7D" > <set-attribute guid="_ODtVUGnCEeGuucqjClDSkg" > <value > Sample One</value > </set-attribute > <set-attribute guid="_OWBNUGnCEeGuucqjClDSkg" > <value > true</value >             </set-attribute > </resource > </res:updateResource
    </soapenv:Body>
    <SOAP-ENV:Body>
    <updateResourceResponse xmlns="http://resource.api.de.bpm.tibco.com">
             <resource container-id="51" container-name="easyAs" guid="A05FBD1A-2B14-4AA8-B2FB-0E2A11ADFC7D" label="Clint Hill" model-version="2" name="Clint Hill" resource-type="HUMAN" xmlns="" > <position guid="_ulVdsGOREeG8wf89r27lCA" label="Position1" name="Position1"/ > <privilege guid="_n6_soGOREeG8wf89r27lCA" label="Privilege2" name="Privilege2" >  <org-unit guid="_t3jxsGOREeG8wf89r27lCA" label="OrgUnit1" name="OrgUnit1"/ > </privilege > <privilege guid="_oRp5IGOREeG8wf89r27lCA" label="Privilege3" name="Privilege3" > <position guid="_ulVdsGOREeG8wf89r27lCA" label="Position1" name="Position1"/ > </privilege > <privilege guid="_nhXrsGOREeG8wf89r27lCA" label="Privilege1" name="Privilege1" > <qualifier-value > Value3</qualifier-value > <qualifier-value > Value2</qualifier-value > <org-unit guid="_t3jxsGOREeG8wf89r27lCA" label="OrgUnit1" name="OrgUnit1"/ > </privilege > <privilege guid="_n6_soGOREeG8wf89r27lCA" label="Privilege2" name="Privilege2" > <position guid="_ulVdsGOREeG8wf89r27lCA" label="Position1" name="Position1"/ > </privilege > <attribute guid="_ODtVUGnCEeGuucqjClDSkg" label="TextAttribute" name="TextAttribute" type="String" > <value > Sample One</value > </attribute > <attribute guid="_OWBNUGnCEeGuucqjClDSkg" label="BooleaAttribute" name="BooleaAttribute" type="Boolean" > <value > true</value > </attribute > <attribute guid="_Os-UwGnCEeGuucqjClDSkg" label="DateAttribute" name="DateAttribute" type="Date"/ > <attribute guid="_Rf-n4GnCEeGuucqjClDSkg" label="DateTimeAttribute" name="DateTimeAttribute" type="DateTime"/ >             <attribute guid="_RzMe0GnCEeGuucqjClDSkg" label="DecimalAttribute" name="DecimalAttribute" type="Decimal"/ > <attribute guid="_SD2xAGnCEeGuucqjClDSkg" label="EnumAttribute" name="EnumAttribute" type="Enum"/ > <attribute guid="_gInsQGnCEeGuucqjClDSkg" label="EnumSetAttribute" name="EnumSetAttribute" type="EnumSet"/ > <attribute guid="_lDayUGnCEeGuucqjClDSkg" label="IntegerAttribute" name="IntegerAttribute" type="Integer"/ > <attribute guid="_nEpqQGnCEeGuucqjClDSkg" label="TimeAttribute" name="TimeAttribute" type="Time"/ >             <ldap-reference ldap-alias="easyAs" ldap-dn="OU=Clint Hill, OU=Swindon, OU=AllEmployees, O=easyAsInsurance"/
             </resource>
    </updateResourceResponse>
    </SOAP-ENV:Body>