Previous Topic: Multi-Tenant Processes Using Process WatchNext Topic: Operators and Icons


The CA Process Automation Code Editor

The advanced Code Editor in CA Process Automation lets you easily create, edit, and debug code for various scripting languages in the following places:

The Code Editor supports the following languages:

Some additional operators contain text editors that use the Code Editor functionality, when applicable. When the specific language used within the operator is supported by the Code Editor and CA Process Automation, their text editors automatically adapt to the specified language. Specifically, their text editors highlight language-specific keywords. However, if the operators use a language that is not supported by the Code Editor or not implemented by CA Process Automation, a plain-text editor is available for coding.

If a process is checked in, the Code Editor starts in read-only mode and the editor and toolbar are disabled. However, some toolbar buttons (for example, Search, Help, and Script validation) are still available.

The Code Editor includes the following features:

Drag and Drop

Drag any file or selected text (from inside or outside of CA Process Automation) and drop it into the editor to populate the editor.

Search/Replace

Locate specific code (with Case Sensitive and Regular Expressions options), then replace specific instances or all occurrences.

Undo

Reverse your previous action.

Redo

Reverse your previous Undo action.

Jump to line number

Advance to a specified line of code.

Reformat selection

Adjust indentation of the selected text.

Reformat whole document

Adjust indentation of the entire code document.

Import from file

Browse to locate a specific file to import into the editor.

Supported editor modes for imported files include:

CA Process Automation provides an error if any other file extensions are imported in the advanced Code Editor.

Note: Any file type can be imported for the generic editor.

Export to file

Save the file to your CA Process Automation downloads.

Show Error Log

Display errors in your code. This feature is only available in the following cases:

The editor highlights incorrect code in a scrollable error log at the bottom of the editor. Each error contains the line number and a hyperlink to navigate to the specific line of code. When you fix the error, the editor automatically clears it from the error log.

Note: The code should be entered properly, in valid expressions. However, you can save code even if it contains errors, although CA Process Automation issues a warning. Some validations (such as the following examples) are skipped:

"strict"

Expects ‘Use Strict’ in the JavaScript function declaration.

"eqeqeq"

Expects ‘===’ instead of ‘==’ in the condition.

"smarttabs"

Validates a mix of tabs and spaces.

Code folding

When you click the line number of any "{", the Code Editor folds the code up to its matching bracket "}".

When editing XML, code folding is based on the matching tags. You can expand or collapse the XML fragment based on the matching tags. The Code Editor automatically closes the ending tags for you while editing.

The Code Editor also uses the following conventions:

Color Coding

The Code Editor uses the following colors to display JavaScript:

Orange

Indicates:

Example: Illustration of the word "Datasets" in orange text.

Blue

Indicates CA Process Automation system functions. Client-side and server-side JavaScript have different sets of system functions.

Example: Illustration of the function "adjustResourceVals" in blue text.

Purple

Indicates JavaScript keywords.

Example: Illustration of the word "Comment" in purple text.

Shortcuts

The Code Editor uses the following shortcuts:

The following shortcuts are only valid for JavaScript: