Creating and Managing Supervised Work List Views - Example 1

In this example, a user requests a list of available supervised work lists.

Supervised Work Lists

Procedure

  1. Find out what work lists the user has access to by calling listActionAuthorisedEntities for the viewWorkList system action. The response contains a list of GUIDs. Each GUID identifies an organization model entity whose work list the calling user is authorized to view.
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sec="http://security.api.de.n2.tibco.com">
       <soapenv:Header/>
       <soapenv:Body>
          <sec:listActionAuthorisedEntities component="BRM" name="viewWorkList"/
       </soapenv:Body>
    </soapenv:Envelope>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
       <SOAP-ENV:Header/>
       <SOAP-ENV:Body>
          <listActionAuthorisedEntitiesResponse xmlns="http://security.api.de.n2.tibco.com">
             <guid xmlns="">_2ieLgMpREd64gM7QE8RwxA</guid>
             <guid xmlns="">_1ErNcPdyEeGYxbPtftvtUA</guid>
             <guid xmlns="">_tO9Y8PdzEeGYxbPtftvtUA</guid>
             <guid xmlns="">_Xf_9sPdpEeGYxbPtftvtUA</guid>
          </listActionAuthorisedEntitiesResponse>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
  2. For each GUID returned in the listActionAuthorisedEntities response, call getOrgModelEntity to obtain the organization model entity’s entity-type, along with other details—its name, whether it has any child entities and so on.
    Note: You can use this information to present the available supervised work lists to the user in your desired manner. See also Navigating the Organization 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:getOrgModelEntity model-version="-1">
             <guid>_2ieLgMpREd64gM7QE8RwxA</guid>
          </org:getOrgModelEntity>
       </soapenv:Body>
    </soapenv:Envelope>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
       <SOAP-ENV:Header/>
       <SOAP-ENV:Body>
          <getOrgModelEntityResponse model-version="3" xmlns="http://orgmodel.api.de.bpm.tibco.com">
             <position guid="_2ieLgMpREd64gM7QE8RwxA" ideal-number="1" label="Rep" name="AcmeCustomerServiceRepresentative" resource-count="3" xmlns="">
                <allocation-method method="ANY"/>
                <location-ref guid="_h-Ao8MpREd64gM7QE8RwxA" label="Swindon UK" name="Swindon"/>
                <req-capability guid="_LlK0IMpQEd64gM7QE8RwxA" label="Language Spoken" name="LanguageSpoken">
                   <qualifier-value>Spanish</qualifier-value>
                   <qualifier-value>English</qualifier-value>
                </req-capability>
                <req-capability guid="_dTR0oMpQEd64gM7QE8RwxA" label="Opt Out Of Junk Mail" name="MarketingOptOut"/>
                <req-capability guid="_iGzOAMpQEd64gM7QE8RwxA" label="Orientation Completed" name="OrientationCompleted"/>
                <privilege-holding guid="_I8YiEMpSEd64gM7QE8RwxA" label="Is A Base User" name="BaseUser"/>
             </position>
          </getOrgModelEntityResponse>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
  3. When the user selects a supervised work list to view, call either, or both of, the following:
    • getWorkListItems, to retrieve the list of work items currently offered to this user.
    • getAllocatedWorkListItems, to retrieve the list of work items currently allocated to this user.

      In either case, specify the organization model entity’s entity-type and GUID as parameters to this call.

      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.brm.n2.tibco.com">
         <soapenv:Header/>
         <soapenv:Body>
            <api:getWorkListItems startPosition="0" numberOfItems="5" >
               <entityID model-version="-1" entity-type="POSITION" guid="_2ieLgMpREd64gM7QE8RwxA"
               </entityID>
            </api:getWorkListItems>
         </soapenv:Body>
      </soapenv:Envelope>
      <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
         <SOAP-ENV:Header/>
         <SOAP-ENV:Body>
            <getWorkListItemsResponse xmlns="http://api.brm.n2.tibco.com">
               <startPosition xmlns="">0</startPosition>
               <endPosition xmlns="">0</endPosition>
               <totalItems xmlns="">1</totalItems>
               <workItems xmlns="">
                  <id id="5" version="0"/>
                  <header distributionStrategy="OFFER" priority="50" startDate="2015-05-19T16:16:30.860Z">
                     <name>RepResponce</name>
                     <description>Rep Responce</description>
                     <flags>
                        <scheduleStatus>DURING</scheduleStatus>
                     </flags>
                     <itemContext>
                        <activityID>pvm:001i18</activityID>
                        <activityName>RepResponce</activityName>
                        <appInstance>pvm:0a126</appInstance>
                        <appName>CSCallbackProcess</appName>
                        <appID>_Y_SqoV6zEd-KqJmYNEw8ow</appID>
                     </itemContext>
                  </header>
                  <state>OFFERED</state>
                  <visible>true</visible>
               </workItems>
            </getWorkListItemsResponse>
         </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>