Mainframe Automation in UiPath

Mainframe computers or mainframes are computers used primarily by large organizations for critical applications Like:

  • Bulk data processing, such as census,
  • Industry and consumer statistics,
  • Enterprise resource planning;
  • Transaction processing.
  • They are larger and have more processing power than some other classes of computers: minicomputers, servers, workstations, and personal computers.

Modern mainframe design is characterized less by raw computational speed and more by :

  • Redundant internal engineering resulting in high reliability and security
  • Extensive input-output ("I/O") facilities with the ability to offload to separate engines
  • Strict backward compatibility with older software
  • Top hardware and computational utilization rates through virtualization to support massive throughput.
  • Hot-swapping of hardware, such as processors and memory.
  • When interactive user terminals were introduced, they were used almost exclusively for applications (e.g., airline booking) rather than program development.
  • By the early 1970s, many mainframes acquired interactive user terminals operating as timesharing computers, supporting hundreds of users simultaneously along with batch processing.
  • Users gained access through keyboard/typewriter terminals and specialized text terminal CRT displays with integral keyboards, or later from personal computers equipped with terminal emulation software.
  • By the 1980s, many mainframes supported graphic display terminals, and terminal emulation, but not graphical user interfaces.
  • After 2000, modern mainframes partially or entirely phased out classic "green screen" and color display terminal access for end-users in favor of Web-style user interfaces.
Computer Terminals:

A computer terminal is an electronic or electromechanical hardware device that is used for entering data into, and displaying or printing data from, a computer or a computing system.

The Teletype was an example of an early day hardcopy terminal and predated the use of a computer screen by decades.

The acronym CRT(cathode-ray tube), which once referred to a computer terminal, has come to see a type of screen of a personal computer.

Early terminals were inexpensive devices but very slow compared to punched cards or paper tape for input. Still, as the technology improved and video displays were introduced, terminals pushed these older forms of interaction from the industry.

A related development was timesharing systems, which evolved in parallel and made up for any inefficiencies of the user's typing ability with the ability to support multiple users on the same machine, each at their own terminal.

The function of a terminal is confined to display and input of data; a device with significant local programmable data processing capability may be called a smart terminal or fat client.

A terminal that depends on the host computer for its processing power is called a Dumb Terminal or a thin client.

A personal computer can run terminal emulator software that replicates the function of a terminal, sometimes allowing concurrent use of local programs and access to a distant terminal host system.

Mainframe Automation in UiPath

Automating Mainframes using Terminal Emulators in UiPath

Create a new process called Mainframe_Automation_Example
main-frame-automation-process-rpa-uipath

Go to the Manage packages and then search for Terminal under the Official box, you will find UiPath.Terminal.Activities so click on this activity and then click on the Install button.

terminal-activity-rpa-uipath

Once the package as installed successfully, then click on the save button and I Agree button. To use terminal activities, the Nuget package, UiPath.Terminal.Activities need to be installed. Once installed, the activities can be found under App Integration -> Terminals.

teminal-activities-rpa-uipath

UiPath Terminal wizard is designed to help you automate data extraction and 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 based on the accuracy and the level of the provided details (like colors, field information, etc.)

Select the Terminal Session activity and then drag and drop inside the designer pane. Once you click on the Configure Connection, Then the Configuration Connection wizard will be displayed.
terminal-session-rpa-uipath
configure-connection-wizard-rpa-uiapth

  • The Provider 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.
  • Show client application flag specifies if the 3rd party provider window is displayed during recording/play.
  • Using an Existing Profile : Browse to a profile file containing the connection information, specific to the selected provider. For example, for Attachmate Reflection, one may choose an rd5x/rd3x file, corresponding to a TN5250/TN3270 profile file. The same applies to other providers.

Enter the connection parameters manually :

  • Address : the server address
  • Port : the port to use for the connection
  • Type : the terminal type: TN3270, TN5250 or VT
  • Attach to an Existing Session: This method is available only when using the IBM EHLL standard, and it is described in the EHLL section.
  • Recording Wizard : After specifying connection parameters, the UiPath Terminal Wizard is automatically started.

Screen Organization :

  • The terminal screen is organized in fields, highlighted in orange color. The properties of the selected field are displayed in 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 locate 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.

Field Properties pane :

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

Recorded Action Pane :

  • This pane contains a list of recorded actions (auto-generated activities).

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 command : 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)
Terminal Activities

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; the recommended value is READY

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.

The Properties of Terminal Session Activities are :

  • ConnectionString : contains the connection parameters, automatically generated from the connection dialog.
  • OutputConnection : optional, one may specify an output variable (of type TerminalConnection) 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.

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.
  • Sends a special key to the terminal, like (Enter), F1-F24 functional keys, etc. Usually, following a control key like the screen changes.

Properties:

  • Key: The control key to send to the terminal (selected from the provided combo box)

Wait for Field Text activity :

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

Properties :

  • LabeledBy : The label before the selected field.
  • Followed by : The label following the selected field.
  • Index : 1 or greater, depending on if there are multiple fields with the 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.

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.

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.

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 to ensure a successful workflow run.

Move Cursor activity :

  • Moves the cursor position to the specified location. In the sample below, the cursor will be run 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.

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.

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.

Get Field at Position activity :

  • Similar to Getting Field activity, it 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 document is saved.

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; it is not supplied, the text until the end of the screen is returned.
  • Text : a string variable where the resulting text is saved.

Wait for 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
Supported Providers:

Attachmate Reflection :

  • Prerequisites : Attachmate reflection installed (https://www.attachmate.com/products/reflection/2014/)
  • Usage : When using profile mode, the profile file must be located in the Attachmate Reflection profile folder. Default is C:UsersDocumentsAttachmateReflection

Rocket BlueZone :

  • Prerequisites: Rocket BlueZone (5.2+) Terminal Emulation installed (http://www.rocketsoftware.com/products/rocket-bluezone-terminal-emulation )
  • Usage: No custom requirements

IBM Personal Communications :

  • Prerequisites : IBM Personal Communications (http://www-03.ibm.com/software/products/en/pcomm )
  • Usage : Only profile mode supported. The profile file must be located in the IBM Personal Communications profile folder. Default is C:UsersAppDataRoamingIBMPersonal Communications

Using IBM EHLL standard :

  • One may choose to connect to a terminal using the IBM EHLL standard.
  • This is an advanced type of connection, and specific information regarding EHLL implementation needs 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.
  • Prerequisites: An emulator that implements the EHLLAPI standard.
  • Usage: The terminal emulator window should be opened before the connection (see the Application Specificschapter below)
  • In the 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.
Application specifics :
  • IBM implementation: The EHLLAPI implementation dll is pcshll32.dll; default, it is located in C:Program Files (x86)IBMPersonal Communications
  • Attachmate Extra: The EHLLAPI implementation .dll is pcshll32.dll; default, it is located in C:Program Files (x86)AttachmateEXTRA!
Requirements/limitations:
  • In Attachmate Extra application, one must associate a session short name letter with a profile file (Options -> Global Preferences -> Advanced -> HLLAPI short name); this letter will be used in a terminal session connection dialog (UiPath Studio)
  • The session must NOT be started when connecting from UiPath Studio.
Micro Focus Rumba:
  • The EHLLAPI implementation dll is ehlapi32.dll, default, and it is located in C:Program Files (x86)Micro FocusRUMBASystem. 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, I must check the classic HLLAPI data structure (Options -> API… -> Configuration -> Classic HLLAPI data structure).
Using UiPath implementation:
  • This is a custom implementation, and it requires the address of the server and the terminal type.