Skip to main content

Execute Script

This is an example of an Execute Script action (highlighted in red in the diagram below). An execute script action can be used to add Rhino JavaScript code into the process. The script will have access to all inputs supplied to the action and can set data using the configured outputs. It can also raise an outcome, by returning a text string.

Execute Script - Process Example

Execute Script Example

Execute Script Example

Property values for above example

PropertyCommentValue
Action IDThis is the exact name of the action.CheckProcessId
Class NameThis is the class name of the action, which can be selected from a drop down list, or entered by the developer.com.enactor.coreUI.actions.UIExecuteJavaScriptAction
CommentsThis is a text field which can contain additional information about the action. It is displayed as a tool tip when the action is hovered over with the mouse.Undefined
Default Next State IDThis indicates the ID of the next state in the process flow, e.g. NewUser.Undefined
Expected Execution Time (ms)This numerical value is the expected execution time of the action in milliseconds.0
Flow Page OptionsThis option enables the developer to produce a flow page diagram associated with the Process Diagram. The text can be entered/edited by double clicking on the value field for this property. The developer can also edit/view the Flow Page by selecting the flow tab when editing the process diagram.Undefined
NameThis indicates the name of the action in a more readable format.Check Process Id
OutputsThis indicates the outputs produced for the selected action. Double-clicking on the value field will bring up a table which will identify for each output the following:
- Name - the name of the output,
e.g. enactor.coreUI.ListCriteria.
- Type - the type of the output,
e.g. com.enactor.core.servers.IListCriteria.
Undefined
ParametersThis indicates the parameters required for the selected action. Double-clicking on the value field will bring up a table which will identify for each parameter the following:
- Name - the name of the parameter,
e.g. enactor.coreUI.MessageBasename.
- Value - the value of the parameter,
e.g. com.enactor.maintenance.resources.UserMaintenanceMessages.
- Type - the type of the parameter, e.g. java.lang.String.
Undefined
PrivilegesThis indicates the privileges for the selected action,
e.g. enactor.userMaintenance.Remove.
Undefined
ScriptThis field contains the actual script to be run at this point.if (executeProcessId!=null && executeProcessId != ""){ outcome = "execute"; }else{ outcome = "home"; }
Session Management TypeThis field determines the session management for the action (if any). It is selected from a drop down list, i.e. None, Make new session, Make session if one does not exist, Manages own session or Needs existing session.None
TypeThis indicates the type of action. It is selected from a drop down list, i.e. Pause, Assign, Action, Execute Script, Call Process, End Process, Execute in Window, Execute Process or Call Web Process.Execute Script

Inputs

This indicates the inputs required for the selected action. Double-clicking on the value field will bring up a table which will identify for each input the following:

  • Name - the name of the input.
  • Type - the type of the input.
  • Required - a tick indicates that the input is required by the action.
NameTypeRequired
enactor.coreUI.ExecuteProcessIdjava.lang.StringNot set

Outcomes

This indicates the possible outcomes of the action. Double-clicking on the value field will bring up a table which will identify for each output the following:

  • Name - the name of the outcome, e.g. Success
  • Unused - a tick indicates that the outcome is not used by the action.
NameUnused
executeNot set
homeNot set