pp108 : SearchHumanTasks

SearchHumanTasks


This method is used to search human tasks based on criteria. This API can search human tasks across targets. This API can also search human tasks on task identifiers from more than one delivery models. SearchHumanTask is part of the the Method Set WS-HumanTask Execution 2.0 in the application package Cordys Notification.

SOAP Request

<SearchHumanTasks xmlns="http://schemas.cordys.com/notification/ws-humantask/execution/2.0">
    <Variables>
        <Variable>
            <TaskIdentifier>
                <Name>PARAMETER</Name>
                <XPath>PARAMETER</XPath>
                <DataType>STRING | INTEGER | FLOAT | DATETIME | BOOLEAN</DataType>
                <Namespaces>
                    <Namespace>
                        <NamespaceURI>PARAMETER</NamespaceURI>
                        <NamespacePrefix>PARAMETER</NamespacePrefix>
                    </Namespace>
                </Namespaces>
            </TaskIdentifier>
        </Variable>
        <Variable>
            <Target>
                <Name>PARAMETER</Name>
                <Type>user | role | team | worklist</Type>
                <Dn>PARAMETER</Dn>
                <Id>PARAMETER</Id>
            </Target>
        </Variable>
    </Variables>
    <cursor maxRows="10" numRows="10" position="0"/>
    <Criteria>
        <Query/>
        <Parameters>
            <Parameter name="" type="" value="" variable=""/>
        </Parameters>
    </Criteria>
    <OrderBy/>
</SearchHumanTasks>

Sample SOAP Request


<SearchHumanTasks xmlns="http://schemas.cordys.com/notification/ws-humantask/execution/2.0">
    <Variables>
        <Variable>
            <Target>
                <Name>PMG</Name>
                <Type>worklist</Type>
                <Id>0024E89D-F70F-11E0-F50C-BBA4D25E992D</Id>
            </Target>
        </Variable>
        <Variable>
            <Target id="0024E89D-F70F-11E0-F50C-BBA4D25E992E"
                name="Workflow" type="team">
                <Name>Workflow</Name>
                <Type>team</Type>
                <Id>0024E89D-F70F-11E0-F50C-BBA4D25E992E</Id>
            </Target>
        </Variable>
        <Variable>
            <TaskIdentifier>
                <Name>IncidentType</Name>
                <DataType>STRING</DataType>
                <XPath>//proc:forminputdata/proc:freeformcontrols/proc:IncidentType</XPath>
                <Namespaces>
                    <Namespace>
                        <Namespaceurl>http://schemas.cordys.com/1.0/xforms/processapi</Namespaceurl>
                        <Namespaceprefix>proc</Namespaceprefix>
                    </Namespace>
                </Namespaces>
            </TaskIdentifier>
        </Variable>
        <Variable>
            <TaskIdentifier datatype="STRING" name="Customer" xpath="//proc:forminputdata/proc:freeformcontrols/proc:Customer">
                <Name>Customer</Name>
                <DataType>STRING</DataType>
                <XPath>//proc:forminputdata/proc:freeformcontrols/proc:Customer</XPath>
                <Namespaces>
                    <Namespace>
                        <Namespaceurl>http://schemas.cordys.com/1.0/xforms/processapi</Namespaceurl>
                        <Namespaceprefix>proc</Namespaceprefix>
                    </Namespace>
                </Namespaces>
            </TaskIdentifier>
        </Variable>
    </Variables>
    <cursor maxRows="10" numRows="10" position="0"/>
    <Criteria>
        <Query> (Task.Target=:PARAM1 OR Task.Target=:PARAM2) AND (IncidentType=:PARAM3) AND (Customer=:PARAM4 OR Customer=:PARAM5 OR Customer=:PARAM6) </Query>
        <Parameters>
            <Parameter name="PARAM1" type="Task.Target" variable="PMG"/>
            <Parameter name="PARAM2" type="Task.Target" variable="Workflow"/>
            <Parameter name="PARAM3" type="IncidentType" value="Enhancement"/>
            <Parameter name="PARAM4" type="Customer" value="Mercer"/>
            <Parameter name="PARAM5" type="Customer" value="KPN"/>
            <Parameter name="PARAM6" type="Customer" value="CSC"/>
        </Parameters>
    </Criteria>
    <OrderBy>Customer ASC, Task.DeliveryDate DESC</OrderBy>
