Class icm.model.WorkItem


Extends ecm.model.Item.
Represents a work item.
Defined in: <icm/model/WorkItem.js>.

Constructor Summary

Constructor Attributes Constructor Name and Description
 
icm.model.WorkItem(properties)
Constructs a WorkItem object.

Field Summary

Field Attributes Field Name and Description
 
AttributeDefinition objects that correspond to the attributes collection of this WorkItem.
 
The authored workflow map name.
 
The folder Id of the Case the process is associated with
 
A cached Case object.
 
The Id of the Task the process is associated with
 
The comment of the step.
 
Indicates whether the current user has administrator rights.
 
The deadline of the step.
 
The ecm.model.WorkItem object corresponding to this WorkItem.
 
Will be non-null if integrating with an external data service
 
The instruction for the step
 
The launch date.
 
The locations
 
Indicates whether the work item is locked by the current user.
 
The name of the user that has the work item locked, if the work item is locked.
 
The workflow map name
 
The originator of the step
 
The overdue status of the step.
 
The step processor type
 
The queue name.
 
The reminder of the step.
 
The possible step responses.
 
The currently selected step response.
 
stepId 
The Id of the step in the workflow.
 
The name of the step in the workflow.
 
The subject of the step.
 
The name of the workflow
 
The workflow number of the step

Method Summary

Method Attributes Method Name and Description
 
abortStep(callback, errCallback, backgroundRequest)
If the step is locked, aborts and unlocks the step.
 
Obtains an Editable object in order to make scratchpad changes to the work item.
<static>  
icm.model.WorkItem.fromWorkItem()
A factory method to get a WorkItem object from an ecm.model.WorkItem object.
 
Returns a CaseType object.
 
Returns the page to process the step.
 
getViewDefinitionUri(viewDefinitionId)
Returns the URI for the specified view definition.
 
Call this method to determine if a work item is bound to a different user than the currently logged on user.
 
lockStep(callback, errCallback, backgroundRequest)
Locks the step.
 
moveToInbox(callback, errCallback, backgroundRequest)
Moves the work item to the inbox of the current user.
 
Called when the entire state of the object is refreshed, primarily when the attributes have been updated based on updated information from the server.
 
overrideLockStep(callback, errCallback, backgroundRequest)
Overrides the lock on the step.
 
reassign(user, displayName, delegate, callback, errCallback, backgroundRequest)
Reassign the work item to the user specified.
 
retrieveAttributes(callback, errCallback, backgroundRequest)
Retrieves all attributes for this WorkItem object.
 
retrieveCachedAttributes(callback, errCallback, backgroundRequest)
Ensures that the full set of attributes has been retrieved.
 
retrieveNextItem(callback)
Returns the next item in the resultset that this WorkItem object was originally obtained from.
 
retrieveStep(callback, errCallback, backgroundRequest)
Fully retrieves the properties.
 
retrieveTrackerMilestones(callback, milestoneLevel)
Returns the tracker milestones.
 
returnToSender(callback, errCallback, backgroundRequest)
Returns the work item to the queue from which a user originally reassigned or delegated the work item

Constructor Detail

icm.model.WorkItem(properties)

Constructs a WorkItem object. A WorkItem object is typically constructed internally by other model objects.
Parameters:
properties
The properties for the WorkItem object. The properties can be any of the public fields as defined below and on ecm.model.Item or ecm.model._ModelObject.

Field Detail

attributeDefinitions

AttributeDefinition objects that correspond to the attributes collection of this WorkItem.

authoredMapName

The authored workflow map name.

caseFolderId

The folder Id of the Case the process is associated with

caseObject

A cached Case object. A Case object is cached when a method such as retrieveAttributes() is called that populates the state of this WorkItem object.

caseTaskId

The Id of the Task the process is associated with

comment

The comment of the step.

currentUserHasAdminRights

Indicates whether the current user has administrator rights.

deadline

The deadline of the step.

ecmWorkItem

The ecm.model.WorkItem object corresponding to this WorkItem.

externalDataIdentifier

Will be non-null if integrating with an external data service

instruction

The instruction for the step

launchDate

The launch date.

locations

The locations

lockedByCurrentUser

Indicates whether the work item is locked by the current user.

lockedUser

The name of the user that has the work item locked, if the work item is locked.

mapName

The workflow map name

originator

The originator of the step

overdueStatus

The overdue status of the step.

processorType

The step processor type

queueName

The queue name.

reminder

The reminder of the step.

responses

The possible step responses.

selectedResponse

The currently selected step response.

stepId

The Id of the step in the workflow.

stepName

The name of the step in the workflow.

subject

The subject of the step.

workflowName

The name of the workflow

workflowNumber

The workflow number of the step

Method Detail

abortStep(callback, errCallback, backgroundRequest)

If the step is locked, aborts and unlocks the step.
Parameters:
callback
Callback function called with this object as its argument.
errCallback
Callback function called when the request fails.
backgroundRequest
An optional argument. If true, indicates the request is processed in the background.

createEditable()

Obtains an Editable object in order to make scratchpad changes to the work item. The changes are not reflected until save() is called on the Editable.
Returns:
icm.model.WorkItemEditable

<static> icm.model.WorkItem.fromWorkItem()

A factory method to get a WorkItem object from an ecm.model.WorkItem object.

getCaseType()

Returns a CaseType object. This is a convenience method equivalent to calling getCaseType() on the Case object for the caseObject property.
Returns:
icm.model.CaseType

