At the output, the returned result is stored in a variable, and when the mode is activated, the returned object is decomposed into script variables, matching first-level keys and local variable names.

Calling the product layer microservice

:icons:font :hardbreaks: :imagesdir: ../../../assets/images :toc-title: Contents :toc:

Description

Requests the specified method on the specified microservice in the product layer of the current domain. The invocation is made using the platform/services/Invocations collection. :description2: Passes as input either an object with the values of variables, or an object with the specified named arguments, or a parameter specified by the argument. +\

Table 1. System characteristics

Index

155

Short name

invocation

Script types

All

Start module

era_script_component_invocation

Mode

Asynchronous

Icon

155

Branching type

Branching

Limitations

  • If a timeout is triggered, the script stops waiting for a response and passes control to the next component, the executing method does not complete.

Properties

Table 2. Properties
Specification Description

Name: Microservice

Code: nsvcName

Visibility condition: no

Default: — 

Name of the product layer microservice.

Name: Method

Code: methodName

Visibility condition: no Default: — 

The name of the method of the above product layer microservice.

Name: Method for setting parameters

Code: argsMode

Visibility condition: no

Default: vars

Switches the mode of setting the starting parameters for the method.

Possible values:

  • All variables (allvars,0) - all variables with their values ​​are transmitted.

  • Specified arguments (args,1) - the 'Arguments' property specifies a list of named passed parameters. In JS code you can refer to them by the specified names.

  • Custom (custom,2) - the 'Custom parameter' property specifies a json parameter passed to the method input without changes.

When passing values, JSON strings representing objects are available in the code as objects, JSON arrays are available as arrays, strings and numbers by default, dates are available as a string, and unfilled values remain null.

Name: Arguments Code: args Visibility condition: yes

Default: — 

List of passed parameters and their names.

Name: Custom parameter

Code: customRequest

Visibility condition: yes

Default: — 

Allows you to create a method parameter object manually without additional transformations.

"Name: Decompose by variables

Code: parseToVars

Visibility condition: no

Default: no

If enabled, the result is parsed and the values of all first-level keys are placed in existing variables with similar names.

Name: Timeout, sec

Code: timeoutSec

Visibility condition: no Default: 5

An argument that specifies the method execution timeout in the JS runtime environment.

When the timeout expires, the script passes control to the 'Transition, timeout' branch, and the code continues to execute.

Name: Result into variable

Code: resultVar

Visibility condition: no

Default: — 

Variable where the full body of the method execution result is saved. If a method returns an object or an array, its JSON string representation is stored in the variable.

Name: Error in variable

Code: errorVar

Visibility condition: no

Default: — 

Variable where the string with the error code and text is saved.

Some expanded errors are saved to the log.

Name: Transition

Code: transfer

Visibility condition: no

Default: — 

Component to which control is transferred.

Name: Transition, time

Code: transferTimeout

Visibility condition: no Default: — 

The component to which control is transferred in case of a timeout.

Name: Transition, error

Code: transferError

Visibility condition: no

Default: — 

Component to which control is transferred in case of an error.

See also