Conditionals

Conditional paths are used if more than one screen could appear at a point in the macro, and the actions Host Access should take for the screens are different.  There are two ways to handle conditional paths:  proactive and reactive.  Proactive conditional paths are when you know there is a chance for a screen to appear that has not been defined, so you go ahead and handle that scenario.  Reactive conditional paths are when the user is going through the Macros and encounters a screen that is not defined.  The computer then waits a couple of seconds to determine if the screen is defined and if not, it takes you through the steps to define it as an alternate path.

For this example we are going to proactively create conditionals using the Looping Example that was previously created.

Proactive Conditional

Open the Looping_Example Integration Object and play the Macros using an input that you know will be found and one that will not.

For this example, we used the input kelly kalena and it was not found.  Not only are the resulting screens different from the screens that appear for inputs that are found, but you are also stuck in an endless loop since the end loop condition (PF7 in the lower right-hand corner) is never met.  This shows that it is very important that the text you define the screen by is unique.  Otherwise, you run into the first problem by allowing screens that do not contain the data we want to be shown.  Now, we are going to go back and create a conditional path for when an invalid author is given as input.

First, we go back to where the screens appear differently.  In this example, it is the Search Results Screen.  Highlight the screen before it, Introduction Screen and select Insert Conditional from the toolbar.

The Define Screen page appears.  This screen is new, so you are asked to Define the Screen.  It is easier when recording Macros to identify screens by meaningful names rather than the default values presented to the users.  For example, to uniquely identify this screen, we call it  No Entries Found Screen instead of DataScreen1.  After you define a name for this screen, click Next.

To recognize text on this screen, you can either type some recognizable words, or draw a box around the text.  The text No Author Entries Found on this page is unique; therefore use those words to identify this screen.  Select At the specified position and click Next.

We are now at the point where we want to capture data.  Click Next to enable the user to gather data.

The Select Data screen now appears.  Choose Select data on the terminal, then use the mouse to draw a box around the search results.  Click Next.

You are now asked if you want to extract data as a table, or as plain text.  For this example, we chose Extract data as plain text.  Click Next.

The Text Extraction screen appears.  Provide a value for the output information.  We will use possible_reasons as the output value.  Click Next.

The Finish data Extraction screen appears.  Select Finished capturing data, then click Next.

To finish recording this Macro type STA to return to the screen where you are going to record the Disconnect Macro.

You are now finished with the conditional path.  Click Stop Macro, so that you can stop recording.  The Disconnect Macro has already been recorded, so there is no need to do it again.

Click Yes to stop recording.

Even though there are two possible paths your Data Macro can now take, you still want them to end on the same screen.  For this example, the Database Selection Menu Screen is the screen both paths end on.  There is no need to have this screen defined for both paths, so we are going to delete the one that was just defined.  When you play back the Integration Object you will notice that both paths now end on the same screen.

Save this Integration Object as Conditional.