UiPath - Knowledge Base

Automating Terminals and Mainframes

Written by Robert Dima | Mar 29, 2016 11:49:22 AM
1. Introduction

In order to use terminal activities, the Nuget package “UiPath.Terminal.Activities” needs to be installed. Once installed, the activities can be found under “App Integration -> Terminals” as in the following picture:

2. Terminal wizard

UiPath Terminal wizard is designed to help you automate data extraction and/or task execution on various terminals (Mainframe/AS400/VT). It works with TN3270/TN5250/VT terminals.

There are several ways to automate the mentioned terminals:

  • using the existing/installed terminal application
  • using the IBM EHLLL standard
  • using the UiPath internal implementation of these protocols

One may choose between those three based on the accuracy and the level of the provided details (like colors, field information, etc).

  2.1. Setting up a terminal session

The first step for creating a terminal session is by dragging the “Terminal Session” activity into the workflow. Then the connection configuration dialog is displayed.

The “Provider” combo box specifies which provider to use. Based on this selection, the “Connection type” section changes accordingly, depending on what connection types are available for the specific provider. A more detailed description on each provider can be found in section Supported providers.

“Show client application” flag specifies if the 3rd party provider window is displayed during recording/play.

2.1.1. Use an existing profile

Browse to a profile file containing the connection information, specific to selected provider. For example, for Attachmate Reflection, one may choose a rd5x/rd3x file, corresponding to a TN5250/TN3270 profile file. The same applies to other providers.

2.1.2. Manually specify address

Enter manually the connection parameters:

  • Address : the server address
  • Port: the port to use for connection
  • Type: the terminal type: TN3270, TN5250 or VT
2.1.3. Attach to an existing session

This method is available only when using IBM EHLL standard and it is described in EHLL section.

2.2. Recording wizard

After specifying connection parameters the UiPath Terminal Wizard is automatically started.

2.2.1. Screen organization

The terminal screen is organized in fields, highlighted in orange color. The properties of the selected field are displayed the Field Properties pane.

There are two methods by which UiPath identifies a field on the screen: by coordinates or by visual elements.

Field identification by coordinates is straightforward, as it uses the row/column coordinates to located the field. The more reliable way is using LabeledBy/FollowedBy/Index properties. This is useful in case a screen changes a bit and the coordinates are not valid anymore, however, the text before/after a field is usually the same.

In the above picture, the selected field is “PUB1” and it is labeled by “System name:”. Index property is used when there are multiple fields with the same LabeledBy/FollowedBy property, like in a table.

2.2.2. Field Properties pane

The properties of the selected field are displayed the Field Properties pane. It includesthe coordinates (row/column), LabeledBy/FollowedBy/Index properties, the text value and a flag indicating if the field is editable or not.

2.2.3. Recorded Actions pane

This pane containsthe list of recorded actions (auto generated activities).

2.2.4. Available commands

  • Save & Exit: stops the terminal connection and saves the recorded actions
  • Stop/Start (recording): temporarily stops recording, in case some actions do not need to be recorded
  • Actions commands: each of these are commands generates a specific terminal activity; they are described in a Terminal activities section
  • Refresh: used to perform a full refresh of the terminal screen (used only for testing/validation)
3. Terminal activities
3.1. Common properties
  • DelayMS: represents the time to wait after the activity executed; value is in milliseconds
  • TimeoutMS: specifies the time to wait for the activity to execute; value is in milliseconds
  • WaitType: allows specifying if the terminal should be in a ready state when executing the activity; recommended value is “READY”
3.2. Terminal Session activity

It is the main terminal activity and represents a connection to a terminal server. It acts as a container for all other terminal activities. By default, after activity execution, the terminal connection is closed.

Properties:

  • ConnectionString: contains the connection parameters; automatically generated from the connection dialog
  • OutputConnection: optional, one may specify an output variable (of type TerminalConnection) in order to be used later in other terminal sessions
  • CloseConnection: used with ExistingConnection property; specifies if the connection is closed after executing the Terminal Session activity
  • ExistingConnection: a variable of type TerminalConnection that was previously initialized

When using many terminal sessions, it is recommended to reuse the terminal connection by saving it into a variable and use it in the next sessions. This is to avoid connecting and disconnecting multiple times, as this process is more time consuming.

3.3. Set Field activity

Set the text value of the selected field to a given value. The field must be editable, otherwise the activity is disabled.

In the sample above, the selected field identified by label “Username/Benutzer” is set to the provided value “test”.

Properties:

  • LabeledBy: the label before the selected field
  • FollowedBy: the label following the selected field
  • Index: 1 or greater, depending if there are multiple fields with same labels
  • Text: a string expression used for setting the field value
3.4. Get Field activity

Obtains the text value of the selected field.

In the sample above, the text from selected field identified by label “devicename:” is returned.

Properties:

  • LabeledBy: the label before the selected field
  • FollowedBy: the label following the selected field
  • Index: 1 or greater, depending if there are multiple fields with same labels
  • Text: a string variable where the resulting text is saved
3.5. Get Text activity

Obtains the text value of the entire screen.

Properties:

  • Text: a string variable where the resulting text is saved
3.6. Send Control Key activity

Sends a special key to the terminal, like (Enter), F1-F24 functional keys, etc. Usually, following a control key like , the screen changes. In the sample below it changes to the information screen following the login screen.

Properties:

  • Key: the control key to send to the terminal (selected from the provided combo box)
3.7. Wait Field Text activity

Waits the specified amount of time (TimeoutMS, in milliseconds) until the selected field contains the provided text.

In the sample above, the workflow execution waits until the field identified by label “Username/Benutzer:” contains the text “test”.

