Class: Task

Task(task, opts)

The Task class wraps a task.

Cannot directly be instantiated

Constructor

new Task(task, opts)

Creates a Task.

Parameters:
Name Type Description
task object

The initial task object. This Task object will be extended with task properties.

opts object

The configuration options.

Properties
Name Type Attributes Description
nuxeo string

The Nuxeo object linked to this task.

documentId string <optional>

The attached document id of this workflow, if any.

Source:

Methods

complete(action, taskOptsopt, optsopt) → {Promise}

Completes the task.

Parameters:
Name Type Attributes Description
action string

The action name to complete the task.

taskOpts object <optional>

Configuration options for the task completion.

Properties
Name Type Attributes Description
variables string <optional>

Optional variables to override the existing ones.

comment string <optional>

Optional comment.

opts object <optional>

Options overriding the ones from this object.

Source:
Returns:

A promise object resolved with the completed task.

Type
Promise

delegate(actors, taskOptsopt, optsopt) → {Promise}

Delegates the task to the given actors.

Parameters:
Name Type Attributes Description
actors string

Actors to delegate the task.

taskOpts object <optional>

Configuration options for the task delegation.

Properties
Name Type Attributes Description
comment string <optional>

Optional comment.

opts object <optional>

Options overriding the ones from this object.

Source:
Returns:

A promise object resolved with nothing.

Type
Promise

reassign(actors, taskOptsopt, optsopt) → {Promise}

Reassigns the task to the given actors.

Parameters:
Name Type Attributes Description
actors string

Actors to reassign the task.

taskOpts object <optional>

Configuration options for the task reassignment.

Properties
Name Type Attributes Description
comment string <optional>

Optional comment.

opts object <optional>

Options overriding the ones from this object.

Source:
Returns:

A promise object resolved with nothing.

Type
Promise

variable(name, value) → {Task}

Sets a task variable.

Parameters:
Name Type Description
name string

The name of the variable.

value string

The value of the variable.

Source:
Returns:

The task itself.

Type
Task