Entity | Scenarios


An Entity scenario is alternative state for the Entity to be in. It is a way to manage simulations where an Entity needs to take on a temporary state.

Creating a 'Scenario' Entity

If you update an Entity record and include the Scenario value, then the primary record is not touched. It will create/update the related scenario data instead.

You can alternatively specify the scenario ID or Key in the query param, which will override any values supplied in the body.

You must be updating an existing Entity record.

Create/Update one 'Scenario' Entity

Request body
interface IPostBody {
    "Bruce": {
        "ID": "your-entity-id",
        // Can be supplied here, or through the query param.
        "Scenario": "your-scenario-key-or-id"
    },
    "some-key": "some-value"
}

Create/Update multiple 'Scenario' Entities

Request body
interface IPostBody {
    "Items": [
        {
            "Bruce": {
                "ID": "your-entity-id",
                // If the query param is supplied, then this value will be overridden.
                "Scenario": "your-scenario-key-or-id"
            }
        },
        {
            "Bruce": {
                "ID": "your-entity-id-2"
                // Can omit the Scenario if the query param is supplied.
            }
        }
    ]
}

Getting a 'Scenario' Entity

You can perform our typical requests and include either Scenario=blah in the query or body (depending on if you're doing a GET or POST search).

The scenario data is included after the query resolves, so your filters will not apply against the scenario! This is something we're looking to improve.

Get a 'Scenario' Entity

Response
interface IResponse {
    "Bruce": {
        "CreatedBy.User.ID": "dummy",
        "Created": "some-date-time-string",
        "EntityType.ID": "some-entity-type-id",
        "ID": "some-entity-id",
        // Outline on what parts of the Entity were loaded from where.
        // This is a preview on what properties are available (focused on Scenarios here).
        "Outline"?: {
            // Indicates that this is the baseline source of Entity data.
            // If true, then any attributes not specified by another source are assumed to be from this one.
            "Baseline"?: boolean;
            // Human readable name of the source.
            "Source.Name": string;
            // Related Scenario record if any.
            // This is the scenario ID or key. Typically the Key.
            "Scenario"?: string | number;
            // DateTime representing the time of the record (if any).
            "DateTime"?: string;
            // Indicates that this source is editable.
            // When false, inputs for the related attribute are disabled.
            "Editable": boolean;
            // Array of attribute paths that were loaded from this source.
            // If Baseline=true, then all attributes that weren't specified are loaded from this source.
            "Attribute"?: string[];
        }[]
    },
    "some-key": "some-value"
}
Javascript example

Get multiple 'Scenario' Entities

Javascript example

Getting a 'Scenario' record

You can get the plain records directly as well. This means it won't include our typical internal Bruce data.

Note that this uses the same technology as the historic-records so until a v3 request is available, some terminology may be the same.

Get 'Scenario' records

Javascript example

Deleting 'Scenario' Entity records

If an Entity is deleted, the related scenario data is also deleted.
if the scenario is deleted, all scenario data related to it is deleted.

Note that this uses the same technology as the historic-records so until a v3 request is available, some terminology may be the same.

Delete 'Scenario' records

Javascript example