Content of the new scenario

Location path

Path in the assembly catalog

/era_script/priv/default_scripts/<TYPE>.json

The content of an arbitrary type of scenario.

/era_script/priv/default_scripts/default.json

Default scenario content when there is no file for a particular scenario type.

Overview

When you create a new scenario in the scenario editor, the initial components automatically appear in the field: START and possibly some others.

The composition of components is defined by metadata. The catalog contains json representations of scripts for each script type, having type names: ivr.json, svc.json. If a file for some type of script does not exist, the contents of the default.json file with only the START component are applied.

The format is identical to the JSON value of the scriptdata field of entities ivrscript, svcscript. Creation of a hidden script file can be performed according to the following algorithm:

  1. In the script editor web application, a script is created and saved to the domain.

  2. The body of the script is pulled from the domain via API requests .

  3. The value of the scriptdata field is saved to a file with encoding UTF-8.

  4. The file is named, placed in the assembly directory of the process CI.

Format:
{
  "objects": array<object>,
  "variables": array<object>,
  "scriptVersion": 170105
}
  • objects – list of scenario components with filled fields.

  • variables – a list of the script variables used.

  • scriptVersion – file format version.

Example

Example of file content default.json.

Example:
{
  "objects": [
    {
      "oId": 1,
      "oType": 101,
      "oTop": 16,
      "oLeft": 32,
      "oWidth": 32,
      "oHeight": 32,
      "oLayer": 0,
      "oCreationDate": "2017-01-30 10:22:51",
      "type": 0,
      "defineVars": 1,
      "implementedTime": 60000,
"name": "Start",
      "info": ""
    }
  ],
  "variables": [],
  "scriptVersion": 170105
}

See also