Building Automation Business Scenarios#
An Automation Business Scenario is a set of steps that are designed to guide the user to indicate the exact behavior intended and the conditions on which it will occur.
Here is the structure of the main configuration object in JSON format:
| Property | Description | Mandatory | Data Type | Attributes | Default Value | |
|---|---|---|---|---|---|---|
| Name | Name of the Scenario. Will be visible to the user when selecting the scenarios to use | Y | String | Unique | ||
| Description | Detailed explanation about the intention behind the scenario, what it does, etc. | N | String | |||
| IsEnabled | Flag indicating if the Scenario is enabled to be used within the system | N | Boolean | true | ||
| Scopes | List of scopes (separated by comma ,) representing the scopes of the scenario and where it can be used within the system | Y | CSV String | |||
| Metadata | Serialized string containing the full metadata structure of the scenario | Y | String | Serialized from BusinessScenario | ||
| Condition | JSONata expression to evaluate the entity where the user is in order to determine if the scenario is to be available or not Note: It is expected for the expression to return a boolean valueExample: ($distinct(AutomationProtocol.Package)[$contains($, 'driver-oib')]) != "" | N | String | |||
| ConditionType | Type of condition used to evaluate if this scenario is available in the scope | Y | Enum | JSONata | JSONata | |
| PackageName | Name of the package used to load the scenario into the system. | N | String | <null> | ||
| PackageVersion | Version of the package used to load the scenario into the system. | N | String | <null> |
Conditional Scenario
In order to show the user the scenario, the reference point of where the user is in the system is important. If for example the user is in <URL>/Entity/AutomationManager, only the scenarios that are defined for that Scope are shown. The scenario can also have specific rules, such as that the entity has to be in a particular state or with a particular name, etc.
These types of conditions are defined using JSONata expressions, in the Condition field. The special keyword entityInstance is used to access the current entity instance of that scope.
For more information on the building blocks of Automation Business Scenarios, start with the following pages:
- Execution Engine to learn about the execution engine that powers the scenarios;
- User Interface to understand the user interface;
- Business Scenario (JSON) for the complete metadata format which includes the Step (JSON) page with details on the format of each available scenario step.