</SearchHumanTasks>

Request Parameters

Parameter

Description

Data Type

Accepted Input Values

Variable\TaskIdentifier

Contains the Definition of the Task Identifier on which you can search or order.

Variable\TaskIdentifier\Name

Name of the Task Identifier. This name can be referred in the Criteria, OrderBy, and Parameter fields for denoting this task identifier.

String

Variable\TaskIdentifier\XPath

XPath of the Task Identifier.

String

Variable\TaskIdentifier\DataType

Datatype of the associated Task Identifier.

  • STRING
  • INTEGER
  • FLOAT
  • DATETIME
  • BOOLEAN

Variable\TaskIdentifier\Namespaces

Contains the mapping of the Namespace to namespace prefix of the assocaited Task Identifier XPath. This element contains multiple Namespace nodes. Each node contains the NamespaceURI and the associated NamespacePrefix as shown in the sample above.

Variable\Target

Contains the definition of the Target (either user, role, team, or worklist) on which you can search or order.

Variable\Target\Name

Contains the name of the Target This name can be referred in the Criteria, OrderBy, and Parameter fields to denote this target.

String

Variable\Target\Type

Contains the type of the Target.

String

  • user
  • role
  • team
  • worklist

Variable\Target\Dn

This element contains the DN of the user or role. This element should be included only when the Type contains either user or role. For other values this will be ignored.

String

Variable\Target\Id

This element contains the ID of the team or work list. This element should be included only when the Type field contains either team or work list. For other values this will be ignored.

String

cursor

Number of rows that would be returned by the query.

Criteria

Contains the parametrized queries that are used to search the task.
It can be based on:

  • System attributes such as
    • Activity
    • Assignee
    • Sender
    • StartDate
    • StartedOn
    • DueOn
    • Priority
    • State
    • DeliveryDate and
    • TaskID
  • Task Identifiers that are defined in the request (Variable\TaskIdentifier).
    System attributes are prefixed by Task and Business attributes are prefixed by the name of the task identifier type.
    For example:
  • Task.Assingee= :taskOwner
  • (Task.DueOn >=:duedate OR Task.DueOn<=:duedate1)
  • (Task.State = :state)
    For TaskIdentifiers, associated names can be directly used.
    For example:
  • SalesOrder.Id =1000

String

The following system attributes will be supported for search and sort:

  • Task.TaskInstanceId - GUID of the human task
  • Task.SourceInstanceId - BPM Instance ID or Case Instance ID
  • Task.ActivityName - Description of the human task activity as given in BPM or Case Model
  • Task.SourceName - QFN of the BPM or Case Model
  • Task.Sender - The dn of the user who has released the human task
  • Task.Target - The target (can be a user, role, team, or work list) to which the task is delivered. Its should be defined through a variable as described above.
  • Task.Priority - Current Priority of the human task. The accepted values for this are LOW, NORMAL, and HIGH.
  • Task.State - Current State of the human task. The accepted values for this are as follows:
    • CREATED
    • ASSIGNED
    • INPROGRESS
    • PAUSED
    • SUSPENDED
    • COMPLETED
    • OBSOLETE
  • Task.DeliveryDate - Date on which the human task is delivered
  • Task.StartDate - Date on which the human task is scheduled to be started
  • Task.StartedOn - Date on which the human task is started
  • Task.CompletedDate - Date on which the human task is completed
  • Task.TimeTaken - Time (in milliseconds) in which the human task is completed
  • Task.Delegatee - The dn of the user to whom the human task is delegated
  • Task.Assignee - The dn of the user to whom the human task is assigned

Query

Contains the query used to search the task.

String

Parameters

Contains the set of parameters used to search the task.

Parameter@name

Name of the parameter used in the query. For example - Task.StartDate, Task.StartedOn, or Task Identifiers.

String

Paramter@type

Type of the parameter used in the query.

