Allocating Work Item to a Target Resource

You can choose to allocate a work item to a resource.

The work item can be allocated to one of the following:

  • Initial Offered Set. You can query the initial offered set using the operation getOfferSet and select a resource from the offer set to allocate the work item to.
  • World. If your system privileges include the reallocateWorkItemToWorld system action scoped at the organization model level, you can allocate the work item to a resource that was not included in the initial offered set. If there is more than one organization in your organization model, this can be any resource in an organization with which the current LDAP container has a relationship. See Organization Relationships for more details.
  • Self. You can allocate the work item to yourself.

The following diagram shows an example of how you might take a work item from the list of items offered to an organizational entity such as a group or position, and allocate it to a specific resource within the original offer set.

Allocating a Work Item

Procedure

  1. Use getOfferSet, specifying the ID of a work item, to list the entities to which this work item was offered.
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.brm.n2.tibco.com">
       <soapenv:Header/>
       <soapenv:Body>
          <api:getOfferSet>
             <workItemID id="51"/
          </api:getOfferSet>
       </soapenv:Body>
    </soapenv:Envelope>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
       <SOAP-ENV:Header/>
       <SOAP-ENV:Body>
          <getOfferSetResponse xmlns="http://api.brm.n2.tibco.com">
          <entityGuid xmlns="" > _5i1V0CfLEeChutsy_vK9tg</entityGuid
          </getOfferSetResponse>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
  2. Use listAssociatedResources to identify the GUID of one resource (user) from the offer set.
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:res="http://resolver.api.de.n2.tibco.com">
       <soapenv:Header/>
       <soapenv:Body>
          <res:listAssociatedResources model-version="-1" start-index="0" soft-limit="0">
             <entity-guid > _fE8zxSfJEeChutsy_vK9tg</entity-guid
          </res:listAssociatedResources>
       </soapenv:Body>
    </soapenv:Envelope>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
       <SOAP-ENV:Header/>
       <SOAP-ENV:Body>
          <listAssociatedResourcesResponse xmlns="http://resolver.api.de.n2.tibco.com">
             <resource guid="846D100C-77C8-42DE-BD01-C23D214D2BB4" name="Liam Lawrence" resource-type="HUMAN" xmlns=""
                <LdapReference container-id="1" container-name="EasyAs" ldap-alias="easyAs" ldap-dn="OU=Liam Lawrence, OU=London, OU=AllEmployees, O=easyAsInsurance"/>
             </resource>
             <resource guid="931F96FA-EC57-43B5-AA61-613784B1BD10" name="Leon Court" resource-type="HUMAN" xmlns=""
                <LdapReference container-id="1" container-name="EasyAs" ldap-alias="easyAs" ldap-dn="OU=Leon Court, OU=Paris, OU=AllEmployees, O=easyAsInsurance"/>
             </resource>
          </listAssociatedResourcesResponse>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
  3. Use allocateWorkItem to allocate the required work item to an individual resource. In this case it is Liam Lawrence, as you can see by comparing the resource GUID with the two GUIDs returned in the previous operation.
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.brm.n2.tibco.com">
       <soapenv:Header/>
       <soapenv:Body>
          <api:allocateWorkItem>
              <workItemID id="51"
         <resource > 846D100C-77C8-42DE-BD01-C23D214D2BB4</resource
          </api:allocateWorkItem>
       </soapenv:Body>
    </soapenv:Envelope>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
       <SOAP-ENV:Header/>
       <SOAP-ENV:Body>
          <allocateWorkItemResponse xmlns="http://api.brm.n2.tibco.com">
             <workItem xmlns="">
                <id id="51" version="1"/>
                <header distributionStrategy="OFFER" priority="50">
                   <name>DisplayMessage</name>
                   <description>Display Message</description>
                   <flags>
                      <scheduleStatus>DURING</scheduleStatus>
                   </flags>
                   <itemContext>
                      <activityID>pvm:001i11</activityID>
                      <activityName>DisplayMessage</activityName>
                      <appInstance>pvm:0a124</appInstance>
                      <appName>WelcomeUsers</appName>
                      <appID>_-fPYwCIVEeCnP8eZZTCDGg</appID>
                   </itemContext>
                </header>
                <state > ALLOCATED</state
                <visible>true</visible>
             </workItem>
          </allocateWorkItemResponse>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>>