Scripts
  • 28 Mar 2024
  • 6 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Scripts

  • Dark
    Light
  • PDF

Article Summary

Scripts enable you to extend Simulator functionality with Corezoid processes. Scripts allow the creation of interactive forms for users to perform various operations and manipulate data.
You can create scripts and add them to actors and events.
Scripts are available in the Scripts menu.

Script creation

To quickly create a script, click the Scripts in the workspace menu to open the Scripts menu:

image.png

In the Scripts menu, click the Create button in the right upper corner of the screen, or the New actor button in the center (is displayed when the list in the Scripts menu is empty):

image.png

The script creation menu opens in the Settings tab by default:

scripts-create script menu 1.png

In this tab, you can:

  • select and add a picture to the script (1);
  • enter the script title (2) with a short name (3) generated automatically based on the title;
  • enter a text description for the script (4);
  • select the users you want to share the script with (5). Available options:
  1. Users from the list - script is available only to the users selected in the sharing list (see Sharing a Script);
  2. All workspace users - script is available to all users registered in the workspace;
  3. All registered users - script is available to all users that are registed in your Simulator;
  4. Anyone with the link - script is available to anyone who has the script link.

To create a script, enter the following mandatory parameters in the Settings tab:

  • API key user login (6);
  • API secret key (7);
  • ID of the company in which the API key user was created (8);
  • Dev process ID (9) and Prod process ID (10) values:

image.png

(9) and (10) are IDs of Corezoid processes required for the script to be used in Simulator.Company.

After you’ve finished configuring script parameters, click the Create button to create your script. The new script will appear in the Scripts menu main window with its name, owner, names of the users it is shared with, and creation date displayed:

scripts-created script in the list.png

Script edit

Editing a script

To be able to edit a script, you need to be the script owner or to be granted the Edit rights in the Shared tab of the script actor.

To edit a script, in the Scripts menu, click the icon against the script you need to share and select Edit in the drop-down menu:

image.png

The script edit menu will open:

scripts-edit menu develop.png

The menu has the Develop (1, opens by default) and Production (2) tabs. The Develop tab contains the following elements, which apply to the develop script process:

  • Files (3) column - shows the script process files structure as a tree;

  • Config (4) window - contains the script itself in JSON data format with proper indentation and line feeds, which is available for editing.
    After you’ve finished making changes to the script, click the Deploy button in the upper corner menu (6);

  • Preview (5) window - previews the script the way it is displayed to users;

  • Preview toggle (5.1) slider - enables and disables the Preview (5) window;

  • Preview refresh (5.2) icon - refreshes the Preview window contents;

  • Menu (6) in the upper right corner - allows you to share, run the script and deploy the changes made to the script.

The Production (2) tab has the same elements, but the changes made in this tab apply to the production script process in Corezoid.

Clicking on the settings icon near the script name in the right upper corner opens the script settings menu:

image.png

In the script settings menu, the following items are available:

  • Edit Corezoid credentials - opens the menu for a script editing (same as the Settings tab of the script creation menu);
  • Go to Corezoid process - opens the Corezoid process used for a script in a new browser tab;
  • Remove - removes a script (available only for users with the script Remove rights).

Files-panel menus

When pointing your mouse cursor at a folder item in the left-side Files menu, the context menu is displayed:

Static page high.png

  1. Create a new folder in the selected folder.
  2. Create a new file in the selected folder.
  3. Folder menu.

The folder menu provides the following options:

folder menu high.png

  • Duplicate - click to duplicate the folder.
  • Make static page - click to make a static page with no dynamic content. The created static pages are marked with the S letter on the folder icon. Being simple, static pages are quicker to load.
  • Remove - click to remove the folder.

Script sharing

Script sharing

To be able to share a script, you need to be the script owner or the script needs to be shared with you (either in the Shared tab of the script actor, or in the Shared with drop-down menu of script parameters).

Sharing a script from the Scripts menu

To share a script, follow the steps:

  1. Click the share icon near the name of the script you need to share in the Scripts menu:

script share 1 high.png

  1. In the Shared tab of the side menu that opens, click the Manage button:

script share 2 high.png

This will open the share management menu:

script share 3 high .png

In this menu, you can search for users, with which you want to share the script by name or email (1). The system automatically provides suggestions on the users to add, from which you can select users to share the script with.
For each added user, you can configure script view (2), edit (3), remove (3), sign (5), and execute (6) rights by ticking the boxes. After adding the users and configuring their rights, click the Save changes button.

Sharing a script from the script edit menu

In the Script access tab, you can select (2) and search for (1) users that you want to grant access to your script. You can set View, Edit, and Remove rights independently for each user you are granting access to the script:

script share 4 high.png

Script owner rights

A script owner has all the script access rights and can’t be removed from the list of users with access to the script.

Configuring script sharing options from the script edit menu

You can override script sharing settings available in the Share item in the scripts lists menu and Script access tab of the script edit menu from the script settings menu.
To do this:

  1. Open the script edit menu;
  2. Open the script parameters menu;
  3. Select the Edit Corezoid credentials;
  4. Select the Shared with field:

scripts sharing from the cog menu.gif

In the Shared with drop-down list, you can select one of the script sharing options which overrides all other script sharing settings:

  • Users from the list - grants script access to the users selected in the script properties Shared tab list (or the Script access tab of the script creation menu);
  • All workspace users - grants script access to all users of the current workspace and overrides other script access settings;
  • All registered users - grants script access to all the Simulator registered users and overrides other script access settings;
  • Anyone with the link - grants script access to any user with the script link and overrides other script access settings;

Running a Script in a new window

Script running

You can run a script only if you are the script owner or if the script was shared with you.

If you need to see how your script looks and test it, you can run it in a new window. To do this, in the Scripts menu, click the icon against the script you need to share and select Run in new window in the drop-down menu:

scripts-drop-down menu run in new window.png

This will run the script in a new browser tab.

Removing a Script

Script remove

You can remove a script only if you are the script owner or if the script was shared with you with the Remove rights.

To remove a script, in the Scripts menu, click on the icon against the script you need to share and select Remove in the drop-down menu:

scripts-drop-down menu remove.png

Exporting a script

To export a script, click the Add to Export Graph queue item in the Scripts menu:

image.png

This will add the selected script to the export queue, from which you can proceed to export the script.


Was this article helpful?