PUT Information in a Task Instance
This REST request modifies a task instance on the Task Engine connected to the Integration Server. The underlying built-in service is pub.task.taskclient:updateTask.
You use this request to change information in the task's TaskInfo and TaskData documents. This service applies only to tasks with Active, Error, and Suspended status. For information about updating tasks with other statuses, see Usage Notes. To end a task instance, you use this service to change the status field in the task's TaskInfo document to "closed" or "cancelled" as appropriate.
To use the request to update a task, the HTTP request is formed as follows:
PUT /rest/pub/opentask/taskID[?param1=value][¶m2=value]...[¶m4=value]
or
PUT /rest/pub/opentask?taskID=taskID[¶m1=value]...[¶m4=value]
Input Parameters
taskID | String The ID that identifies the task that you want to modify. This can be either passed in the URL as shown above, or as an input parameter. |
taskInfo or TaskInfo | Document The TaskInfo document that specifies the changes you want to make to the standard information maintained for the task. See pub.task:TaskInfo for a description of the fields in this document. This can be passed only as an input parameter in the request body. |
taskData or TaskData | Document The TaskData document that contains the business data that you want to associate with the task. TaskData does not have a specified structure. The content varies according to the task. This can be passed only as an input parameter in the request body. |
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
None.
Usage Notes
When you use this service to update information in the task's TaskInfo document, the Task Engine modifies only the fields that have assigned values in TaskInfo. All other fields in the target task retain their existing values. For example, to change just the name assigned to a task, set only the name field in the TaskInfo document that you pass to this service.
When you use this service to update information in the task's TaskData document, the TaskData document that you pass to the service replaces the task's existing TaskData document in its entirety.
When updating task statuses with this service, the following limitations apply:
If the current status of the task is Error, you can change it only to Completed.
If the current status of the task is Suspended, you cannot set it to Completed or Expired.
This service applies only to tasks with status Active, Error, and Suspended. To enable the service to update tasks with other statuses, set the additional JVM property -Dupdate.completed.task to true, as described in webMethods Task Engine User’s Guide.
Tasks with status Error that belong to a process instance cannot be updated, regardless of Task Engine optional settings.