The Terminal Automation plugin depends on Windows-only host access components, so these steps require an agent running on Windows.
Terminal Automation: Set
Description
Terminal Automation: Set step sets data at X, Y position on a terminal.
Example:
Screen S5002 has a Contract Number box on row 16 starting at column 40, and an Action box on row 19 column 40. To type a contract number, set the action to B and press Enter, use three rows:
Row 1: X-POS = 16, Y-POS = 40, Data = 31211515, Maximum Delay (ms) = 5000
Row 2: X-POS = 19, Y-POS = 40, Data = B, Maximum Delay (ms) = 5000
Row 3: X-POS = -1, Y-POS = -1, Data = [enter], Maximum Delay (ms) = 5000
The rows are processed from top to bottom. Row 3 uses -1, -1 because [enter] is a key press, not a position on the screen.
If you try to write to a read-only part of the screen, the step reports which screen was displayed at that moment, for example:
Cannot write to protected field at row number 1 (X-POS: 1, Y-POS: 10). The terminal field is read-only. Screen line 1 reads: [Welcome to PUB400.COM * your public IBM i server]. The protected field spans rows 1-1, columns 10-57 and contains: [Welcome to PUB400.COM * your public IBM i server]
This usually means the terminal is on a different screen than the workflow expects.
Configurations
| Field Name | Description |
|---|---|
| Step Name | Name of the step. This name must be unique in a single workflow. |
Input tab:
| Field Name | Description |
|---|---|
| Input Fields: | |
| X-POS | X-POS is the screen row, counted from the top, starting at 1. Use -1, together with Y-POS = -1, to send a key press instead of typing at a position. This value is an integer. This field is mandatory. |
| Y-POS | Y-POS is the screen column, counted from the left, starting at 1. Use -1, together with X-POS = -1, to send a key press instead of typing at a position. This value is an integer. This field is mandatory. |
| Data | Specify a Value or Mnemonic Keyword to set. This is a String value. This field is mandatory. Allowed value is >0 and <= max row & column of the terminal for non-Mnemonic Keyword. On a standard 24x80 screen, X-POS is 1 to 24 and Y-POS is 1 to 80. Note: many emulators show the cursor position as column/row, which is the opposite order. For example, tn5250 showing 025/001 means column 25, row 1, so you would enter X-POS = 1 and Y-POS = 25. • For sending keys, set values of X-POS=-1, Y-POS=-1 and Data=Mnemonic Keyword. • For updating existing field value, use [eraseeof] Mnemonic. • Following is reference URL for Mnemonic Keyword details: https://www.ibm.com/support/knowledgecenter/SSS9FA_14.0.0/com.ibm.hod.doc/doc/SessionManager/SessionManagerAPI.html#bidimnemonic • For Mnemonic Keywords the string must be enclosed in [ ]. If the string is not enclosed in [ ], the step reports an error. If it is enclosed in [ ] but the keyword itself is wrong, nothing is reported: the key press is ignored and the workflow continues. Example: To update existing field value at x=5,y=25 below is the sample example. • Current Field value : ABCDEF and value to update=XYZ • For updating existing field value use [eraseeof] Mnemonic. Figure: Sample input fields for updating an existing field value. • At design-time, a consolidated error message for missing table fields is displayed whereas at run time segregated error messages is displayed. • For certain cases like wrong input, instance specific or unknown error, the plugin may not provide any error message or exception. |
| Maximum Delay(ms) | The longest the step waits for the terminal to be ready to accept input, in milliseconds. It is a maximum, not a fixed pause. The step continues as soon as the terminal is ready. If left blank, the plugin waits only 100 ms, which is usually too short for a real host. 5000 is a safe starting point. If the time runs out, a Set at a real position reports an error, and a Set sending a key press (X-POS = -1, Y-POS = -1) skips the key press and continues. |