Skip to main content

Enactor Script Action

Overview

This tutorial will guide you through the process of adding a new Enactor Script Action.

What you will learn

  • How to create a new Enactor Script Action.

Pre-requisite

Java Action Tutorial

Exercises

Add a new Enactor Script Action to Application Process

Open Previously created TrainingReactApplicationExtendedProcess Application Process using the Application Process Editor.

Go to Process Editor Palette, Expand Advanced Actions, Drag and Drop Execute Enactor Script to Process Editor

Right-click the Enactor Script Action and select Show Properties. Then update the following properties.

PropertyValue
Action IDGenerateDisplayMessageEnactorScriptAction
InputsName [java.lang.String]
OutcomesSuccess
OutputsMessage [java.lang.String]
note

You can also double-click the Action in different Action Sections on the editor to edit Inputs, Outcomes, and Outputs

You can also drag and drop Inputs ,Outputs from Process State Data

Link the Success Outcome of the GenerateDisplayMessageAction Action to GenerateDisplayMessageEnactorScriptAction Action. Select Link from the Palette and link Sucess Outcome of the GenerateDisplayMessageEnactorScriptAction to the End Process Action.

Save the Process Changes.

After Above Changes your Application Process should look like below.

Create the Enactor Script

Double-click on GenerateDisplayMessageEnactorScriptAction in the Process Editor to open the Enactor Script Editor.

You can now Add your own custom logic as required. In the example below, the given name is converted to lower before being displayed.

message =
"Hello " +
strings.toLowerCase(name) +
" ! " +
" This Greeting Message Was Generated from a Enactor Script Action";
outcome = "Success";

Save the Process Changes.

Refer Enactor Script with Application Process Editor to learn more details on writing scripts.

Run the Application

Recall how the Hello World application was run earlier and relaunch it to see new Enactor Script Action changes.

Further Reading

Refer Enactor Script Actions