PUT Information in a Task Instance
This REST request modifies a task instance on the Task Engine.
You use this request to change information in the task's TaskInfo and TaskData documents. This service applies only to tasks with status Active, Error, and Suspended. For information about updating tasks with other statuses, see Usage Notes.
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.
This is the operation a client program would use if it needed to change the status of a task. For example, if a program wanted to end a task, it would use this operation to change the status field in the task's TaskInfo object to "completed" 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
|
Output Parameters
None.
Usage Notes
To modify a task using this operation, you must supply the ID of the task that you want to update. To obtain this ID, use the searchTasks operation to locate the task and then extract the task ID from the result set that the searchTasks operation returns.
To modify a task successfully, the user ID in user must have permission to access the specified task. If the supplied ID does not have access to the task, or if the specified task does not exist, an exception is thrown.
When you use this operation to update information in the task's TaskInfo object, the Task Engine modifies only the fields to which you 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, you would set only the name field in the TaskInfo object that you pass to this service.
When you use this operation to update information in the task's TaskData object, the object that you pass to the service in taskData replaces the task's existing TaskData object in its entirety.
- 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
IBM 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.
You can edit the
taskScheduleDate field only
when the task is in
scheduled
state.
You cannot edit the schedules of task instances
created using
Task Engine 9.9 or earlier because
those task instances will be in
active
state.