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 Example
Property values for above example
Property | Comment | Value |
---|---|---|
Action ID | This is the exact name of the action. | CheckProcessId |
Class Name | This 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 |
Comments | This 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 ID | This 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 Options | This 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 |
Name | This indicates the name of the action in a more readable format. | Check Process Id |
Outputs | This 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 |
Parameters | This 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 |
Privileges | This indicates the privileges for the selected action, e.g. enactor.userMaintenance.Remove. | Undefined |
Script | This field contains the actual script to be run at this point. | if (executeProcessId!=null && executeProcessId != ""){ outcome = "execute"; }else{ outcome = "home"; } |
Session Management Type | This 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 |
Type | This 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.
Name | Type | Required |
---|---|---|
enactor.coreUI.ExecuteProcessId | java.lang.String | Not 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.
Name | Unused |
---|---|
execute | Not set |
home | Not set |