# Class: WorkItemManagementService

## tibco.objectapi.service.WorkItemManagementService

#### new WorkItemManagementService()

### Methods

#### allocateAndOpenNextWorkItem(request, callback)

Allocates the next available work item for a specified resource to that resource and immediately opens the work item (to get the associated input and output data).

The function fails if there is no next item in the resource's work list.

This function can only be used if the work item is in a state from which it can be allocated and opened.

##### Parameters:

Name | Type | Description
--- | --- | ---
`request` | tibco.objectapi.service.request.AllocateAndOpenNextWorkItemRequest | A request set with data for this service call.
`callback` | tibco.objectapi.service.Callback | A callback to handle the service response of type `AllocateAndOpenNextWorkItemResponseType`.

#### allocateAndOpenWorkItem(request, callback)

Allocates a work item to a single resource and immediately opens the work item (to get the associated input and output data).

This function can only be used if the work item is in a state from which it can be allocated and opened. See Work Item State Transitions.

##### Parameters:

Name | Type | Description
--- | --- | ---
`request` | tibco.objectapi.service.request.AllocateAndOpenWorkItemRequest | A request set with data for this service call.
`callback` | tibco.objectapi.service.Callback | A callback to handle the service response of type `AllocateAndOpenWorkItemResponseType`.

#### allocateWorkItem(request, callback)

Allocates a list of work items.

This function can only be used if the work item is in a state from which it can be allocated and opened.

##### Parameters:

Name | Type | Description
--- | --- | ---
`request` | tibco.objectapi.service.request.AllocateWorkItemRequest | A request set with data for this service call.
`callback` | tibco.objectapi.service.Callback | A callback to handle the service response of type `AllocateWorkItemResponseType`.

#### closeWorkItem(request, callback)

Closes a work item (and updates the associated input and output data).

This function:

- Puts the work item into a Pended state.
- Can only be used if the work item is in a state from which it can be closed.
- Can only be used if the work item is assigned to the user with whose credentials the operation is being invoked.

##### Parameters:

Name | Type | Description
--- | --- | ---
`request` | tibco.objectapi.service.request.CloseWorkItemRequest | A request set with data for this service call.
`callback` | tibco.objectapi.service.Callback | A callback to handle the service response of type `CloseWorkItemResponseType`.

#### completeWorkItem(request, callback)

Completes a specific version of a work item (and updates the associated input and output data).

##### Parameters:

Name | Type | Description
--- | --- | ---
`request` | tibco.objectapi.service.request.CompleteWorkItemRequest | A request set with data for this service call.
`callback` | tibco.objectapi.service.Callback | A callback to handle the service response of type `WorkResponseType`.

#### getOfferSet(request, callback)

Returns the offer set for a specific version of a work item. The offer set is the set of organization model entities to whom a work item is to be offered.

##### Parameters:

Name | Type | Description
--- | --- | ---
`request` | tibco.objectapi.service.request.GetOfferSetRequest | A request set with data for this service call.
`callback` | tibco.objectapi.service.Callback | A callback to handle the service response of type `GetOfferSetResponseType`.

#### getWorkItemHeader(request, callback)

Returns a list of work item headers for the supplied list of work item objects.

##### Parameters:

Name | Type | Description
--- | --- | ---
`request` | tibco.objectapi.service.request.GetWorkItemHeaderRequest | A request set with data for this service call.
`callback` | tibco.objectapi.service.Callback | A callback to handle the service response of type `GetWorkItemHeaderResponseType`.

#### openWorkItem(request, callback)

Opens a work item (to get the associated input and output data).

##### Parameters:

Name | Type | Description
--- | --- | ---
`request` | tibco.objectapi.service.request.OpenWorkItemRequest | A request set with data for this service call.
`callback` | tibco.objectapi.service.Callback | A callback to handle the service response of type `WorkResponseType`.

#### pendWorkItem(request, callback)

Pends the specified work item, which causes the work item to be hidden in the work item list until a specified date/time, or period of time has expired. The work item becomes visible again when the date/time occurs, or the period of time expires.

A hiddenPeriod of 0 (zero) cancels a hiddenPeriod set by a previous pendWorkItem function call on the same work item.