getStepPage()

Returns the page to process the step. The work item should be retrieved from the server before the page information can be returned. For example, call retrieveStep() before calling this method. If the work item has not been retrieved from the server, this method will return null.

Returns:
Returns info similar to the static page definition returned from solution.retrieveStaticPages().

getViewDefinitionUri(viewDefinitionId)

Returns the URI for the specified view definition.
Parameters:
viewDefinitionId
The symbolic name for the view definition
Returns:
(String) the URI for the specified view definition

isBoundToOtherUser()

Call this method to determine if a work item is bound to a different user than the currently logged on user. This situation would typically occur if the icm.model.Workitem originated from querying an inbasket that shows all assigned work, for example available to a user in an administrator role. The application may only allow the work item to be opened in read-only mode in this case.
Returns:
(boolean) a value indicating if the work item is bound to a different user

lockStep(callback, errCallback, backgroundRequest)

Locks the step. The full set of properties is retrieved from the server with this call.
Parameters:
callback
Callback function called with this object as its argument.
errCallback
Callback function called when the request fails.
backgroundRequest
An optional argument. If true, indicates the request is processed in the background.

moveToInbox(callback, errCallback, backgroundRequest)

Moves the work item to the inbox of the current user.
Parameters:
callback
Callback function called with a json object containing the operation result messages.
errCallback
An optional argument. A function called if the request fails.
backgroundRequest
An optional argument. If true, indicates the request is processed in the background.

onRefresh()

Called when the entire state of the object is refreshed, primarily when the attributes have been updated based on updated information from the server.

overrideLockStep(callback, errCallback, backgroundRequest)

Overrides the lock on the step. The full set of properties is retrieved from the server with this call.
Parameters:
callback
Callback function called with this object as its argument.
errCallback
Callback function called when the request fails.
backgroundRequest
An optional argument. If true, indicates the request is processed in the background.

reassign(user, displayName, delegate, callback, errCallback, backgroundRequest)

Reassign the work item to the user specified.
Parameters:
user
The user to reassign the work item to
displayName
The display name of the user to reassign the work item to
delegate
Boolean value of true to flag the reassignment for later review; otherwise, false
callback
Callback function called with a json object containing the operation result messages.
errCallback
An optional argument. A function called if the request fails.
backgroundRequest
An optional argument. If true, indicates the request is processed in the background.

retrieveAttributes(callback, errCallback, backgroundRequest)

Retrieves all attributes for this WorkItem object. If the WorkItem object was obtained by calling WorkItem.fromWorkItem(ecmWorkItem), then the attributes currently on the object are incomplete.

For a WorkItem, all of the attributes are retrieved when a method such as retrieveStep(), lockStep() etc. is called. Calling this method is equivalent to calling retrieveStep() without locking it.

Parameters:
callback
Callback function called with this object as its argument.
errCallback
An optional argument. A function called if the request fails.
backgroundRequest
An optional argument. If true, indicates the request is processed in the background.

retrieveCachedAttributes(callback, errCallback, backgroundRequest)

Ensures that the full set of attributes has been retrieved. If the full set has already been retrieved, the callback is called right away. Otherwise retrieveAttributes() is called to retrieve all the attributes.
Parameters:
callback
Callback function called with this object as its argument.
errCallback
Callback function called when the request fails.
backgroundRequest
An optional argument. If true, indicates the request is processed in the background.

retrieveNextItem(callback)

Returns the next item in the resultset that this WorkItem object was originally obtained from. This method can only be called if this WorkItem was originally obtained by calling WorkItem.fromWorkItem() passing in an ecm.model.WorkItem that was obtained from a ResultSet. If not obtained from a ResultSet, this method will pass null in the callback function.

From the next WorkItem, retrieveNextItem() can be called again to repeatedly obtain the next WorkItem until no more work items can be found. Items that are locked by a different user are skipped.

Calling retrieveNextItem() again from this same WorkItem object will call the callback function with a new instance of icm.model.WorkItem. This may or may not represent the same work item that was returned previously depending on if the work item has been processed or not. Typically when processing next items, you will retrieve the next items until no more are available but you will not start over from earlier in the list. If non-default processing of the list is desired, the work item objects should be cached by the application and managed outside of this class.

Parameters:
callback
A callback function called with the next work item. It is passed an icm.model.WorkItem object for the next item or null if there is no next item.

retrieveStep(callback, errCallback, backgroundRequest)

Fully retrieves the properties. This method fully retrieves the properties of the work item without locking it. If the work item was obtained by calling fromWorkItem using an ecm.model.WorkItem obtained from an inbasket query, this WorkItem object does not hold a full set of properties yet.

The work item must also be locked before it can be modified. Call lockStep() to lock the step.

Parameters:
callback
Callback function called with this object as its argument. After the retrieval is complete the properties can be obtained from this object.
errCallback
Callback function called when the request fails.
backgroundRequest
An optional argument. If true, indicates the request is processed in the background.

retrieveTrackerMilestones(callback, milestoneLevel)

Returns the tracker milestones.
Parameters:
callback
Callback function called with a datastore json object containing the milestones.
milestoneLevel
the milestone level to retrieve

returnToSender(callback, errCallback, backgroundRequest)

Returns the work item to the queue from which a user originally reassigned or delegated the work item
Parameters:
callback
Callback function called with a json object containing the operation result messages.
errCallback
An optional argument. A function called if the request fails.
backgroundRequest
An optional argument. If true, indicates the request is processed in the background.