Functions

Functions enable you to write code snippets in regular programming language, which let you implement any logic you want. You can write functions where Decision Table matrix is not enough.

If you are new to Higson functions, you may want to read the introductory section Introduction to Functions.

Since version 4.3, Higson Studio also includes an AI Assistant that can help you generate and refine functions from a natural-language description. To learn how to enable it, see AI Assistant Configuration, and for usage instructions see AI Features in Functions.

In order to see all functions, select Functions in Main Toolbar.

After you enter Functions you will see screen of all functions:

Each function is described by seven attributes:

No. Column name Description
1. Name Full function name/code. The function name and function code are interchangeable.
2. Type Type of programming language used in the Groovy function.
3. Tags List of all Tags assigned to the function. To learn more about assigning Tags go here.
4. Profile/Region Profile and Region the function is assigned to.
5. Description Contains the Description of the function if such was added.
6. Last change The last modification date of the function.
7. Actions List of quick access actions. Currently only Remove action (bin icon) is available here. Remove action deletes desired function.

The functions list view depends on the selected profile. If a profile is selected, both global items and items assigned to the selected profile are displayed. If no profile is selected (not-chosen), only global items are visible.

Elements modified in current session are marked with a dot:

On this screen, you can apply Filters to search for specific function or to narrow down the number of displayed functions. You can also perform actions on one or multiple functions.

You can see All Actions available for the functions below:

No. Action Description
1. Checkboxes Select the top checkbox to select all functions in the view, or select individual checkboxes to group functions for actions 5a, 5b, 5c, 5f, 5g, 5h, 5i, 5j, 5k.
2. + Add function Opens a step-by-step function wizard. Allows to create new functions. To learn more about adding functions go here.
3. Upload Allows to import functions from a ZIP file. To learn more about uploading functions go here.
4. Hide/Show filters Hides or reveals Filters bar accordingly. If Filter bar is visible, then action Hide filters is available. If Filter bar is hidden, then action Show filters is available.
- is visible, then action Hide filters is available.
- is hidden, then action Show filters is available.
5. More actions Drop-down list that contains actions 5a-5k. Bear in mind that actions 5a, 5b, 5c, 5f, 5g, 5h, 5i, 5j, 5k are available only if at least one function is selected (at least one checkbox is checked). Otherwise, the mentioned actions will be greyed out (see picture below the table).
5a. Mass export to XLSx Downloads a ZIP file that contains XLSX file and files with functions’ body. To learn more about mass export go here
5b. Extract codes Downloads a XLSX file that contains functions’ extract. To learn more about extracting codes go here.
5c. Download codes Download a TXT file with functions’ names/codes To learn more about extracting codes go here.
5d. Select from file Allows to upload a TXT file with function codes, after uploading, all functions present in file will be selected. To learn more about selecting from file go here
5e. Compare with extract Allows to upload an XLSX file with functions’ extract. Makes comparison between the provided file and the environment. To learn more about comparing with extract go here
5f. Assign profile Assigns a profile to all selected functions. To learn more about assigning profiles go here
5g. Make global Makes all selected functions global. To learn more about making functions global go here
5h. Add region Adds regions to all selected functions. To learn more about adding regions go here
5i. Remove region Removes regions from all selected functions. To learn more about removing regions go here
5j. Manage tags Allows to add/remove tags to/from selected functions. To learn more about adding/removing tags go here
5k. Remove Deletes all selected functions. To learn more about removing functions go here

More actions drop-down menu, when no function is selected:

You can see all Filters available for the functions below:

No. Filter name Description
1. Search text field Filter by any string provided by the user. Searches in the Name field.
2. Type Filter by used programming language: Groovy
3. Tags Filter by assigned tags. Only tags assigned to at least one function are visible for selection.
4. Region Filter by assigned regions. Only regions assigned to at least one function are visible for selection.
5. Date range Filter by last change date in the format DD/MM/YYYY-DD/MM/YYYY.
6. Function body Filter by any string provided by the user. Searches in a body of a function.
7. Current profile only Check this box to limit the view to functions assigned to the currently selected profile. Otherwise, global functions will also be displayed.

