Product layer microservice call

Description

Performs a request for the specified method of the specified microservice in the product layer of the current domain. It is called using the collection platform/services/Invocations.

Passes as input either an object with variable values, an object with the specified named arguments, or the parameter specified by the argument.
On exit, the returned result is stored in a variable, and also when the mode is activated, the returned object is expanded into script variables, mapping first-level keys and local variable names.

Table 1. System Characteristics

Index

155

Short title

invocation

Types of scenarios

All of them

Starter module

era_script_component_invocation

Mode

Asynchronous

Icon

155

Branching pattern

Branching

Limitations

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

Properties

Table 2. Properties
Specification Description

Title: Code JS
Code: code
Visibility: no
Default: — 

JS function code to be executed in node.js in a product layer microservice environment.

Title: Parameter setting method
Code: argsMode
Visibility: no
Default: vars

Switches the parameter setting mode for the runtime environment.

Possible values:

  • All variables (allvars,0) - all variables with their values are passed. In JS code you can refer to them directly by their names.

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

When passing JSON string values, representing objects are available in code as objects, JSON arrays are available as arrays, strings and numbers default to strings, dates as a string, and blank values are left blank (null).

Title: Arguments
Code: args
Visibility: yes
Default: — 

List of parameters to be passed and their names.
They can be accessed from executable code via names like normal variables.

If the value is a JSON string with an object or array, the object or array will be accessed directly in the JS code when the corresponding variable is accessed.

Title: Timeout, sec
Code: timeoutSec
Visibility: no
Default: 5

Argument defining the timeout of code execution in the node JS.
When the timeout expires, the script passes control to the 'Transition, timeout' branch and the code continues to execute.

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

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

Title: Error to variable
Code: errorVar
Visibility: no
Default: — 

Variable where the string with the error code and text is saved.
Some deployed errors are saved to the log file.

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

Component to which control is passed.

Title: Transition, Time
Code: transferTimeout
Visibility: no
Default: — 

Component to which control is passed in case of timeout.

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

The component to which control is passed in case of an error.

See also