APL Code Editor

APL Code Editor

The APL Code Editor, as opposed to the Aggregation and Analysis agents' code areas, is used to create generic APL code, that is, code that can be imported and used by several agents and workflows.

To open the APL Code Editor, click the  New Configuration button in the upper left part of the Desktop window, and then select APL Code from the menu.

apl_code_editor.png
APL Code editor

The buttons available in the APL Code Editor are described in the following table: 

Button

Description

Button

Description

Edit

Edits the entered APL code.

New

Creates a new APL code entry.

Open

Opens the list of saved APL code entries.

Save As

Opens the Save As dialog box where you can save the APL code entry. You must enter the mandatory parameters to save the entry. Specify the Folder by using the Browse button and navigating to the destination, then confirm the selection by pressing the OK button. Specify the APL code name in the Name field and you can type an optional Version Comment, as well as Encrypt Configuration.

image-20241218-124723.png
Save As dialog

Permissions

View/edit the APL code permissions.

Permissions dialog

References

View the External References available for the APL code entry.

History 

View the version history for the APL code entry.

Configuration Diff

Compare any difference with versions of APL configuration.

See Config Diff for more information.

The generic code is imported by adding the following code in the agent code area, using the import keyword:

import apl.<foldername>.<APL Code configurationname>

If generic code is modified in the APL Code Editor, the change is automatically reflected in all agents that contain this code the next time each workflow is executed.

Since function overloading is not supported, make sure not to import functions with equal names, since this causes the APL code to become invalid, even if the functions are located in different APL modules. This also applies if the functions have different input parameters, for example, a(int x) and a(string x).

Note!

Not all functions work in a generic environment, for example, functions related to specific workflows or MIM-related functions. This type of functionality must be included in the agent code area instead.

Example - An APL code definition

An APL code definition, saved as MyGenericCode in the Default directory, is available to an agent by adding the following into its code area:

import apl.Default.MyGenericCode;

Config Diff

If you want to compare the current version of an APL configuration that you are displaying with a previous version of the same configuration, you can use Configuration Diff to compare the two versions side by side.

To view the Configuration Diff pop-up, click the Configuration Diff menu button of the APL Code Editor.

You can navigate through the differences by scrolling both panes in parallel using the scroll bar to the right of either pane. If you want to scroll through each pane separately, hover over the pane that you want to scroll through, and use the scroll wheel on your mouse.

If you want to skip through each difference in the panes, you can use the navigation buttons: Previous, Next and Refresh, which are described below.

Drop-downs and Buttons

Description

Drop-downs and Buttons

Description

History

To select a different version of the same configuration, use the drop-down box to select the version you want to display.

History.png

You can also display and view encrypted configurations. If you select an encrypted configuration, you are prompted to enter the relevant password to decrypt the configuration.

Previous

Click this button to skip to the previous difference in the configurations. The previous difference is highlighted in green.

Next

Click this button to skip to the next difference in the configurations. The next difference is highlighted in green.

Refresh

Click this button to display the updated version of the configuration. Configurations are not locked when you display them in Configuration Diff. If another user has modified and saved a configuration that you are viewing in this tool, you can click this button to view the latest updated version.