Process
A process is a stateful instantiation of a scenario. Specific users are assigned as the defined actors. At any moment you are at a specific state in the process, from which you can do a number of actions.
A process is a deterministic projection, generated by processing responses following the update instructions and transitions of the scenario.
Starting a process
Processes need to be explicitly started via an event with a process resource. This resource should only contain the $schema
, id
, scenario
and actors
properties.
Normally the scenario and actors are objects. This is still accepted, but instead you can also set scenario
to the scenario id and set each items of actors
to the id of an identity.
Identities that aren't set when the process is instantiated need to be set via an update instruction during the process. It's not possible to change an actor on the fly.
Process schema
https://specs.letsflow.io/v0.2.0/process/schema.json#
$schema
The Live Contracts process JSON schema URI that describes the JSON structure of the process.
id
A unique identifier. If the scenario is part of a Live Contract, this must be resource id that's valid for the event chain.
title
The title of the process. By default this is copied from the scenario, but can be updated during the process.
scenario
The scenario that the process is instantiated from.
chain
The id of the event chain that the process belongs to.
actors
A set with (instantiated) actors. The keys are used to reference the actors.
previous
A list of responses that were giving for this process. Applying these response always results the current state that the process is in.
current
The current state the process is in. This is one of the states defined in the scenario.
next
The next states following the golden flow.
assets
A set of instantiated assets. The keys are used to reference the asset.
The properties of each assets can be modified via an update instruction. However, it's not possible to add assets, as they're not defined in the scenario.
definitions
A set of immutable assets copied from the scenario. The keys are used to reference the definition.
Current state schema
https://specs.letsflow.io/v0.2.0/process/schema.json#current-state
The current state object is similar to the state as defined in the schema. However the actions
property contains full actions, not just keys.
title
A short title for the state.
description
A long description for the action that is shown when if the state is current or part of the golden flow.
instructions
Instructions that can be specific per actor. This is an object where the keys correspond with the actor keys.
actions
An array with the all the actions that may be performed in this state.
The order of the actions matter, especially for automated actions. The first available action is considered to be the default action.
transitions
Dynamic transitions from the current state to the next.
Last updated