Set up Actions for Reflection Events
Using the Events Mapper, you can configure Reflection to initiate Reflection actions, such as Reflection macros, and menu and terminal commands when an event is encountered during a host session. This makes it possible to monitor Reflection/host interactions and synchronize Reflection commands with a defined group of host session events.
You can associate events with a Reflection command, Reflection macro, terminal keystroke, or any combination of these. There are 17 events you can select with which to associate actions. Each event can execute once per session, or every time the event occurs. Events can also be defined so that they execute one after another, in the order shown in the Events list in the Events Mapper dialog box.
To use the Events Mapper to assign actions to events, see Using the Events Mapper.
Using the Events Mapper
You can use the Events Mapper on any of the alternate Reflection interfaces. Use the Events Mapper to assign actions to events, determine whether the events should be canceled or removed after the first time they are handled, and order the events.
To set up actions for events
Open the Events Mapper as follows. The steps depend on your user interface mode.
User Interface Mode Steps Ribbon On the Tools tab, click Events Mapper. TouchUx Tap the Wrench icon and then select Events Mapper. Reflection Browser On the Reflection menu, choose Tools and then Events Mapper. Classic On the View menu, select Events Mapper.
To add an event, click New and then follow the instructions in the Event Editor wizard to select the type of event, specify the parameters for the event (if required), add an action for the event, and determine whether to disable it after it runs the first time. When you are through, name the event you created.
The event is displayed in the Events Mapper Events list. Note that the checkbox next to the event is selected. This indicates that the action associated with the event will be performed the next time the event is handled. If you have selected to disable the "event state after the action is complete", this checkbox will be automatically unselected after the event runs.
To insert a copy of an event, select the event in the Events list and then click Duplicate.
Before you save the session document file, be sure to select the checkboxes next to the events in the Events list (if you want them to run the next time you open the session).
Cursor related events occur when the cursor enters or leaves a field or screen position. You can set up these events to execute at a specific point (row and column) or for a specific row or a specific column.
This example shows the Events Mapper settings used to set up the When the cursor enters a position event so that a Web page opens when you click on the top row of the screen. In our example, we open microfocus.com but you could use this approach to open an internal Web page that included Help or other types of information related to the session.
|Open Web page
|When the cursor enters the position row 1, any column
|Open URL (https://www.microfocus.com/, NewTab, _none_)
String Related Events
String related events occur when text is received from the host or displayed on the screen.You can set up string events to perform actions when a string is entered or displayed on the screen or a string is received from the host.
You set up string related events to detect the string you enter at any position on the screen or only when the string is at a specific screen position.
Reflection initiates the specified event even if the string is masked (invisible). String detection is case sensitive and does not include line wraps.
This example shows the Events Mapper settings used to navigate through two host screens.
The first event in the sequence ( When string received from host ) occurs after the user logs on. It is mapped to the SendText action and configured to send the
demo command to the host to navigate to a screen of program demos.
The next event ( When screen text is recognized ) occurs on the subsequent screen. It is also mapped to the SendText action and configures it to send the option list command
3 to the host to navigate to another screen. Both events are set up to be triggered once and then disabled.
|When the text
syl_SYSTEM is received from the host
|Send Text (
|When the text
2 and 4 appears on the screen at any row, any column
|Send Text (
Time Related Events
Time related events include specific times of day, elapsed time (e.g., every half hour), or time outs from lack of activity. These events require definition of either when the event should occur, or after how much time the event should occur.
The time of day is taken from the PC, and not the host. If the host is located in a different time zone than the PC, you must make an allowance for this.
The following example Events Mapper settings, uses the When the absence of activity for a specified duration event to disconnect the session after 30 minutes of inactivity.
|Disconnect if no activity
|After 0 hours, 30 minutes, and 0 seconds without receiving any characters from the host
Keyboard related events occur when the keyboard is unlocked or when a key is pressed.
Changes in State Events
Changes in session state include connecting and disconnecting, screen changes, completion of a file transfer, and entering or exiting a terminal block mode.
This example shows the Events Mapper settings you would use to run a file transfer macro at the end of the day, disconnect from the host after the file transfer is complete, and then shut down the workspace. To do this, it uses the At a specific time of day event, set to execute a macro that transfers the file. Next, the When a file transfer has finished event is set to execute the Close action to close the session. Finally, the same type of event, When a file transfer has finished, is set to execute the Exit action that closes the workspace.
The Events list settings for this sequence are shown below:
|Run file transfer macro
|When the time of day is 5:00:00 PM
|Run Reflection Workspace Macro (Module1.TransferFile, local_proj, False, )
|Close the session
|When file transfer is done
|Exit the workspace
|When file transfer is done
You can use two or more of the same events in a sequence just we did in this example; this requires only that they be enabled, and ordered correctly in the Events list.