Class: Workflows

Workflows(opts)

The Workflows class allows to work with workflows on a Nuxeo Platform instance.

Cannot directly be instantiated

Constructor

new Workflows(opts)

Creates a Workflows object.

Parameters:
Name Type Description
opts object

The configuration options.

Properties
Name Type Description
nuxeo string

The Nuxeo object linked to this Workflows object.

Source:
Example
var Nuxeo = require('nuxeo')
var nuxeo = new Nuxeo({
 baseURL: 'http://localhost:8080/nuxeo',
 auth: {
   method: 'basic',
   username: 'Administrator',
   password: 'Administrator',
 }
});
nuxeo.workflows()
  .start('SerialDocumentReview')
  .then(function(res) {
    // res['entity-type'] === 'workflow'
    // res.workflowModelName === 'SerialDocumentReview'
  })
  .catch(function(error) {
    throw new Error(error);
  });

Methods

delete(workflowInstanceId, optsopt) → {Promise}

Deletes a workflow instance given a workflow instance id.

Parameters:
Name Type Attributes Description
workflowInstanceId string

The workflow instance id.

opts object <optional>

Options overriding the ones from this object.

Source:
Returns:

A Promise object resolved with the result of the DELETE request.

Type
Promise

fetch(workflowInstanceId, optsopt) → {Promise}

Fetches a workflow given a workflow instance id.

Parameters:
Name Type Attributes Description
workflowInstanceId string

The workflow instance id.

opts object <optional>

Options overriding the ones from this object.

Source:
Returns:

A promise object resolved with the Workflow object.

Type
Promise

fetchStartedWorkflows(workflowModelName, optsopt) → {Promise}

Fetches the workflows started by the current user.

Parameters:
Name Type Attributes Description
workflowModelName string

The workflow model name.

opts object <optional>

Options overriding the ones from this object.

Source:
Returns:

A promise object resolved with the started workflows.

Type
Promise

fetchTasks(tasksOptsopt, optsopt) → {Promise}

Fetches the tasks for a given workflow id and/or workflow model name and/or actor id.

Parameters:
Name Type Attributes Description
tasksOpts object <optional>

Configuration options for the tasks fetch.

Properties
Name Type Attributes Description
actorId object <optional>

The actor id.

workflowInstanceId object <optional>

The workflow id.

workflowModelName object <optional>

The workflow model name.

opts object <optional>

Options overriding the ones from this object.

Source:
Returns:

A promise object resolved with the tasks.

Type
Promise

start(workflowModelName, workflowOptsopt, optsopt) → {Promise}

Starts a workflow given a workflow model name.

Parameters:
Name Type Attributes Description
workflowModelName string

The workflow model name.

workflowOpts object <optional>

Configuration options for the start of the workflow.

Properties
Name Type Attributes Description
attachedDocumentIds Array <optional>

The attached documents id for the workflow.

variables object <optional>

The initial variables of the workflow.

opts object <optional>

Options overriding the ones from this object.

Source:
Returns:

A promise object resolved with the started Workflow object.

Type
Promise