Actor
An actor is a person, team, or system that participates in a process.
Items in the actors
property of the scenario aren't actor objects, but JSON schemas defining the properties available for the actor once instantiated in the process.
The actor schema always defines an object type. This is implicit. Actors can't be a composite type (using oneOf
, allOf
, or anyOf
).
Schema
https://schemas.letsflow.io/v1.0.0/actor
The actor schema extends a JSON Schema. Other JSON Schema properties are also allowed.
Properties
title
title
The title of the actor. If omitted, this is created from the actor key.
role
role
string or array of strings
Use for access control. Any user that has this role can perform as this actor. If multiple roles are specified, the user must have at least one of these roles.
If the role of an actor is defined in the scenario, it can't be changed with start instructions or during the process.
properties
properties
map of schemas
By default, a process actor only has an id, title, and role. Other properties must be specified in the actor schema.
additionalProperties
additionalProperties
boolean or schema
By default, it's not allowed to set properties of an actor that aren't defined in the schema. In other words; the JSONSchema additionalProperties
value default to false
.
You may set this property to true
to allow additional properties to be set for the process actor. Alternatively, you can specify a schema to which all additional properties need to comply.
External schema
Instead of defining the schema within the scenario, you can reference an external schema for reusability.
The title
and role
property of external schema is ignored. They should be specified in the scenario.
Read more about using custom schemas in the validation chapter.
Wildcard actors
Wildcard actors allow for defining a flexible number of participants in a process without explicitly naming or enumerating them. This is achieved by using a wildcard pattern in the actor key, such as person_*
. For example:
In this example, each actor with a key like person_1
, person_2
, and so on will share the same schema.
Start instructions
When the process is instantiated, actors matching this pattern in the start instructions will be dynamically created, each with the same schema.
Creation at runtime
Alternatively, actors can be added at runtime using update instructions.
Last updated