Script actor

The specified bean shell script is executed. For advanced users only.

Parameter

Description

Variable

The value of the specified variable can be used in the script.

Example, if the name of the variable is 'variableName':

return variableName.get();

The specified Bean Shell script is executed. To be able to edit the script, the right Administration/System/BSH Script/Edit Script is required.

images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/warning.svgWARNINGimages/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/warning.svg This action is only suitable for advanced and technically skilled users. Therefore, no detailed application possibilities are described here, as this is part of the developer documentation. The script action is reserved exclusively for problems that are not solvable by any of the generic approaches provided in Lobster Data Platform / Orchestration. Incorrect use of this action can cause significant and irrevocable damage to the system and the database. Please contact our support staff for further information and possible training/workshops in this regard.

The following constants are available in the script:

Parameter

Description

environment

SCM Environment instance

si

Current user session

logger

Logger instance

action

The current action/event being handled with all variables (e.g. action.get("VARNAME"), action.set("VARNAME", VARVALUE) ).
Note: 'action.name' contains the name of the triggered event

entity

The current data object which is currently set as input object

em

The current database session

isTest

true/false: Indicates whether is running in test mode

rootObject

The root object of the whole rule


Access to the watchdog, which aborts the script if it exceeds a preset timeout.

The default value for the timeout is 5 seconds.

Function

Description

wdInfo.reset()

Resets the watchdog

wdInfo.setTimeout(s)

Sets the timeout to s seconds


In addition, own variables can be defined, which are also available in the script as variables (Read/write access in the script: 'String value = variableName.get()' and 'variableName.set( value )' ).

If the script returns an instance of an event action when it is executed, this instance will be used for any further events. Otherwise, the script is executed for each event.