Skip to content

Transitions

Introduction

The Transitions API gives the ability to fully configure each transition between the stages of a work flow template.

Usage

list

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"
}
]

get

Retrieve a transition by Id.

Parameters

PropertyTypeRequiredExample
idXuid'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

Create a transition

Parameters

PropertyTypeRequiredExample
from_idXuid"9cabdeca-a0fe-11ea-8530-0242ac120002"
to_idXuid"a099e2de-a0fe-11ea-b9be-0242ac120002"
workflow_idXuid"9c82245e-a0fe-11ea-b1cf-01009cb3fa40"
descriptionstringMy first transition
is_automticbool1

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

Update a transition

Parameters

PropertyTypeRequiredExample
_idXuid"5076455a-a18e-11ea-8618-0242ac120002"
from_idXuid"9cabdeca-a0fe-11ea-8530-0242ac120002"
to_idXuid"a099e2de-a0fe-11ea-b9be-0242ac120002"
workflow_idXuid"9c82245e-a0fe-11ea-b1cf-01009cb3fa40"
descriptionstringMy first transition
is_automticbool1

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

Delete a transition.

Parameters

PropertyTypeRequiredExample
idXuid'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

Transition between two stages as defined by the given Transition

Parameters

PropertyTypeRequiredExample
idXuid'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"
}