Add Function#

If you want to add a new function, follow these steps:

  1. Choose Functions in Main toolbar.

  2. Choose + Add function in All actions bar.

    a. Choosing + Add function opens a step-by-step Function wizard.

    No. Field/Button code Description
    1a Name Allows to add function name.
    1b Cancel Interrupts the process of creating a new function. Returns the user to the functions list view.
    1c Next Proceeds to the next step of the function wizard.
  3. In step 1. Name, you need to provide unique Function code/name. Name can contain only characters from collection a-z; 0-9; “.”; “-”; “_” and it can’t start with “-”, “+”, “=” or “@”.

    a. If you change your mind and don’t want to create a new function, you can choose Cancel in step 1. Name.

  4. Click Next.

    a. If you enter illegal characters, then validation error will make field frame red.

    b. If another function already uses the name you provided, then pop-up dialog will appear. You can either close the pop-up by clicking Cancel or you can click View existing function, that will redirect you to the appropriate function and close the Function wizard.

  5. In step 2. Profile you may assign the function to a profile by selecting a profile from the drop-down list, or create a global function by checking No profile (global). Assigning the function to a profile will ensure that only users with permissions for that profile can access it. Global functions are visible regardless of profile permissions.

  1. In step 3. Definition you may add description, assign tags and select a type.

    No. Field/Button code Description
    1. Description Add or modify element description. Here you can add any additional detailed information about the new function.
    2. Change Modify tags attached to the function.
    3. Type Function’s type.
    4. Previous Go back to the previous step of the function wizard.
    5. Save function Completes the process of creating the new function.

    a. If you choose Previous you will go back to step 2. Profile

  2. Choose Save function.

    a. Function with data you provided is created. You will be redirected to Function’s details screen.

Upload Function#

If you want to upload functions from ZIP file, follow these steps:

  1. Choose Functions in Main toolbar.

  2. Choose Upload in All actions bar.

    a. Choosing Upload brings up the Upload screen.

  3. Drag&drop desired file or Click to upload a file and choose file in File explorer.

    a. If you choose a file with extension other than ZIP, then validation error will pop up to learn how the correct file looks like go here.

    b. If there is some problem with the data in the ZIP file you provided, then validation error will pop up.

  4. If the file loads correctly, it may be uploaded to the environment. File will load correctly if there is no file format problem.

    a. If validation error occurs (see above), then no function will be uploaded.

    No. Field/Button code Description
    1 Close Aborts the upload process.
    2 Delete Removes the loaded file. When clicked, you will need to provide the file to load for the upload process to be completed.
    3 Upload Uploads the loaded file to the system. The report of the upload will show.
  5. Click Upload

  6. When Upload is completed, the progress bar at 100% shows and the report is visible below.

    It allows you to check all the imported elements and if any problems during upload occurred.

Mass Export to XLSx#

If you want to download one or more functions, follow these steps:

  1. Choose Functions in Main toolbar.

  2. Select one or more function.

    a. Select the top checkbox to select all functions in the view, or select individual checkboxes to select one or multiple functions

  3. From drop-down menu More actions choose Mass export to XLSx

    a. If action Mass export to XLSx is greyed out, it means that no function has been selected.

    b. Choosing Mass export to XLSx downloads a ZIP file that contains files with functions’ body (one file per function) and XLSX file with functions’ details.

Extract Codes#

If you want to extract one or more functions, follow these steps:

  1. Choose Functions in Main toolbar.

  2. Select one or more function.

    a. Select the top checkbox to select all functions in the view, or select individual checkboxes to select one or multiple functions

  3. From drop-down menu More actions choose Extract codes

    a. If action Extract codes is greyed out, it means that no function has been selected.

    b. Selecting Extract codes downloads a XLSX file that contains Code, SHA and Region columns

