FleetbaseFleetbase
Order Lifecycles

Configuration

The meta.lifecycle keys — initial, completed, canceled, terminal, dispatch and strict_transitions — with defaults, and the activity flow format a lifecycle works with.

Configuration

A lifecycle has two parts, both on the order config:

PartWhereDefines
The flowflowThe activities, and which can follow which
The lifecyclemeta.lifecycleWhich activities are special, and the rules

The lifecycle Keys

Prop

Type

A config has a configured lifecycle as soon as meta.lifecycle is a non-empty object. Keys you leave out take their default.

Minimal Lifecycles

// Its own starting point, otherwise the dispatch lifecycle's rules
{ "initial": "requested" }

// Never dispatched
{ "initial": "requested", "dispatch": false }

// Never dispatched, and only the flow's transitions
{ "initial": "requested", "dispatch": false, "strict_transitions": true }

The Flow

flow is an object keyed by activity key. Each activity lists the keys of the activities that can follow it:

{
    "requested": {
        "key": "requested",
        "code": "requested",
        "status": "Requested",
        "details": "Rental requested",
        "color": "#6B7280",
        "sequence": 0,
        "activities": ["reserved", "cancelled"],
        "logic": [],
        "events": [],
        "actions": [],
        "entities": [],
        "options": [],
        "complete": false,
        "require_pod": false,
        "pod_method": null
    },
    "reserved": { "…": "…" }
}
FieldDescription
keyThe activity's key in the flow; other activities refer to it in activities
codeThe status code orders get at this activity. Lifecycle keys refer to activities by code
statusThe label users see, on the timeline, the board and the tracking page. Can use placeholders such as {customer.name}
detailsThe longer description recorded with the activity
colorThe activity's colour in the console
sequenceOrders activities that share a parent
activitiesKeys of the activities that can follow this one
completeWhether reaching this activity completes the order
require_pod, pod_methodRequire proof of delivery at this activity
logic, events, actions, entities, optionsConditions and side effects; see the order config editor

Keep key and code the same unless you have a reason not to: the board and the lifecycle use codes, and the flow uses keys.

Where It Is Set

Most extensions write both parts from their server code when they install the order config; see Defining a Flow. The order config editor in Fleet-Ops → Operations → Order Config edits the flow, but not meta.lifecycle.

Keep meta keys that other parts of Fleet-Ops use (lifecycle, presentation_profile) when you update a config, and put your own settings under a key named after your extension.

Configuration | Fleetbase