Run Scripts

This handler (com.rierino.handler.ScriptLoadedEventHandler) provides ability to execute stored scripts using Javax engines.

Handler Parameters

Parameter
Definition
Example
Default

code.state

Name of the state manager storing code definitions

customJSCodes

handler_code

code.domain

Category of codes within the code state manager that can be used by this handler

custom_calculation

-

Example Script Handler Definition (Can be Imported on Element Screen)

Actions

Process / ProcessScript

Passes requested event to dynamic event handler for processing. Event metadata parameters applicable for this action are as follows:

Parameter
Definition
Example
Default

dynamicHandler

Name of the code handler to execute request

custom_handler

-

dynamicAction

Name of the action to call on code handler

CustomCalculate

-

Example

Input

{
    "product": {
        "id": "product-1",
        "data": {
            "name": "Test Product"
        }
    }
}

Event Metadata

All parameters applicable for the selected code handler are also passed on by the ScriptLoadedEventHandler.

Different scripting languages such as Groovy, JavaScript, etc. can be supported using Javax classes. Engine and code details are stored in code.state and automatically recompiled / updated on change.

Example Code Definition (Can be Imported on Handler Code Screen)

Last updated