Scripts editor
Script view
In the main script view the selected version of the script is visible. The sidebar contains buttons that allow you to open the script parameters panel, unit tests and logs.
The script run button is located on the Parameters.

Editing the script
Work on the script is possible thanks to the Monaco editor (the editor supports the JavaScript language).
Initially it operates in read-only. To start working you need to click the Edit script button located at the end of the navigation bar.

The instruction "how to write service scripts" is located in Scripts (scriptService) and ScriptCode best practices.
Variables in ScriptCode within block scope
The Eximee platform requires that variables in ScriptCode be declared in block scope.
Failure to declare a variable will cause a script error.
Parameters
Modification of parameters also takes place in Monaco (the editor supports JSON notation).
On first opening a non-empty script the parameters will be automatically deduced (if possible) from the script content itself.
Under the editor there is a button that allows you to run the script with the parameters provided in the Test data.

Parameters filled in the Test data section are not part of the script itself and will not be saved in that version of it!
Editing inputs/outputs
Here we can add or remove service script inputs/outputs.
Adding or removing an input will also update the runtime parameters, so after removing a parameter we will lose any mapping it had at the attachment point.

Script result
An additional window appears at the bottom of the screen. There you will find all information about the executed script:
Script run time given in ms.
Logs from script execution in the form:
[OPERATION_TIME] [OPERATION_TYPE]: Operation textFor example:
[14:31:22,976] [GET_DATA]: Called getData("GesCustomComponent1","data") and resulted with data z ccThe result of the script call (in the logs panel), that is all values defined as outputs during creation of the service script in the form KEY : VALUE.

Illustration 5. Script result tab
Monaco editor
The editor used in the project is a full-featured editor, which means it offers a set of shortcuts that assist writing. List of the most frequently used keyboard shortcuts:
Ctrl + Shift + I - code formatting. After writing any fragment it is always worth formatting it; this increases readability and makes work easier.
Ctrl + Shift + O - jump to variable/function. This is a supercharged search. When scripts grow to sizes that don't fit on one screen, it's worth using such shortcuts to navigate the code faster.
Ctrl + Shift + K - delete the entire line.
Ctrl + F2 - find and replace a specific symbol (function name, variable).
Ctrl + G - jump to line.
Ctrl + Shift + Alt + Arrow Up/Down - clone the cursor up/down.
F1 - list of all available shortcuts and editor options.
Tests
The editor has the ability to define test scenarios.
Errors during test run
If the script contains errors, during a test run such an error will be logged in the console under the editor. The message will contain the reason and the place in the code where the error occurred.

Last updated
Was this helpful?
