Component Running a script

Table of Contents

Description

Provides process or functional branching at the scenario level.

In the case of organizing automatic services, the size of a scenario can be quite large, and the "Run Scenario" component provides an opportunity to split a large scenario into several logical blocks. In this way, one script transfers control to the beginning of another script. In this case, you can set some value to start, which will be accepted by the Start component of the nested script and saved to its local variable. In addition, all variables of the same type that are named the same in the run and run scripts will transfer their values from one to the other without change. This way of launching is called a nested launch.

You can also use the component to launch any service script into a parallel process that does not work with resources dependent on the main script. When starting an asynchronous service script, the initial values of its variables, which match the main script variables by type and name, will be set according to their values.

Table 1. System Characteristics

Index

107

Short title

execscript

Types of scenarios

All of them

Starter module

r_script_component_execscript

Mode

Synchronous

Icon

107

Branching pattern

Branching, closing

Properties

Table 2. Properties
Specification Description

Title: Mode
Code: startMode
Visibility: no
Default: Nested

Child script startup mode.
Possible values:

  • Nested (sub,0) - Nested with variable union.
    Runs in the same handler, suspending execution of the current script and passing to the nested script the entire set of accumulated values of local variables and other contexts.
    Upon completion of a nested script, a control return can be performed by simultaneously exposing the 'Control Return' property in the current component and in the Stop component of the nested script.
    Since the variables are shared, any changed values of local variables are translated back to the script that passed control.
    Cascading nesting of scenarios up to 100 levels deep is allowed.

  • Nested without variables (sub_split_vars,2) - Nested without combining variables.
    Starts in the same handler, pausing execution of the current script and passing to the nested script the call parameters available there via the 'startparam/1' expression function. Variable values are not passed in and are not returned.
    Upon completion of a nested script, a control return can be performed by simultaneously exposing the 'Control Return' property in the current component and in the Stop component of the nested script.
    When going back, can pass the result set by the 'Stop' component. This value comes as an argument to be saved to the variable specified in the 'Result to variable' field'.
    All local variables of the script that passed control to the nested script retain their values at the time of the control transfer.
    Cascading nesting of scenarios up to 100 levels deep is allowed.

  • Asynchronous service (async,1) - A new instance of the service script handler is started.
    The running script receives the entire set of currently accumulated variables and their values as input. If the variable names match, their values are filled regardless of the nesting level of the script with the matching variable name inside the new handler.
    variable name is used inside the new handler.
    Execution is performed on an arbitrary server of the current site with the role of svc.

  • Async. without variables` (async_split_vars,3) - Asynchronous service without copying variable values.
    A new instance of the service script handler is started.
    Execution is performed on an arbitrary server of the current site with the role of svc.
    The running script initializes variable values without copying the values accumulated at the time of the call from the current script.
    An asynchronous script can be passed several call parameters, available there through the expressions function 'startparam/1'.

Title: Script Source
Code: scriptMode
Visibility: no
Default: Script Code

Method for selecting the script to run.
Possible values:

  • Nested (code_sel,0) - Selects a nested script from the list.

  • Asynchronous service (code,1) - Specifies the script code with an argument.

Title: Scenario
Code: scriptCodeSync
Visibility: yes
Default: — 

Drop-down list with script codes. Contains all available (unhidden) scripts of the same type as the current script contained in the current domain.

Title: Scenario
Code: scriptCodeAsync
Visibility: yes
Default: — 

Drop-down list with script codes. Contains all available (unhidden) service scripts contained in the current domain.

Title: Scenario Code
Code: svcScriptCodeArg
Visibility: yes
Default: — 

Argument specifying the code of the script to be run. Can also specify codes of hidden scripts.
If there is no script with the specified code, control is passed on the error branch.

The master domain may specify "DOMAIN @ SCRIPT_CODE" as the script code, where the domain is the name of any cluster domain and the code is the code of the script contained in that domain.
This mode is used to run the context scripts of a call in a domain and broadcast events to it: since the call does not belong to a domain, the context script is run in the master domain.
The context script is configured in masterdomain settings.

Title: Id to variable
Code: uuidVariable
Visibility: no
Default: — 

Variable to store the value of the running script ID that can be used to produce interaction.

Title: Return of Control
Code: takeOver
Visibility: yes
Default: No

Enables or disables returning control from a nested script and continuing on the branch further.

Title: Variable Values
Code: varValuesT
Visibility: yes
Default: — 

Table of initial values for local variables of the running script.

Available only if the selected mode is different from "nested with variable merge".

Keys - names of variables of the script to be run.
Matching is done by variable names, values are assigned only to those variables defined in the script.

If the running script passes control to a nested script, the assignment of values to each of these variables is performed at most once, but may be delayed until the nested script is loaded, which has a variable with the corresponding name.

The values set in this way take precedence over the default values within the script being run.

Title: Parameter 1
Code: param1
Visibility: yes
Default: — 

The first parameter for an asynchronous service script. The value is accessed via the startparam(1) expression function or by storing the value in the component Start.

Title: Parameter 2
Code: param2
Visibility: yes
Default: — 

Second parameter for asynchronous service script. The value is accessed through the expression function startparam(2).

Title: Parameter 3
Code: param3
Visibility: yes
Default: — 

Third parameter for asynchronous service script. The value is accessed through the expression function startparam(3).

Title: Parameter 4
Code: param4
Visibility: yes
Default: — 

Fourth parameter for asynchronous service script. The value is accessed through the expression function startparam(4).

Title: Parameter 5
Code: param5
Visibility: yes
Default: — 

Fifth parameter for asynchronous service script. The value is accessed through the expression function startparam(5).

Title: Parameter 6
Code: param6
Visibility: yes
Default: — 

The sixth parameter for the asynchronous service script. The value is accessed through the expression function startparam(6).

Title: Parameter 7
Code: param7
Visibility: yes
Default: — 

Seventh parameter for the asynchronous service script. The value is accessed through the expression function startparam(7).

Title: Parameter 8
Code: param8
Visibility: yes
Default: — 

Eighth parameter for the asynchronous service script. The value is accessed through the expression function startparam(8).

Title: Parameter 9
Code: param9
Visibility: yes
Default: — 

Ninth parameter for the asynchronous service script. The value is accessed through the expression function startparam(9).

Title: Parameter 10
Code: param10
Visibility: yes
Default: — 

Tenth parameter for asynchronous service script. The value is accessed through the expression function startparam(10).

Title: Other Parameters
Code: paramsOther
Visibility: yes
Default: — 

JSON array containing parameters 11, 12, etc. for an asynchronous service script. The value is accessed through the startparam(N) expression function, where N > 10.

Title: Parameter 6
Code: param6
Visibility: yes
Default: — 

The sixth parameter for the asynchronous service script. The value is accessed through the expression function startparam(6).

Title: Result to variable
Code: resultVar
Visibility: yes
Default: — 

Variable where the value returned from the nested script will be saved, set in the 'Stop' component'.
Available only for nested scenario run modes.

Title: Transition
Code: transfer
Visibility: no
Default: — 

A component to which control is passed when an asynchronous service script successfully runs, or when control is returned from a nested script.

Title: Transition, Error
Code: transferError
Visibility: yes
Default: — 

The component to which control is passed when the script fails to run. The causes may include:

  • no code script

  • no access to the domain center

  • lack of role svc

  • overrun

  • other

See also