Skip to content

Process

Processes the current WorkItem with the specified parameters.

myWorkItem.Process(selectedAction?: string, async?: boolean, completedBy?: ( string | Identity )):void (Identity)

Parameters

string selectedAction optional
    Specifies the action to be selected. If not specified, the existing WorkItem.SelectedAction property is used.

boolean async optional
    Specifies whether the processing of the work item is synchronous or asynchronous. If set to true, the work item is processed in another thread context.

( string | Identity ) completedBy optional
    The identity of the user who completed the work item.

Returns

Nothing. Use $WorkItem after a synchronous call when the script must inspect the updated state.

Remarks

If the work item state is not in Waiting, Created, or Join, attempting to call this method is prohibited and throws an access denied error.

When the async parameter is true, this method returns immediately and processing continues in the background. Otherwise, it waits until processing is completed.

A selected action is mandatory. Passing selectedAction updates SelectedAction; omitting it is valid only when that property was set earlier. The work item is checked for read-only access before processing starts.

See Also