# Class: WorkPresentationService

## tibco.objectapi.service.WorkPresentationService

#### new WorkPresentationService()

### Methods

#### cancelWorkItem(request, callback)

Cancels the specified work item. Any changes made to the data is lost when you cancel a work item.

##### Parameters:

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

#### closeWorkItem(request, callback)

Closes a work item form and updates the associated data with any changes the user has made while it was open.

##### Parameters:

Name | Type | Description
--- | --- | ---
`request` | tibco.objectapi.service.request.CloseWorkItemPresentationRequest | 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)

Changes the state of a work item to Completed. Use this function when work on a work item or pageflow has completed. Input and output data associated with the work item is saved to the database. The work item must have a current state of Opened.

##### Parameters:

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

#### openNextWorkItem(request, callback)

Opens the next work item in the work queue, where the work item is either part of a chained group or is a piled work item.

##### Parameters:

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

#### openWorkItem(request, callback)

Opens a work item to get work presentation details and the associated input and output data.

##### Parameters:

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

#### previewWorkItem(request, callback)

##### Parameters:

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