Constructor
new Workflows(opts)
Creates a Workflows object.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
opts |
object | The configuration options. Properties
|
- 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
|
||||||||||||||||
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
|
||||||||||||
opts |
object |
<optional> |
Options overriding the ones from this object. |
- Source:
Returns:
A promise object resolved with the started Workflow
object.
- Type
- Promise