Download Codes#

If you want to download one or more function codes, follow these steps:

  1. Choose Functions in Main toolbar.

  2. Select one or more function.

    a. Select the top checkbox to select all functions in the view, or select individual checkboxes to select one or multiple functions

  3. From drop-down menu More actions choose Download codes

    a. If action Download codes is greyed out, it means that no function has been selected.

    b. Selecting Download codes downloads a TXT file that contains functions’ codes (as in you can see below, one function code per one row)

Select from File#

If you want to select one or more functions from the file, follow these steps:

  1. Choose Functions in Main toolbar.

  2. From drop-down menu More actions choose Select from file

    a. Choosing Select from file brings up the Select from file screen

    No. Field / Button code Description
    1 Upload a file Drag & drop a txt file from your computer or select a txt file through File Explorer.
    2 Upload Uploads the loaded file. When clicked, the file gets uploaded and all elements provided in it are compared with elements on the environment.
    3 Select Selects (checks checkboxes) for elements on the list from the provided file.
  3. Drag&drop desired file or Click to upload a file and choose file in File explorer.

    a. Correct TXT file should look like this:

    b. If you choose a file with extension other than TXT, then validation error will pop up

  4. When the progress bar reaches 100%, you will be informed which functions will be selected.

    a. Functions present in Selected elements table will be selected in step 5. These functions exist both in the TXT file and on the environment.

    b. Functions present in Missing from table will not be selected in step 5. These functions exist only in TXT file therefore, they cannot be selected on the environment.

  5. Choose Select.

    a. All functions that were present in Selected elements table get selected (checkboxes associated with these functions are checked).

Compare with Extract#

Makes a comparison between file and the environment, gives information which element are the same, which changed and which are only in file or only in the environment.

  1. Choose Functions in Main toolbar.

  2. From drop-down menu More actions choose Compare with extract.

    a. Choosing Compare with extract brings up the Compare with extract screen.

  3. Drag&drop desired file or Click to upload a file and choose file in File explorer.

    a. Correct XLS/XLSX file should look like this:

    b. If you choose a file with extension other than XLS/XLSX, then validation error will pop up

  4. When the progress bar reaches 100%, you will be informed about the status of all functions present in the environment and the extract file you provided.

  5. In Select section (visible below table with functions’ status) choose which functions will be selected

    a. You can select multiple options

    b. Matching - functions that are equal between the environment and the extract file will be selected.

    c. Different region - functions that are equal but with different regions between the environment and the extract file will be selected.

    d. Different name - functions that are equal but with different name between the environment and the extract file will be selected.

    e. Missing from extract - functions that are present in the environment but absent from extract file will be selected.

  6. Choose Select button.

    a. If Select button is greyed out, it means that no checkboxes were selected in step 5.

    b. All functions that match the criteria provided in step 5 are selected.

Assign Profile#

If you want to assign a profile to one or more functions, follow these steps:

  1. Select Functions from the Main toolbar.

  2. Select the functions without an assigned profile by checking the boxes on the left side of the list.

  3. From the More Actions drop-down menu, choose Assign Profile.

    a. Selecting Assign Profile opens the Assign Profile screen.

  4. Select the profile to which you want to assign the function and confirm by clicking Change.

On the functions list view, a profile entry will appear for the assigned functions. The view will also be updated to reflect the selected profile.

Make Global#

If you want to detach one or more functions from a profile, follow these steps:

  1. Select Functions from the Main toolbar.

  2. Select the functions with an assigned profile by checking the boxes on the left side of the list.

  3. From the More Actions drop-down menu, choose Make Global.

    a. A confirmation pop-up will appear.

  1. Click Confirm.

On the functions list view, the profile entry will disappear for the selected functions. The view will also be updated to global.

Add Region#

To attach a function to a region, function must first be assigned to a profile. A region belongs to a profile.

