9.6.1 Analysis 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, and then select  APL Code  from the menu.

The APL Code Editor
 

Hint!

When double-clicking the dotted triangle in the lower right corner of the Configuration dialog, the code area will be maximized. This is a useful feature when coding.

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;

APL Code Editor Menu

The main menu changes depending on which Configuration type that has been opened in the currently active tab. There is a set of standard menu items that are visible for all Configurations and these are described in 2.1 Menus and Buttons.

The menu items that are specific to APL Code Editor are described in the following sections:

The File Menu

Item

Description

Import...

Select this option to import code from an external file. Note that the file has to reside on the host where the client is running.

Export...

Select this option to export your code to an *.apl file that can be edited in other code editors, or be used by other  systems.

The Edit Menu

Item

Description

Validate

Compiles the current APL code. The status of the compilation is displayed in a dialog. Upon failure, the erroneous line is highlighted and a message, including the line number, is displayed.

Undo

Select this option to undo your last action.

Redo

Select this option to redo the last action you "undid" with the Undo option.

Cut

Cuts selections to the clipboard buffer.

Copy

Copies selections to the clipboard buffer.

Paste

Pastes the clipboard contents.

Find...

Displays a dialog where chosen text may be searched for and, optionally, replaced.

Find Again

Repeats the search for the last string entered in the Find dialog.

APL Code Editor Buttons

The toolbar changes depending on which Configuration type is currently open in the active tab. There is a set of standard buttons that are visible for all Configurations and these buttons are described in 2.1 Menus and Buttons.

The additional buttons that are specific to APL Code Editor tabs are described in the following sections:

Button

Description

Validate

Compiles the current APL code. The status of the compilation is displayed in a dialog. Upon failure, the erroneous line is highlighted and a message, including the line number, is displayed.

Undo

Select this option to undo your last action.

Redo

Select this option to redo the last action you "undid" with the Undo option.

Cut

Cuts selections to the clipboard buffer.

Copy

Copies selections to the clipboard buffer.

Paste

Pastes the clipboard contents.

Find...

Displays a dialog where chosen text may be searched for and, optionally, replaced.

Find Again

Repeats the search for the last string entered in the Find dialog.

Zoom Out

Zoom out the APL Code Area by modifying the zoom percentage number that you find on the toolbar. The default value is 100(%). Clicking the button between the Zoom Out and Zoom In buttons will reset the zoom level to the default value. Changing the view scale does not affect the configuration.

Zoom In

Zoom in the APL Code Area by modifying the zoom percentage number that you find on the toolbar. The default value is 100(%). Clicking the button between the Zoom Out and Zoom In buttons will reset the zoom level to the default value. Changing the view scale does not affect the configuration.

APL Code Editor Outline

In order to make it easier to navigate in an APL code configuration, there is an Outline navigation panel to the right of the APL Code Editor.

The APL Code Editor Outline provides a view of all the blocks, variables, and methods in an APL code configuration and makes it possible to easily navigate between different types in the APL code. The entries in the navigation panel are automatically updated as you make valid entries in the APL Editor.

You can also filter what you want to display in the Outline navigation panel. You can search for a specific block, variable or method using the free text field, or by selecting one of the quick filter buttons for different types:

b

Click to display or hide the blocks within the APL code configuration displayed in the APL Code Editor.

v

Click to display or hide the variables within the APL code configuration displayed in the APL Code Editor.

m

Click to display or hide the methods within the APL code configuration displayed in the APL Code Editor.

The Outline navigation panel can be hidden or visible. By default, it is visible and all the elements are displayed. To hide or display the navigation panel, click the vertical Outline button to the right of the APL Code Editor.

APL Code Editor Outline navigation panel

Configuration Diff Panel

Note!

The Configuration Diff panel is not available for the Analysis agent.

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 hide or display the Configuration Diff panel, click the vertical Diff button to the right of the APL Code Editor. The panel can be hidden or visible. By default, it is hidden.

APL Code Editor - Configuration Diff panel

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.

ItemDescription
History

Click the History drop box to select the version to which you want to compare the version currently displayed.

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.