String

  • System attribute - the type should be prefixed by Task. For example - Task.State
  • Task Identifier - the type should be the name as defined in the respective Task Identifier definition (Variable\TaskIdentifier node)

Parameter@value

Value of the parameter. For all paramters whose name is other than Task.Target, Task.Assignee, Task.Delegatee, and Task.Assignee, the value is given under this attribute. The values for these attributes are defined under the variable attribute.

String

Parameter@variable

Name of the Variable which represents the value on which it is to be queried. This attribute is used for

  • Task.Target
  • Task.Assignee
  • Task.Sender
  • Task.Delegatee

String

OrderBy

Contains the order of arranging tasks in ascending or descending order based on the attributes.

String

All System attributes and Task Identifiers as defined in the request through Variable\TaskIdentifier definitions

SOAP Response

<SearchHumanTasksResponse xmlns="http://schemas.cordys.com/notification/ws-humantask/execution/2.0">
    <cursor id="-1" numRows="10"/>
    <tuple>
        <old>
            <Task>
                <TaskId>002170BA-2FEC-11E1-F384-6568B5A8DBA6</TaskId>
                <ProcessName/>
                <SourceType/>
                <SourceInstanceId/>
                <Assignee
                    displayName="09fff207-0b36-49ac-af6d-bdf3613643f8"
                    email="" phone1="" phone2="">cn=09fff207-0b36-49ac-af6d-bdf3613643f8,cn=organizational users, o=system,cn=cordys,cn=bop41cu7rb28,o=vanenburg.com</Assignee>
                <CompletedByUser/>
                <DelegatedToUser/>
                <DeliveryDate>2012-05-12T11:11:13.0</DeliveryDate>
                <StartDate>2012-05-12T11:11:12.0</StartDate>
                <CompletionDate/>
                <DueDate isExpired="false"/>
                <BusinessAttributes/>
                <StartedOn/>
                <State>ASSIGNED</State>
                <Priority>3</Priority>
                <Activity>82151295-edda-435e-8831-09cc7ba7e360</Activity>
                <Target type="user">cn=09fff207-0b36-49ac-af6d-bdf3613643f8, cn=organizational users,o=system,cn=cordys,cn=bop41cu7rb28,o=vanenburg.com</Target>
                <Targets>
                    <Target type="user">cn=09fff207-0b36-49ac-af6d-bdf3613643f8, cn=organizational users,o=system,cn=cordys,cn=bop41cu7rb28,o=vanenburg.com</Target>
                </Targets>
                <Sender displayName="jdoe" email="" phone1="" phone2="">cn=jdoe,cn=organizational users, o=system,cn=cordys,cn=bop41cu7rb28,o=vanenburg.com</Sender>
                <ParentTaskId>002170BA-2FEC-11E1-F384-6568B5A8DBA6</ParentTaskId>
                <TimeTaken>0</TimeTaken>
            </Task>
        </old>
    </tuple>
</SearchHumanTasksResponse>

Response Parameters

Parameter

Description

TaskId

Contains the unique Task ID.

ProcessName

Contains the name of the Business Process that assigned the task.

SourceType

Source from where the task is triggered.

SourceInstanceId

Instance ID of the source which triggered the task.

CompletedByUser

Contains the DN of the User who completes the task.

DelegatedToUser

Contains the DN of the User to whom the task is delegated.

CompletionDate

Contains date on which the task is actually completed.

Targets

Type of target where the task should be sent.

Assignee

Contains the DN of the User to whom the task is assigned.

StartDate

Contains the date when the task can be started.

DueDate isExpired

Contains the date when the task should be completed. When isExpired is true, the due date is already past.

DeliveryDate

Contains the date when the task is completed.

State

Contains the current state of the task . For example:

  • Assigned
  • InProgress
    and so on.

Priority

Contains the priority that is set on the task.

Activity

Contains the name of the activity specified in the Business Process.

WorklistId

Contains the ID of the work list from which the tasks are retrieved. Contains the ID of the role or user if type was set to role or user.

Sender

Contains the DN of the user who sent the task.

StartedOn

Contains the date when the task is actually started.