If you want to add a region to one or more functions, follow these steps:

  1. Choose Functions in Main toolbar.

  2. Select one or more functions without a Region.

    a. Select the top checkbox to select all functions in the view, or select individual checkboxes to select one or multiple functions.

  3. From drop-down menu More actions choose Add region.

    a. If action Add region is greyed out, it means that no function has been selected.

    b. Choosing Add region brings up the Manage versioning screen.

  4. Select Region and one or more Version.

  5. Choose Change.

    a. Region is being assigned to all functions selected in Step 2.

    b. If at least one function you selected in Step 2 had assigned Region, then validation error appears and assigning Region process will be aborted.

Remove Region#

If you want to remove region from one or more functions, follow these steps:

  1. Choose Functions in Main toolbar.

  2. Select one or more functions with a Region.

    a. Select the top checkbox to select all functions in the view, or select individual checkboxes to select one or multiple functions.

  3. From drop-down menu More actions choose Remove region.

    a. If action Remove region is greyed out, it means that no function has been selected.

    b. After choosing Remove region action, confirmation pop-up will appear.

  4. Choose Confirm.

    d. Regions are being removed from all selected functions.

Manage Tags#

If you want to manage tags for one or more functions, follow these steps:

  1. Select the Functions on the Main toolbar.

  2. Select one or more functions.

  3. From the More Actions drop-down menu, select Manage Tags.

  4. Select the tags you are interested in and click Save.

Remove Function#

If you want to delete one or more functions, follow the steps below:

  1. Choose Functions in Main toolbar.

  2. Select one or more functions.

    a. Select the top checkbox to select all functions in the view, or select individual checkboxes to select one or multiple functions.

  3. From the drop-down menu More actions choose Remove

    a. If action Remove is greyed out, it means that no function has been selected.

    b. After choosing Remove action, confirmation pop-up will appear.

  4. Choose Confirm.

    a. All functions are deleted from the environment.

Function Details Screen#

You can access Function details by left-clicking on the specific function in the List of all functions. Function details screen contains all information about the function, its Description, assigned Region/Tags, function body and function arguments.

Firstly, function basic info:

No. Field/Button code Description
1. Add to favorites Adds the element to favorites.
2. Function code/name Current function name/code.
3. Copy name Copies the function name to clipboard.
4. Language Groovy. Defines the programming language in which the function is validated and performed.
5. Profile Profile the function is assigned to.
6. Region Carries information about region and version attached to the function.

You can see Available actions for the function below:

No. Action Description
1. Edit Enables function edit mode. To learn more about editing function go here.
2. Duplicate Allows to duplicate function. Duplicated function has all data the same as the original function.
3. Download function Downloads a ZIP file that contains XLSX file and file with function body.
4. More actions Drop-down list that contains actions 4a-4g.
4a. Show history Opens a new screen with a table of all modifications made on the function. To learn more about function history go here.
4b. Rename Allows changing function code/name. To learn more about renaming function go here.
4c. Assign profile Assigns the function to a profile. Assigning the function to a profile will ensure that only users with permissions for that profile can access it.
4d. Make global Makes the function global. Global functions are visible regardless of profile permissions.
4e. Detach/Attach Allows managing region and versions attached to the function.
4f. Find usages Redirects you to Find usages search where you may find every reference to that function.
4g. Remove Deletes function. To learn more about removing function go here.

The main part of the function view includes the most important information about the function that makes it work:

No. Action Description
1. Description Contains the Description of the function if such was added.
2. Tags Contains the tags attached to function.
3. Argument name Argument name defined separately for each argument. Must be unique within the function.
4. Argument type Argument type selected from the available types list, defined separately for each argument.
5. Argument class Argument class name defined separately for each argument.

Edit Function#