Properties:

  • LabeledBy: the label before the selected field
  • FollowedBy: the label following the selected field
  • Index: 1 or greater, depending if there are multiple fields with same labels
  • Text: a string expression containing the value to wait for; it supports wildcards
  • MatchCase: a flag indicating if the text matching should be case sensitive
3.8. Wait Screen Text activity

Waits the specified amount of time (TimeoutMS, in milliseconds) until the screen contains the provided text. It is very similar to Wait Field Text activity, except it searches the entire screen instead of being limited to a specific field.

In the sample above, the workflow execution waits until the text “code400” is found on the screen.

Properties:

  • Text: a string expression containing the value to wait for; it supports wildcards
  • MatchCase: a flag indicating if the text matching should be case sensitive
3.9. Advanced activities

Advanced activities are terminal activities that work based on coordinates and cursor location. They should be used only when the field’s positions do not change, in order to ensure a successful workflow run.

3.9.1. Move Cursor activity

Moves the cursor position to the specified location. In the sample below, the cursor will be moved at the beginning of the selected field.

Properties:

  • Row: 1-based index of the row where the cursor will be moved
  • Column: 1-based index of the column where the cursor will be moved
3.9.2. Send Keys activity

Sends the specified text to the terminal cursor position. One must ensure that the cursor position is inside an editable field by using Move Cursor activity.

Properties:

  • Text: a string expression that will be sent to the terminal
3.9.3. Set Field at Position activity

Similar to Set Field activity, uses coordinates to identify the field.

Properties:

  • Row: 1-based index of the row where the cursor will be moved
  • Column: 1-based index of the column where the cursor will be moved
  • Text: a string expression used for setting the field value
3.9.4. Get Field at Position activity

Similar to Get Field activity, uses coordinates to identify the field.

Properties:

  • Row: 1-based index of the row where the cursor will be moved
  • Column: 1-based index of the column where the cursor will be moved
  • Text: a string variable where the resulting text is saved
3.9.5. Get Text at Position activity

Obtains the text of length from the specified position. It is not limited to a single field.

Properties:

  • Row: 1-based index of the row where the cursor will be moved
  • Column: 1-based index of the column where the cursor will be moved
  • Length: the number of characters to return; if is not supplied, the text until the end of the screen is returned
  • Text: a string variable where the resulting text is saved
3.9.6. Wait Text at Position activity

Similar to Wait Field Text activity, uses coordinates to identify the field.

Properties:

  • Row: 1-based index of the row where the cursor will be moved
  • Column: 1-based index of the column where the cursor will be moved
  • Text: a string expression containing the value to wait for; it supports wildcards
  • MatchCase: a flag indicating if the text matching should be case sensitive
4. Supported providers
4.1. Attachmate Reflection
4.1.1. Prerequisites

Attachmate reflection installed (https://www.attachmate.com/products/reflection/2014/)

4.1.2. Usage

When using profile mode, the profile file must be located in the Attachmate Reflection profile folder. Default is ‘C:\Users\\Documents\Attachmate\Reflection’

4.2. Rocket BlueZone
4.2.1. Prerequisites

Rocket BlueZone (5.2+) Terminal Emulation installed (https://www.rocketsoftware.com/products/rocket-bluezone-terminal-emulation )

4.2.2. Usage

No custom requirements

4.3. IBM Personal Communications

4.3.1. Prerequisites

IBM Personal Communications (https://www-03.ibm.com/software/products/en/pcomm )

4.3.2. Usage

Only profile mode supported. The profile file must be located in the IBM Personal Communications profile folder. Default is ‘C:\Users\\AppData\Roaming\IBM\Personal Communications’

4.4. Using IBM EHLL standard

One may choose to connect to a terminal using IBM EHLL standard. This is an advanced type of connection and specific information regarding EHLL implementation need to be provided. Depending on the EHLL implementation, some features could not be available (like field color).

One can only attach to an existing terminal session using this method.

4.4.1. Prerequisites

An emulator that implements the EHLLAPI standard

4.4.2. Usage

The terminal emulator window should be opened before the connection (see the Application Specifics chapter below)

  • In connection dialog the path to the DLL implementing the EHLLAPI standard must be specified
  • The EHLL function should be changed accordingly (usually is ‘hllapi’)
  • The session name should be the session short name of the previously opened connection
  • The Show client application has no effect
4.4.3. Application specifics
4.4.3.1. IBM implementation

The EHLLAPI implementation dll is ‘pcshll32.dll’; default, it is located in ‘C:\Program Files (x86)\IBM\Personal Communications’.

4.4.3.2. Attachmate Extra

The EHLLAPI implementation .dll is pcshll32.dll; default, it is located in C:\Program Files (x86)\Attachmate\EXTRA!.

Requirements/limitations:

  • In Attachmate Extra application, one must associate a session short name letter with a profile file (Options -> Global Preferences -> Advanced -> HLLAPI shortname); this letter will be used in terminal session connection dialog (UiPath Studio)
  • The session must NOT be started when connecting from UiPath Studio
4.4.3.3. Micro Focus Rumba

The EHLLAPI implementation dll is ehlapi32.dll’; default, it is located in ‘C:\Program Files (x86)\Micro Focus\RUMBA\System’. The Ehll Enhanced checkbox should be unchecked.

Requirements/limitations:

  • In Micro Focus Rumba Desktop application one must associate a session short name letter (Options -> API… -> Identification ->Session Short Name). Also, must check the classic HLLAPI data structure (Options -> API… -> Configuration -> Classic HLLAPI data structure).
4.5. Using UiPath implementation

This is a custom implementation and it requires the address of the server and the terminal type.