Bean scripting framework action

BeanScriptingAction32x32

Description

This action enables allows to run a script as part of the action. This action provides scripting capabilities using the embedded Bean Scripting Framework and supports Java (Beanshell), JavaScript, Jython and Groovy languages.

When using this action, you must specify the language used for scripting in the Scripting Language parameter and the script code in the action code in the expression editor. This code does not need to be enclosed between the %e(<language>){…​}e(<language>)% tags, and can use variables.

Parameters

Name Mandatory Default Description

Scripting Language

Yes

Name of the scripting language: beanshell, javascript, jython or groovy.

The Jython scripting engine may be upgraded with the Semarchy xDI versions. If your scripts are not compatible with the upgraded version of the Jython engine, you can force that version with the jythonVersion runtime parameter.

Scripting Connection

No

Name given to the scripting context shared across different actions.

Module

No

Module to use when using jython and groovy scripting languages.

The scripting will not work when using classes from third-party jython and groovy libraries. You will need to retrieve the required classes using the java.lang.Class.forName function. Refer to Modules and Scripting for more information.

Limitations

In Java version 21, BeanShell scripts that execute HTTPS URL connections may fail with a java.lang.IllegalAccessException error. This is because Java 21 enforces module encapsulation, which restricts reflective access to internal classes. Semarchy xDI keeps these restrictions in place to maintain security.

If you encounter this issue, you can bypass these restrictions by adding the following option to your runtime initvariables script:

Example 1. macOS/Linux (initvariables.sh)
---
ADD_OPEN_OPTIONS="$ADD_OPEN_OPTIONS --add-opens=java.base/sun.net.www.protocol.https=ALL-UNNAMED"
---
Example 2. Windows (initvariables.bat)
---
set "ADD_OPEN_OPTIONS=%ADD_OPEN_OPTIONS% --add-opens=java.base/sun.net.www.protocol.https=ALL-UNNAMED"
---