If you want to edit data in a specific function, follow these steps:

  1. Choose Functions in Main toolbar.

  2. Left-click on the function you wish to edit.

    a. Left-clicking on function opens Function details screen.

  3. Choose Edit in Available actions.

    a. Highlighted borders indicate that edit mode is active.

  4. Edit any data you need.

    No. Action Description
    1 Description Contains the Description of the function if such was added.
    2 Change Allows to manage tags.
    3 Add argument Adds a new argument for which name, type, and class name will have to be provided.
    4 Function body Here you can write a code to create your algorithm. You can define variables and use arguments defined in the Argument section.
    5 Cancel Rejects all changes made in the edit mode.
    6 Save changes Saves all changes made in the edit mode.

    a. Bear in mind that function’s name can only be changed with Rename action.

  5. Choose Save changes to save all changes made in the function.

    a. Cancel reverts all changes made in the function.

Duplicate Function#

If you want to duplicate specific function, follow these steps:

  1. Choose Functions in Main toolbar.

  2. Left-click on the function you wish to duplicate.

    a. Left-clicking on function opens Function details screen.

  3. Choose Duplicate in Available actions.

    a. Choosing Duplicate brings up the Duplicate function screen.

    No. Action Description
    1 Name Provide the name for the duplicated function.
    2 Cancel Abort the process of duplicating the function.
    3 Save changes Save the new, duplicated, element.
    4 Close Abort the process of duplicating the function.
  4. Enter unique function name. Name can contain only characters from collection a-z; 0-9; “.”; “-”; “_” and it can’t start with “-”.

  5. Choose Save changes.

    a. If you enter illegal characters, then validation error will make the field frame red.

    b. If another function already uses the name you provided, then pop-up dialog will appear. You can either close the pop-up by clicking Cancel or you can click View existing function, that will redirect you to the appropriate function.

  6. Choose Save changes.

    a. The Function will be duplicated with the name provided in step 4. You will be redirected to duplicated Function’s details screen.

Show History#

If you want to check all modifications made on function, follow these steps:

  1. Choose Functions in Main toolbar.

  2. Left-click on the function you want to check.

    a. Left-clicking on function opens Function details screen.

  3. From drop-down menu More actions choose Show history.

    a. Choosing Show history brings up the Function history screen.

    No. Column name Description
    1. Operation Type of operation made on function.
    2. Message Brief information about the details of the operation.
    3. Author User’s login that made an operation.
    4. Modification Date Date of the published session that made an operation.
    5. Region Region and version assigned to function at the time of modification.
    6. Actions View redirects to archived version of Function. In this screen you can choose Restore to restore that version of Function.

Rename#

If you want to rename a function, follow these steps:

  1. Choose Functions in Main toolbar.

  2. Left-click on the function you wish to duplicate.

    a. Left-clicking on function opens Function details screen.

  3. From drop-down menu More actions choose Rename.

    a. The Highlighted border around the function name indicates that it is editable.

  4. Enter unique function name. Name can contain only characters from collection a-z; 0-9; “.”; “-”; “_” and it can’t start with “-”.

  5. Choose Save name.

    a. If you enter illegal characters, then validation error will appear.

Find Usages#

If you want to check where the function is used, follow these steps:

  1. Choose Functions in Main toolbar.

  2. Left-click on the function you want to check.

    a. Left-clicking on function opens Function details screen.

  3. From drop-down menu More actions choose Find usages.

    a. Choosing Find usages brings up the Find usages screen. The screen displays a list of objects in which the function has been used

    No. Column name Description
    1. Element type Type of element that uses this function.
    2. Element name Name of the element that uses this function.
    3. Field Value of the element that uses this function. This column is filled only for Attribute value element, for other elements this column is empty.
    4. Value Informs the user in what value the searched element was used.

Remove (Details View)#

If you want to delete specific function from Function details level, follow these steps:

  1. Choose Functions in Main toolbar.

  2. Left-click on the function you wish to remove.

    a. Left-clicking on function opens Function details screen.

  3. From drop-down menu More actions choose Remove.

    a. After choosing Remove action, confirmation pop-up will appear.

  4. Choose Confirm.

    a. The Function is deleted from the environment.