Task Engine 10.7 | Task Engine Webhelp | webMethods Task Engine API and Service Reference | Using the Task Engine RESTful Web Services in Integration Server | GET Task Instance Information
 
GET Task Instance Information
This REST request returns the pub.task:TaskInfo object, and optionally the TaskData object, for one task, or for a list of the TaskData objects (and TaskInfo objects, if specified) for all the tasks the user has permission to access. The underlying built-in services are:
*pub.task.taskclient:getTask
*pub.task.taskclient:searchTasks
This service can be used in the following modes:
*List tasks mode
*Get a specific task mode
The service returns a specific task if the taskID parameter is supplied. Otherwise, list of tasks is returned if taskID is not specified. The TaskInfo object contains standard information about a task, including its status, expiration date, and the list of users to which it is assigned. The TaskData object contains the business data that is associated with the task. TaskData does not have a specified structure. Its content varies according to the task.
List Tasks Mode
To use the request to retrieve information about a list of tasks, the HTTP request is formed as follows:
GET /rest/pub/opentask[?param1=value][&param2=value][&param2=value]
Input Parameters
includeTaskData
String Optional. Specifies whether you want to retrieve the TaskData document as well as the TaskInfo document. Set to:
*true to retrieve TaskData in addition to TaskInfo.
*false (default) to get TaskInfo only.
searchUserTasks
String Optional. Specifies whether the service searches all tasks or only the user's inbox. Set to:
*true to search only the inbox for user.
*false (default) to search all tasks to which user has access.
user
String Optional. The user ID of the My webMethods Server user on whose behalf this service will execute. If user is not specified, the user ID associated with the WmTaskClient package is used. For information about configuring this user ID, see webMethods Task Engine User’s Guide. Note: Only tasks to which user has access are searched.
Output Parameters
Tasks
Document list The result set containing the tasks that match the search criteria. Each document in the result set has the following structure:
*TaskID String The identifier assigned to the task instance.
*TaskInfo Document The TaskInfo document containing standard information about the task. See pub.task:TaskInfo for a description of the fields in this document.
*TaskData Document The TaskData document containing the business data associated with the task. Returned only if includeTaskData is set to true.
Get a Specific Task Mode
To use the request to retrieve information about a specific task, the HTTP request is formed as follows:
GET /rest/pub/opentask/taskID[?param1=value][&param2=value]
or
GET /rest/pub/opentask?taskID=taskID[&param1=value][&param2=value]
Input Parameters
includeTaskData
String Optional. Specifies whether you want to retrieve the TaskData document as well as the TaskInfo document. Set to:
*true to retrieve TaskData in addition to TaskInfo.
*false (default) to get TaskInfo only.
taskID
String The ID that identifies the task that you want to retrieve. This can be either passed in the URL as shown above, or as an input parameter.
user
String Optional. The user ID of the My webMethods Server user on whose behalf this service will execute. If user is not specified, the user ID associated with the WmTaskClient package is used. For information about configuring this user ID, see webMethods Task Engine User’s Guide.
Output Parameters
TaskID
String The ID that identifies the task.
TaskInfo
Document The TaskInfo document containing standard information about the task. See pub.task:TaskInfo for a description of the fields in this document.
TaskData
Document A document containing the business data associated with the task. TaskData does not have a specified structure. Its content varies according to the task. TaskData is returned only if includeTaskData is set to true.
Usage Notes
To get task instance information with this request, you must supply the ID of the task instance that you want to retrieve. To obtain this ID, use the request in list tasks mode or one of the opentasksearch requests to locate the task and then extract the task ID from the Task document that it returns. To retrieve a task successfully, the user ID specified in user must have permission to access that task. If the supplied ID does not have access to the task, or if the specified task does not exist, an exception is thrown.