##### Parameters:

Name | Type | Description
--- | --- | ---
`request` | tibco.objectapi.service.request.PendWorkItemRequest | A request set with data for this service call.
`callback` | tibco.objectapi.service.Callback | A callback to handle the service response of type `PendWorkItemResponseType`.

#### reallocateWorkItem(request, callback)

Reallocates a work item with no new data to a different resource.

Users to whom a work item can be reallocated is restricted by the system action held by the caller - see below. Also, to reallocate a work item to the original offer set, the work item can have a state of Offered, Allocated, or Pended; to reallocate a work item to the "the world", the work item can have a state of Allocated or Pended.

If there is new data to be written to the work item, use the reallocateWorkItemData function instead.

##### Parameters:

Name | Type | Description
--- | --- | ---
`request` | tibco.objectapi.service.request.ReallocateWorkItemRequest | A request set with data for this service call.
`callback` | tibco.objectapi.service.Callback | A callback to handle the service response of type `ReallocateWorkItemResponseType`.

#### reallocateWorkItemData(request, callback)

Reallocates a work item to a different resource and updates the work item with new data.

Users to whom a work item can be reallocated is restricted by the system action held by the caller - see below. Also, to reallocate a work item to the original offer set, the work item can have a state of Offered, Allocated, or Pended; to reallocate a work item to the "the world", the work item can have a state of Allocated or Pended.

If the work item has no new data associated with it use the reallocateWorkItem function instead.

##### Parameters:

Name | Type | Description
--- | --- | ---
`request` | tibco.objectapi.service.request.ReallocateWorkItemDataRequest | A request set with data for this service call.
`callback` | tibco.objectapi.service.Callback | A callback to handle the service response of type `ReallocateWorkItemDataResponseType`.

#### rescheduleWorkItem(request, callback)

Reschedules a specific version of a work item and/or changes the work item data.

##### Parameters:

Name | Type | Description
--- | --- | ---
`request` | tibco.objectapi.service.request.RescheduleWorkItemRequest | A request set with data for this service call.
`callback` | tibco.objectapi.service.Callback | A callback to handle the service response of type `RescheduleWorkItemResponseType`.

#### saveOpenWorkItem(request, callback)

Saves a wspecific version of a work item (and updates the associated input and output data).

##### Parameters:

Name | Type | Description
--- | --- | ---
`request` | tibco.objectapi.service.request.SaveOpenWorkItemRequest | A request set with data for this service call.
`callback` | tibco.objectapi.service.Callback | A callback to handle the service response of type `SaveOpenWorkItemResponseType`.

#### setWorkItemPriority(request, callback)

Sets a work item priority, which can be used to indicate the work item's relative importance.

You can change the priority of an individual work item or multiple work items. Depending on your requirements, you have a choice of one of the following:

- absPriority - Set a specific numeric priority.
- offsetPriority - Offset a work item priority by specific value. For example, an employee is away on holiday and you want to offset the priority on all their work items by 20.

##### Parameters:

Name | Type | Description
--- | --- | ---
`request` | tibco.objectapi.service.request.SetWorkItemPriorityRequest | A request set with data for this service call.
`callback` | tibco.objectapi.service.Callback | A callback to handle the service response of type `SetWorkItemPriorityResponseType`.

#### skipWorkItem(request, callback)

Skips the work items specified. This means that no action is carried out on the work items.

This function can only be used on work items that have default values for all required output and in/out data fields, or have values set already for such fields.

##### Parameters:

Name | Type | Description
--- | --- | ---
`request` | tibco.objectapi.service.request.SkipWorkItemRequest | A request set with data for this service call.
`callback` | tibco.objectapi.service.Callback | A callback to handle the service response of type `SkipWorkItemResponseType`.

#### unallocateWorkItem(request, callback)

Reoffers a currently allocated work item to the original offer set.

This function can only be used if the work item is in a state from which it can be unallocated.

##### Parameters:

Name | Type | Description
--- | --- | ---
`request` | tibco.objectapi.service.request.UnallocateWorkItemRequest | A request set with data for this service call.
`callback` | tibco.objectapi.service.Callback | A callback to handle the service response of type `UnallocateWorkItemResponseType`.