Script Executor Widget

The Script Executor widget is used to execute scripts in SAP Commerce Cloud.

Widget Definition

Name Script Executor
ID com.hybris.backoffice.widgets.scriptexecutor
Category Adapters, Scripting.
Description While executing any script available in the Commerce Suite, Script Executor uses passed-in data as the context data, to populate the script.
Applied In Backoffice
Based On Not applicable
Author SAP
Inputs Details of input sockets:
  • data
    • Type: java.lang.Object
    • Multiplicity: Single
    • Description: Data object passed to the resolved script as a context attribute, available under data variable.
Outputs Details of output sockets:
  • success
    • Type: java.lang.Object
    • Multiplicity: Single
    • Description: The result of the script execution, or null, if the script does not return any result.
  • error
    • Type: java.lang.Object
    • Multiplicity: Single
    • Description: The original passed object. Issued when the script fails during execution. Script execution is considered as failed if for any reason it did not end successfully. One of such cases is, for example, an execution exception (de.hybris.platform.scripting.engine.exception.ScriptingException is thrown or if scription engine marks the execution as failed.
Generated Events Not applicable

Configuration

Not applicable.

Widget Preview

Not applicable.

Settings

Setting Type Description
scriptUri java.lang.String As defined in the platform scripting engine, the URI should represent a script possible to be resolved by the scripting engine. If defined, the scriptUri takes precedence before the in-line declared scripts. Refer to the scriptContent setting.
scriptContent java.lang.String If the scriptUri is not set, scriptContent is used as the script source. The script must be written using language defined via scriptContentLang. If any of the properties, scriptContentLang or scriptContent, is blank, the script is not executed.
scriptContentLang java.lang.String A language in which the script given via scriptContent property is written. It should match one of the languages supported by the platform scripting engine. Default value: groovy.

Widget Slots

slotID Multiplicity Type Slots Composition
cockpitWidgetChildrenInvisible multi Not applicable A general-purpose slot available for widgets. Any widget placed on this slot is not displayed in the application view but can be accessed through its socket API.