The Transitions API gives the ability to fully configure each transition between the stages of a work flow template.
Retreive the list of transitions.
Usage
const transitions = await Xedi.Transitions.list();
Response
[{"_id": "5076455a-a18e-11ea-8618-0242ac120002","from_id": "9cabdeca-a0fe-11ea-8530-0242ac120002","to_id": "a099e2de-a0fe-11ea-b9be-0242ac120002","workflow_id": "9c82245e-a0fe-11ea-b1cf-01009cb3fa40","workflow_type": "template","description": "My first transition","is_automtic": 1,"created_at": "2020-05-11 10:27:03","updated_at": "2020-05-11 10:27:03"}{"_id": "574612ac-a18e-11ea-ac77-0242ac120002","from_id": "9cabdeca-a0fe-11ea-8530-0242ac120002","to_id": "a099e2de-a0fe-11ea-b9be-0242ac120002","workflow_id": "9c82245e-a0fe-11ea-b1cf-01009cb3fa40","workflow_type": "template","description": "My second transition","is_automtic": 1,"created_at": "2020-05-11 10:27:03","updated_at": "2020-05-11 10:27:03"}]
Retrieve a transition by Id.
Parameters
Property | Type | Required | Example |
---|---|---|---|
id | Xuid | '5076455a-a18e-11ea-8618-0242ac120002' |
Usage
const transition = await Xedi.Transitions.get('5076455a-a18e-11ea-8618-0242ac120002');
Response
{"_id": "5076455a-a18e-11ea-8618-0242ac120002","from_id": "9cabdeca-a0fe-11ea-8530-0242ac120002","to_id": "a099e2de-a0fe-11ea-b9be-0242ac120002","workflow_id": "9c82245e-a0fe-11ea-b1cf-01009cb3fa40","workflow_type": "template","description": "My first transition","is_automtic": 1,"created_at": "2020-05-11 10:27:03","updated_at": "2020-05-11 10:27:03"}
Create a transition
Parameters
Property | Type | Required | Example |
---|---|---|---|
from_id | Xuid | "9cabdeca-a0fe-11ea-8530-0242ac120002" | |
to_id | Xuid | "a099e2de-a0fe-11ea-b9be-0242ac120002" | |
workflow_id | Xuid | "9c82245e-a0fe-11ea-b1cf-01009cb3fa40" | |
description | string | My first transition | |
is_automtic | bool | 1 |
Usage
const transition = await Xedi.Transitions.create({from_id: '9cabdeca-a0fe-11ea-8530-0242ac120002',to_id: 'a099e2de-a0fe-11ea-b9be-0242ac120002',workflow_id: '9c82245e-a0fe-11ea-b1cf-01009cb3fa40',workflow_type: 'template',description: 'My first transition',is_automtic: 1});
Response
{"_id": "5076455a-a18e-11ea-8618-0242ac120002","from_id": "9cabdeca-a0fe-11ea-8530-0242ac120002","to_id": "a099e2de-a0fe-11ea-b9be-0242ac120002","workflow_id": "9c82245e-a0fe-11ea-b1cf-01009cb3fa40","workflow_type": "template","description": "My first transition","is_automtic": 1,"created_at": "2020-05-11 10:27:03","updated_at": "2020-05-11 10:27:03"}
Update a transition
Parameters
Property | Type | Required | Example |
---|---|---|---|
_id | Xuid | "5076455a-a18e-11ea-8618-0242ac120002" | |
from_id | Xuid | "9cabdeca-a0fe-11ea-8530-0242ac120002" | |
to_id | Xuid | "a099e2de-a0fe-11ea-b9be-0242ac120002" | |
workflow_id | Xuid | "9c82245e-a0fe-11ea-b1cf-01009cb3fa40" | |
description | string | My first transition | |
is_automtic | bool | 1 |
Usage
const transition = await Xedi.Transitions.create({_id: '5076455a-a18e-11ea-8618-0242ac120002',from_id: '9cabdeca-a0fe-11ea-8530-0242ac120002',to_id: 'a099e2de-a0fe-11ea-b9be-0242ac120002',workflow_id: '9c82245e-a0fe-11ea-b1cf-01009cb3fa40',workflow_type: 'template',description: My updated transition,is_automtic: 1});
Response
{"_id": "5076455a-a18e-11ea-8618-0242ac120002","from_id": "9cabdeca-a0fe-11ea-8530-0242ac120002","to_id": "a099e2de-a0fe-11ea-b9be-0242ac120002","workflow_id": "9c82245e-a0fe-11ea-b1cf-01009cb3fa40","workflow_type": "template","description": "My updated transition","is_automtic": 1,"created_at": "2020-05-11 10:27:03","updated_at": "2020-05-11 10:27:03"}
Delete a transition.
Parameters
Property | Type | Required | Example |
---|---|---|---|
id | Xuid | '5076455a-a18e-11ea-8618-0242ac120002' |
Usage
const transition = await Xedi.Transitions.delete('5076455a-a18e-11ea-8618-0242ac120002');
Response
{"_id": "5076455a-a18e-11ea-8618-0242ac120002"}
Transition between two stages as defined by the given Transition
Parameters
Property | Type | Required | Example |
---|---|---|---|
id | Xuid | '5076455a-a18e-11ea-8618-0242ac120002' |
Usage
const transition = await Xedi.Transitions.transition('5076455a-a18e-11ea-8618-0242ac120002');
Response
{"_id": "5076455a-a18e-11ea-8618-0242ac120002","from_id": "9cabdeca-a0fe-11ea-8530-0242ac120002","to_id": "a099e2de-a0fe-11ea-b9be-0242ac120002","workflow_id": "9c82245e-a0fe-11ea-b1cf-01009cb3fa40","workflow_type": "template","description": "My updated transition","is_automtic": 1,"created_at": "2020-05-11 10:27:03","updated_at": "2020-05-11 10:27:03"}