listWorkItems

This request returns a list of the work items for the logged-in user.

Syntax

com.tibco.wcc.base.Requests.listWorkItems(requestId,
                                          numStartIndex,                                                   
                                          numReturnCount,
                                          txtFilter,
                                          txtSort);

Parameters

  • requestId - (String) Uniquely identifies the request. For more information, see Submitting Server Requests.
  • numStartIndex - (Number) Index of the first item to return.
  • numReturnCount - (Number) The number of work items to return.
  • txtFilter - (String) The filter expression to apply to determine the work items to return. For information about filter syntax, see the "Sorting and Filtering Work Item Lists" topic in the developer's guide for your BPM runtime environment.

    For example:

    startDate < 2011-03-11T00:00:00.000-08:00
  • txtSort - (String) The sort order to apply to the work items returned. Specify the sort field, following by either ASC or DESC, for ascending or descending, respectively. Separate multiple sort fields with commas. For example:
    priority ASC, startDate DESC

    Use the following sort field names in the txtSort parameter:

    Attribute Sort field name
    Attribute #1 - Attribute #40 attribute1 - attribute40
    Distribution Strategy distributionStrategy
    Target Date endDate
    Instance Description appInstanceDescription
    ID appInstance
    Priority priority
    Process Template appName
    Start Date startDate
    Work Item ID id

Returns

This request returns the following elements:

  • <ap:StartPosition> - The index number of the first work item returned.
  • <ap:EndPosition> - The index number of the last work item returned.
  • <ap:TotalItems> - The total number of work items returned.
  • <ap:WorkItems> - This contains an <ap:WorkItem> element for each work item returned. The <ap:WorkItem> element contains the following elements:
    • <ap:ID> - The work item ID.
    • <ap:Version> - The number of times the work item has changed state. The version number starts at 0 when the work item is created, and is incremented by 1 each time it changes state.
    • <ap:Name> - The name of the task in the process to which the work item is associated.
    • <ap:Description> - The description of the task in the process to which the work item is associated.
    • <ap:StartDate> - Date and time the work item was created and arrived in the work item list.
    • <ap:EndDate> - A deadline date and time for the work item. Note that this is shown as “Target Date” by default in the application.
    • <ap:DistributionStrategy> - Method used to distribute the work item when it was originally created, either “Offer” or “Allocate”.
    • <ap:Priority> - Numeric value indicating the relative importance of the work item.
    • <ap:GroupID> - Identifies a number of work items that are grouped together in the process definition for some purpose. A 0 (zero) indicates the work item is not grouped with others.
    • <ap:ActivityID> - Identifies the user activity within the process that generated the work item. This number is used in the event viewer to identify the work item across all components.
    • <ap:ActivityName> - The name of the user task that generated the work item.
    • <ap:AppID> - A GUID for the application.
    • <ap:AppInstance> - The ID of the process instance from which the work item was created.
    • <ap:AppInstanceDescription> - The description of the process instance from which the work item was created.
    • <ap:AppName> - Name of process that was started to create this work item.
    • <ap:ScheduleStatus> - Indicates if the work item is inside its schedule period, which is considered from the start date/time to the target date/time. The possible values are: BEFORE, DURING, AFTER and NO_SCHEDULE.
    • <ap:State> - The work item’s current state: OFFERED, ALLOCATED, CREATED, OPENED, PENDED, PENDHIDDEN, or SUSPENDED.
    • <ap:WorkTypeID> - The work type ID.
    • <ap:WorkTypeUID> - The work type universal ID.
    • <ap:WorkTypeVersion> - The work type version number.
    • <ap:WorkTypeDescription> - The work type description.
    • <ap:Visible> - true = work item is visible; false = work item is hidden.
    • <ap:Attributes> - This element contains sub-elements <ap:Attribute1> through <ap:Attribute40> representing Attributes 1-40 in the work item, but only for those attributes that contain a value.

      For example:

<ap:Requests>
  <ap:ListWorkItems Id="ApiSample.listWorkItems">
    <ap:StartPosition>0</ap:StartPosition>
    <ap:EndPosition>3</ap:EndPosition>
    <ap:TotalItems>4</ap:TotalItems>
    <ap:WorkItems>
      <ap:WorkItem>
        <ap:ID>52</ap:ID>
        <ap:Version>2</ap:Version>
        <ap:Name>Respond</ap:Name>
        <ap:Description>Respond</ap:Description>
        <ap:StartDate>2011-02-25T08:54:53.657-08:00</ap:StartDate>
        <ap:EndDate />
        <ap:DistributionStrategy>OFFER</ap:DistributionStrategy>
        <ap:Priority>50</ap:Priority>
        <ap:GroupID>0</ap:GroupID>
        <ap:ActivityID>pvm:001i2h</ap:ActivityID>
        <ap:ActivityName>Respond</ap:ActivityName>
        <ap:AppID>_Y_SqoV6zEd-KqJmYNEw8ow</ap:AppID>
        <ap:AppInstance>pvm:0a129</ap:AppInstance>
        <ap:AppInstanceDescription />
        <ap:AppName>CSCallbackProcess</ap:AppName>
        <ap:ScheduleStatus>DURING</ap:ScheduleStatus>
        <ap:State>OFFERED</ap:State>
        <ap:WorkTypeID />
        <ap:WorkTypeUID />
        <ap:WorkTypeVersion />
        <ap:WorkTypeDescription />
        <ap:Visible>true</ap:Visible>
        <ap:Attributes>
          <ap:Attribute1>Retired</ap:Attribute1>
          <ap:Attribute2>2010</ap:Attribute2>
        </ap:Attributes>
      </ap:WorkItem>
             .
             .
             .
    </ap:WorkItems>
  </ap:ListWorkItems>
</ap:Requests>