In this step you will create a screen description for each
of two states of the Inquire Catalog application screen.
There are two states of the Inquire Catalog application screen
that you want the recorded flow to be able to recognize:
- A "normal" state in which the text END OF DATA does not appear
at line 23, column 1 of the application screen; and
- An "exceptional" state in which the text END OF DATA does appear
at line 23, column 1.
As you might suppose, the reason for requiring these two states
to be recognized is to enable the recorded flow -- more specifically,
a While loop within the recorded flow -- to page successfully through
the list of items displayed in the Inquire Catalog screen (see
Step 3.3: Add logic to the invoked flow). When the While loop pages
forward through the list, then for each page of the list:
- If the While loop recognizes the "normal" state of the application
screen, then the While loop concludes that it has not reached
the end of the list of items.
- In contrast, if the While loop recognizes the "exceptional" state
of the application screen, then the While loop concludes that it has reached
the end of the list of items.
Because the two screen descriptions represent two states of the same application
screen, they will be created in the same screen message file, Dfh0xs2.Exinqc.sfmxsd.
Create the two screen descriptions
To create
the two screen descriptions for the Inquire Catalog application screen:
Open the screen message Dfh0xs2.Exinqc.sfmxsd in
the screen message editor:
In the EST Project Explorer, right-click .
Click . The screen message editor
opens.
Click the Screen Descriptions tab at
the bottom of the editor area.
Create the screen description for the "normal" state of the
application screen:
In the left pane of the Screen Descriptions tab,
expand .
Note: Exinqc is the name
of a screen description that you generated from a BMS map in Step
2.2.
- As you can see, this screen description contains two descriptors:
- Fields:85 This is a Number of Fields descriptor
that asserts that the Inquire Catalog application screen contains
85 fields in all.
- Input Fields:15 This is a Number of Input
Fields descriptor that asserts that the Inquire Catalog application
screen contains 15 input fields.
- Notice that this rather generic screen description matches the
Inquire Catalog application screen whether or not the application
screen is displaying the last page of the list. In either case, the
application screen being displayed has 85 fields in all and 15 input
fields.
- In this part of the tutorial, you want to modify this screen description
to match any page of the list except the last page.
In the left pane of the Screen Descriptions tab,
right-click Exinqc.
Click .
- In the left pane, the screen message editor has added to the existing
list of descriptors a Pattern entry representing
the new Field Pattern descriptor: Pattern:CICS EXAM....
- A Field Pattern descriptor matches an application screen if the
contents of the field specified in the descriptor match the contents
of the same field in the application screen.
- By default, a new Field Pattern descriptor is set to specify the
first field in the application screen.
- In the right pane, the screen message editor displays an image
of the Inquire Catalog application screen.
- Notice that field specified in the Field Pattern descriptor (that
is, the first field) is highlighted with a red rectangle
in the right pane.
In the right pane, drag the red
rectangle
so that it highlights the field that encompasses line 23 of the screen
image.
- Line 23 is the blank line immediately above the
line near the bottom of the screen that begins F3=EXIT.
- This field occupies almost all of line 23 and is filled with blanks.
In the left pane, the Field Pattern descriptor now specifies
the contents of the field that you selected: Pattern:
...
Save your work (Ctrl-S).
The Exinqc screen
description will now match the Inquire Catalog application screen
only when the field occupying line 23 of the application screen is
filled with blanks.
Create the screen description for the "exceptional" state of
the application screen. Here is an overview of this step:
- First you will generate a new screen description, named EndPage,
that is a copy of the existing screen description, which is named Exinqc.
- You will then modify EndPage so that it
matches the "exceptional" state of the application screen.
- Generate a new screen description, named EndPage,
that is a copy of the existing screen description Exinqc:
In the left pane of the
Screen Descriptions tab:
- Right-click Descriptions.
- Click Add New Description.
The
Add Recognition Profile window opens.
In the
Add Recognition Profile window:
- In the Identify as input field, type the
name EndPage.
- In the Copy from list, expand the list
and select Exinqc.
Note: This feature is very
convenient when you are creating a screen description for a different
state of the same application screen, because it allows you to initialize
a new screen description from a copy of an existing screen description.
- Click OK.
The screen message editor creates the new screen description
and adds it to the description tree.
Modify EndPage so that it matches the
"exceptional" state of the application screen:
- In the left pane of the Screen Descriptions tab,
expand EndPage.
Click the field pattern descriptor Pattern:
....
Now find the Properties view.
- The Properties view displays the properties of the currently selected
descriptor.
- In its default position, the Properties view is located below
the editor area.
Note: If the Properties view is not visible, then follow
these steps:
- On the workbench's main menu, click .
- Click OK when prompted.
- In the Properties view:
- Click the Pattern property. The entry in
the Value column becomes an input field.
Note: This
property specifies the text characters that the field of the application
screen must contain for the description to be true.
- In the input field, type the text END OF DATA and
then press the Enter key. (There should be only 1 blank space after
the word END, only 1 blank space after the
word OF, and no blank space after the word DATA.)
Note: - In the previous step, when you selected the Pattern property
initially, you probably noticed that the highlighted part of the input
field contained some number of blanks (79 blanks, in fact, because
the corresponding field in the application screen has a length of
79).
- However, you do not want to leave any trailing blanks after the
phrase END OF DATA in your input field (trailing
blanks are unnecessary here and may cause you confusion later on).
The simplest way to avoid leaving trailing blanks is as follows:
- Click the Pattern property, if you have
not already done so. The entry in the Value column
becomes an input field containing 79 blanks.
- Press the Backspace key. (Not the Home key, and not the left arrow
key).
- The Backspace key erases the current contents of the field, including
all 79 blanks.
- The cursor jumps to the first (that is, the leftmost) character
position in the input field.
- Now type the text END OF DATA in the input
field and then press the Enter key.
- Click the Pattern property again. In the
input field, you should see only the characters END OF
DATA highlighted, with no trailing blanks.
Note: Notice that in the editor area the EndPage descriptor
now displays the pattern END OF DATA.
Save your work (Ctrl-S).
Note: The EndPage screen
description will now match the Inquire Catalog application screen
only when the field on line 23 of the application screen contains
the pattern END OF DATA.
Close the screen message editor.