Skip to main content

Beanshell Scripting with Enactor Application Process Editor

Inputs

To pass an input variable to a BeanShell script, follow these steps:

  • Add the input to the Action using the Application Editor.

  • Reference the input in your BeanShell script using the following convention:

    • Trim the input at the last dot (.)
    • Take the last segment
    • Convert the first letter to lowercase

Example:

If the input is enactor.mfc.Basket, you would reference it in the script basket.

Inputs

Outputs

To send a variable as output from a BeanShell script, follow these steps:

  • Add the output to the Action using the Application Editor.

  • Match the output name with the corresponding script variable:

    • Use the script variable name as the last segment of the output path
    • Capitalize the first letter of the script variable when defining the output

Example:

If your script defines a variable basketItem, the output variable can be named enactor.mfc.BasketItem

Outputs

Outcomes

You can define outcomes in the beanshell script as Outcome = “Success”;

Then you can add Outcomes to the Action using the Application Process Editor.

Outcomes

Static Libraries

You can use functions provided by the Enactor Static Libraries within your scripts.

Locating Static Library Classes

To view the methods available in static library functions:

  • Double-click a link connecting two actions in an existing process.

  • Expand the Functions section to browse library methods, organized by category.

Library Methods

To use a method from a static library in your script:

  • Select the relevant class for your static library from the table given below.
Function NameClassname
clientcom.enactor.coreUI.pageDefinition.ClientSideFunctionMapper
convertcom.enactor.coreUI.el.ConvertFunctionMapper
crpytocom.enactor.core.cryptography.CryptographyUtils
databasecom.enactor.core.listFilters.DatabaseFunctionMapper
datescom.enactor.core.utilities.DateUtils
emailcom.enactor.coreUI.mail.EmailFunctionMapper
encodecom.enactor.core.utilities.EncodeUtils
filtercom.enactor.core.listFilters.DatabaseFunctionMapper
formatcom.enactor.coreUI.format.DataFormatterFunctionMapper
groupcom.enactor.mfc.group.el.GroupFunctionMapper
namecom.enactor.coreUI.format.DataFormatterFunctionMapper
pagedefcom.enactor.coreUI.el.PageDefinitionFunctionMapper
privcom.enactor.coreUI.el.PrivilegesFunctionMapper
scriptcom.enactor.coreUI.el.ScriptFunctionMapper
simplecom.enactor.core.el.CoreApplicationProcessFunctionMapper
stringscom.enactor.core.utilities.StringUtils
xmlcom.enactor.core.el.CoreApplicationProcessFunctionMapper
  • Import the required class at the top of your script.

  • Call the desired method from the imported class.

For example, to concatenate two strings:

Required function - Simple functions

Relevant classname - com.enactor.core.el.CoreApplicationProcessFunctionMapper

Therefore, the script should be,

import com.enactor.core.el.CoreApplicationProcessFunctionMapper;

message = CoreApplicationProcessFunctionMapper.concat("Hello ", name);