Service scenario (svcscript)

Description

A script used as a subroutine to manage common events and data. Executed by the Script role, it can run asynchronously without binding to any other runtime resources.
Can be run for processing:
- of a scheduled service task (svctask),
- data from another script nested or asynchronously,
- to process the incoming HTTP request,
- To process the contextual data of the call,
- to send a message to the integration channel,
etc.

Contains only common components available to all types of scripts.

Script editing is performed in the visual script editor (app scripteditor).

Limitations

  • The collection is available in any domain, including the master domain.

  • The script handler may be subject to constraints set in the parent domain for the current domain: pause between components, number of components, execution time, etc.

  • Licensed by a quantitative parameter: the license for service scenarios is consumed.

Fields

Entity structure
{
  "id": uuid,
  "code": str,
  "name": str,
  "scriptdata": object,
  "projectid": uuid,
  "lwt": date,
  "opts": {
    "title": str,
    "comment": str,
    "loglevel": int,
    "variables": object
  },
  "ext": {
    "ct": date,
    "lwt": date
  }
}
Table 1. Fields
Specification Description

Field: id
Mode: inout
Type: uuid
Default: generated

Identifier. Can be specified at creation, otherwise generated by the system.

Field: code
Mode: in
Type: str
Default: required

Code. Used for association with other entities.

Field: name
Mode: in
Type: str
Default: required

Title

Field: scriptdata
Mode: in
Type: object
Default: required

Script content: components, variables, some other properties.
Discussed in detail in Scripts.

Field: projectid
Mode: in
Type: uuid
Default: empty

Identifier of the project to which the script belongs

Field: lwt
Mode: out
Type: date
Default: generated

(duplicate, obsolete) Time of last modification of the object

Field: opts
Mode: in
Type: object
Composite field

Field: opts.title
Mode: in
Type: str
Default: empty

Arbitrary header

Field: opts.comment
Mode: in
Type: str
Default: empty

Arbitrary comment

Field: opts.loglevel
Mode: in
Type: int
Default: 0

Scenario Logging Level (0-3).
0 – disabled, …​, 2 - maximum.
Logging is done in:

  • general log /script/erl_*.log. In any case, it only records the fact that the script handler process was started and transitions between components and scripts;

  • typed subdomain log /script/svc@<domain>_*.log. It is intended to provide information on request through the diagnostic API to the administrator of the current domain.

    • 0 – only crashes;

    • 1 – component and logic errors;

    • 2 – warnings;

    • 3 – component and scenario transitions and some intermediate data.

Field: opts.variables
Mode: in
Type: "object"
Default: empty

Initial values of script variables.
Used by the script handler when loading the script in case the variable was not previously set by it.
In case the script is loaded in a nested way, also applies.

Field: ext
Mode: inout
Type: object
Compound field

Allows you to extend the compound with arbitrary keys and values

Field: ext.ct
Mode: out
Type: date
Default: generated

Object creation time

Field: ext.lwt
Mode: out
Type: date
Default: generated

Time of last modification of the object

See also

Logical roles

  • svc performs maintenance of service scripts.