Execute Script
Verb: executeScript
Available from: <Standard>
Executes the selected script in the current execution context.
Syntax
executeScript [--handleError(Boolean)] [--isfromfile(Boolean)] --filename(String) --name(String) [--parameters(String)] [--output(String)] [--version(Numeric)] (Boolean)=value (String)=errormessage (Numeric)=linenumber (String)=errorsubname (Error)=error
Inputs
| Script | Designer | Required | AcceptedTypes | Description |
|---|---|---|---|---|
| --handleError | Handle error | Optional | Boolean | When enabled, avoids execution failure should any errors occur during the execution of the selected script and returns the information regarding the error
When disabled, if any errors occur while executing the selected script, the current script fails. |
| --isfromfile | File | Optional | Boolean | When enabled, allows searching for the script that should be executed in the local storage.
With this parameter disabled, the script is searched for in the repository. |
| --filename | Filename | Only whenFile is True | Text | File path of the script that should be executed. |
| --name | Name | Only whenFile is False | Text | Name of the script in the repository. |
| --parameters | Parameters | Optional | Text | Mapping of the parameters of the script that should be executed and their respective values in the current execution context. |
| --output | Outputs | Optional | Text | Mapping of the outputs of the script that should be executed and their respective values in the current execution context. |
| --version | Version | Optional | Number | Version of the script that should be executed. |
Outputs
| Script | Designer | AcceptedTypes | Description |
|---|---|---|---|
| value | Success | Boolean | Indicates whether the script ran successfully, returning "True" if successful or "False" if not. |
| errormessage | Error message | Text | Message stating the error that occurred while executing the script. |
| linenumber | Error line number | Number | Message that tells the line of the script where the error occurred. |
| errorsubname | Error routine name | Text | Message with the name of the subroutine in which the error occurred. |
| error | Error | Error | Variable containing all information about the error that occurred. |
Example
Runs a script using a local path with the Handle error option enabled.
defVar --name errorLine --type Numeric
defVar --name subroutineError --type String
defVar --name executionSuccess --type Boolean
defVar --name errorLog --type String
// Download the following file to execute the command.
executeScript --handleError --isfromfile --filename "executeScript.wal" executionSuccess=value errorLog=errormessage errorLine=linenumber subroutineError=errorsubname
logMessage --message "Success: ${executionSuccess}\r\nError Message: ${errorLog}\r\nError Line: ${errorLine}\r\nSubroutine Error: ${subroutineError}" --type "Info"
// Result: Success: True