5250 Connect User's Guide

CHAPTER 6

Advanced Features

The 5250 Connect includes several advanced features not available in other Integration Manager Connects. Two of these features: Multi Row processing and Screen Handling, will be discussed in this chapter.

 
Top of page

The 5250 Multi Row Wizard

As discussed previously, the 5250 Connect includes drag and drop capabilities that allow you to drag data from an XML document into a 5250 or from a 5250 screen into an XML document quickly and easily; however, in cases where there are a variable number of rows, and possibly multiple screens of data, using the drag and drop method is not effective. To resolve this issue, the 5250 Connect includes a Multi Row Wizard that allows you to specific the mapping of many-to-many data relationships between a DOM and the 5250 screen. The Multi Row Wizard, which appears as an option in the Action> New Action menu of a 5250 component, can be used to input data from an XML document to the repeating area of a 5250 screen, or to output the repeating data from a 5250 screen to an XML document. The Multi Row Wizard essentially creates repeat loops within the Action Model that map multiple rows of data automatically from one document or screen to another until complete, regardless of the number of rows or number of screen pages.

 
Top of section

About the Multi Row Samples in this Document

There are many ways the Multi Row Wizard can be used when inputting or outputting multiple rows of data to and from XML documents and 5250 screens, and not every scenario can be addressed in this document. Two basic sample components are provided here that should give you a clear understanding of how the Multi Row Wizard is generally used.

The first procedure shows you a component that uses the Multi Row Wizard to input multiple elements of data from an XML document to a 5250 screen. The second procedure shows a component that uses the Multi Row Wizard to output multiple rows of data from a 5250 screen to an Output DOM.

The procedures in this section are strictly for demonstration purposes. Unlike the Integration Manager tutorial, theses procedures are not intended for following along step-by-step.

Procedure To prepare for using the Multi Row Wizard to input data:

  1. First, a component is created per the instructions in "To create a new 5250 Component:" on page -21. For this example, the component is called "5250Sample." The component is shown below in the 5250 Component Editor.

  2. The Record button is clicked and a sign-on screen appears in the Native Environment pane.

    5250SampleInput02

  3. After signing on, the user navigates to the correct screen. In this example we must type a UserID and Password, and in the Program/Procedure field, "GORD" would be entered.

  4. Enter is pressed on the keyboard.

    NOTE:   Alternatively, Enter may be selected on the 5250 tool bar within the Native Environment pane. To view this tool bar, select View from the 5250 Component Editor menu bar, then Keypad Toolbar.

    This example then displays an "ENTER ORDER" 5250 screen in the Native Environment pane.

    5250SampleInput03

  5. The applicable header data is dragged and dropped from the input DOM to the corresponding field in the 5250 ENTER ORDER screen:

    From: DOM Field

    To: 5250 ENTER ORDER Screen Field

    ODATE

    DATE:

    OCUST

    CUST:

    ONAME

    NAME:

    OBADDR

    BILL TO: (First line)

    OBCITY

    BILL TO: (Second line)

    OBST

    BILL TO: (Second line, 2-character field to the right of city)

    OBZIP

    BILL TO: (Second line, 5-character field to the right of state)

    OSADDR

    SHIP TO: (First line)

    OSCITY

    SHIP TO: (Second line)

    OSST

    SHIP TO: (Second line, 2-character field to the right of city)

    OSZIP

    SHIP TO: (Second line, 5-character field to the right of state)

    OPAY

    PAYMENT METHOD:

    OPAYINFO

    ACCOUNT #:

    The 5250 ENTER ORDER screen appears as shown.

    5250SampleInput04

  6. The area of repetitive rows that will be selected for the Multi Row action is identified.

  7. For multi-row actions, the user needs to define the area that contains repeating data either manually or by highlighting the area. In this example, the user drags the cursor over the line item input field area in the 5250 ENTER ORDER screen, beginning in the upper left corner and moving to the lower right corner. A gray background highlight appears over the drag marquee.

    NOTE:   Make sure that you start your drag process with your cursor outside of the first field. If you start dragging within a field, Integration Manager assumes you are trying to move the field itself.

    The 5250 input field area appears as shown.

Procedure To use the Multi Row Wizard to input data:

NOTE:   If you are outputting data, see "To use the Multi Row Wizard to output data:" on page -85.

  1. From the 5250 Component Editor menu, select Action, then New Action, then Multi Row. The Multi Row Wizard appears. The wizard automatically fills in the dialog based on the area you highlighted.

    1

    If you would like to edit the fields or you did not highlight an area, you would do so as follows:

    NOTE:   The 5250 screen is comprised of 24 lines x 80 columns.

  2. Edit the fields if desired. When satisfied with the parameters, click Next. The second panel of the Multi Row Wizard appears.

Procedure To set up a repeat action in the Multi Row Wizard:

NOTE:   If you are outputting data, see "To use the Multi Row Wizard to output data:" on page -85.

  1. After completing the first panel of the Multi Row Wizard, continue as follows.

  2. Select the Input radio button in the Use XML As area. This panel is used to create a repeat action for processing the multiple elements or screen rows. Its use is similar to the basic "Repeat for Element" action available in all components.

  3. In the Representing field, click the Expression builder button. The Expression builder window appears.

    3270MultiRowInput02A

  4. Expand the Input element in the XPath Content frame.

  5. Navigate to the OITEM element and double click. The expression appears in the comment pane in the bottom of the window. For this example, the OITEM element is the one on which we will loop.

    3270MultiRowInput02B

  6. Click OK. You are returned to the second screen of the Multi Row Wizard, which now appears with the new expression in the Representing field.

    NOTE:   When using the Expression builder, Integration Manager automatically creates an Alias. In this example, Integration Manager created the alias called OITEM. For more information on Aliases, please see the Integration Manager User's Guide.

    3

  7. Click Next. The Iterate screen of the Multi Row Wizard appears.

Procedure To iterate to the n ext record:

NOTE:   If you are outputting data, see "To use the Multi Row Wizard to output data:" on page -85.

  1. This screen allows you to tell the Multi Row Wizard what to do when it encounters an end of page. In the example (see "To add Multi Row Actions to input data:" on page -83), there is only one page of data, so there is no check mark in the Can Iterate to Next Record Set box.

    4

  2. Click Finish. The Multi Row actions you created in the wizard appear in the Action Model pane, with the Add all multi row map actions here! comment highlighted.

    3270MultiRowInputMapAction01

Procedure To add Multi Row Actions to input data:

  1. Highlight the Add all multi row map actions here! comment in the Action Model if not already highlighted.

  2. Navigate to the first instance of OITEM in the Input DOM pane.

  3. Drag and drop the children of OITEM into the applicable fields in the first row of line item fields in the 5250 screen as follows:

    From: Input DOM

    To: ENTER ORDER 5250 Screen

    OISKU

    PART

    OIDESC

    DESCRIPTION

    OIQTY

    QTY

    OICOST

    COST

    The Input DOM and ENTER ORDER 5250 screens appear as shown.

    5250MultiRowLoopAction01

    The Action Model pane appears as shown.

    3270MultiRowLoopAction02

    Notice that Map actions within the Multi Row actions block reference fields by their relative position in the row and not their absolute position within the screen. So the target of the first Map action is $RECORD/FIELD[1]. Using drag and drop to create your Map actions within the context of the Multi Row will create and assign these field indexes for you automatically.

    The final Action Model appears as shown.

    5250CompleteActionModel01

  4. Select File, then Save from the 5250 Component Editor menu bar, or click the Save button.

  5. Follow the instructions in "To run the animation:" on page -41 to test your component.

Procedure To use the Multi Row Wizard to output data:

  1. Create a component per the instructions in "To create a new 5250 Component:" on page -21. For this example, a component called "5250SampleOutput" is created. The component is shown below in the 5250 Component Editor.

  2. Click the Record button. A sign on screen appears in the Native Environment pane.

    5250SampleOutput02

  3. Navigate to the correct screen. For this example, you would type in a UserID and Password and in the Program/Procedure field, "MENU" would be entered.

  4. Press Enter on the keyboard. This example displays an "INSTRUCTIONS" 5250 screen in the Native Environment pane.

    NOTE:   Alternatively, you may select Enter on the 5250 tool bar within the Native Environment pane. To view this tool bar, select View from the 5250 Component Editor menu bar, then Keypad Toolbar.

    5250SampleOutput03

  5. In this example, "BRWS" is entered in the TRANSACTION field and "10001" in the NUMBER field.

  6. Press Enter on the keyboard. A "FILE BROWSE" 5250 screen appears.

    5250SampleOutputFileBrowse01

  7. For multi-row actions the user needs to define the area that contains repeating data either manually or by highlighting the area. In this example, the user identifies the data area and drags the cursor it, beginning in the upper right hand corner and moving to the lower left hand corner. A gray background highlight appears over the drag marquee.

    NOTE:   Make sure that you start your drag process with your cursor outside of the first field. If you start dragging within a field, Integration Manager assumes you are trying to move the field itself.

  8. The FILE BROWSE screen appears as shown.

    5250SampleOutputFileBrowse02

  9. From the 5250 Component Editor menu, select Action, then New Action, then Multi Row. The Multi Row Wizard appears. The wizard automatically fills in the dialog based on the area you highlighted in the previous step.

    1

  10. Edit the fields if desired. When satisfied with the parameters, click Next. The second panel of the Multi Row Wizard appears.

  11. Select the Output radio button for Use XML As. This panel is used to create a repeat action for processing the multiple elements or screen rows. Its use is similar to the basic "Repeat for Element" action available in all components.

  12. In the Representing field, click the Expression builder button. The Expression builder window appears.

    3270SampleOutExpression01

  13. Expand the Output element in the XPath Content frame.

  14. Navigate to the ACCINFO element and double click. The expression appears in the comment pane in the bottom of the window. For this example, the ACCINFO element is the one on which we will loop.

    3270SampleOutExpression02

  15. Click OK. You are returned to the second screen of the Multi Row Wizard, which now appears with the new expression in the Representing field.

    NOTE:   When using the Expression builder, Integration Manager automatically creates an Alias. In this example, Integration Manager created the alias called ACCINFO. For more information on aliases, please see the Integration Manager User's Guide.

    OUT6

  16. Click the Next button. The Iterate screen of the Multi Row Wizard appears. This screen tells the wizard what to do when it encounters an end of page.

    4

  17. Check the Can Iterate to Next Record Set box.

  18. Select F1 from the Iterate by attention key pull down list.

    NOTE:   The 5250 screen itself contains the instructions for the iteration keys. For this example, the FILE BROWSE screen included instructions that said to use the F1 key to page forward.

  19. Click Next.

Procedure To complete the Boundary parameter page of the Multi Row Wizard:

  1. Select the Blank Record radio button. This tells the wizard that a blank record indicates the end point of the loop action. You may also use the Expression builder to set a different indicator for the loop's end point. For more information on using the Expression builder, please see the Integration Manager User's Guide.

    3270MultiRowBlankRecord

  2. Click Finish. The Multi Row actions you created in the wizard appear in the Action Model pane, with the Add all multi row map actions here! comment highlighted.

    3270SampleOutputActionPane01

Procedure To add the Multi Row Actions to output data:

  1. Highlight the Add all multi row map actions here! comment in the Action Model if not already highlighted.

  2. Navigate to the first instance of ACCINFO in the Output DOM pane.

  3. Drag and drop the data from the 5250 FILE BROWSE screen to the Output DOM as follows:

    From: FILE BROWSE

    To: Output DOM

    NUMBER

    ACCTID

    NAME

    NAME

    AMOUNT

    BALANCE

    The Output DOM appears as shown.

    5250SampleOutput04

  4. Select File, then Save from the 5250 Component Editor menu bar, or click the Save button.

  5. Follow the instructions in "To run the animation:" on page -41 to test your component.

Procedure To edit the Multi Row Actions:

  1. Click on the MultiRow Action that you wish to change in the Action Pane. The dialog box appears.

    3270EditMultiRowAction

  2. Click on the appropriate tab, edit the fields and click OK. Refer to the Previous sections on using the MuliRow Wizard to Input or Output data.

 
Top of page

Handling System Messages

A special feature of 5250 Connections is the ability to handle unpredictable message screens received during a terminal session that would be problematic to a 5250 Component during its execution. One example of this type of message screen is when the system administrator broadcasts notices to terminals warning them of system shutdowns or other events. The arrival of this screen is both unpredictable and unwanted during the normal execution of a 5250 Component interacting with a system transaction. These system messages are usually dispatched by a user hitting an AID key after having read them.

A TN5250 Connection allows you to define special screen handlers to respond to screens you wish to exclude from component processing. You can also define multiple screen handlers for a single connection. By defining screen handlers in the Connection Resource, you can define your handlers once and multiple components can take advantage of them by using the same connection.

CaptureSysMsg

NOTE:   Connection screen handlers are not restricted to messages from the System Administrator. You can define a screen handler to respond to any screen received in the terminal data stream.

Procedure General steps to creating a Screen Handler

  1. Create a working 5250 Component that uses a 5250 Connection Resource.

  2. Reproduce and capture the screen you wish to handle in a ScreenDoc DOM.

  3. Select a field/data combination on the screen to uniquely identify this screen to the screen handler.

  4. Add the screen handler to the Connection Resource by supplying a screen identity expression and an AID key for dispatching the screen.

Procedure Specific steps to creating a Screen Handler

  1. Create your 5250 Component as you normally would (i.e. create a Connection and other Resources as necessary and then build the component)

  2. If your ScreenDoc DOM is not already visible, select View/Window Layout from the menu bar, followed by clicking the XML Layout tab. Then move ScreenDoc to the Visible list and click OK.

  3. Save the component but leave it open. Capture the particular screen you wish to handle as follows.

    NOTE:   This will take some coordination with your system operator/administrator or whoever is responsible for generating the message screen you wish to handle.

    1. Set a breakpoint on an action in the first Map Screen after the map Screen containing your Log in actions. (If this is a Logon Component, then set the breakpoint on the first action in the KeepAlive or Logout section.)

    2. Animate the component by pressing F5.

    3. Run to the Breakpoint by pressing F9.

    4. Pause the Animation by pressing F6.

    5. Initiate the system message.

    6. Press Enter and the system message screen will appear in the Native Environment Pane and the XML representation of the message will appear in the Screen Doc pane.

      CaptureSysMsg

  4. Choose a test field whose data will serve to identify this screen as one you wish to handle. For instance, you may choose the screen title field whose data is "Display Messages."

  5. Hover your mouse pointer over the test field's XML representation in the ScreenDoc and note its full XPath location (e.g. ScreenDoc/SCREEN/FIELD[5])

  6. Stop Animation by pressing Shift-F5, sign off the host system, and close the component, but do not save it.

  7. In the Integration Manager window, select the Connection Resource for the component and open it.

  8. On the Connection Info tab, click on the Advanced button and the Advanced dialog appears.

  9. Check the Enable Telnet Environment checkbox to enable Telnet protocol support per RFC 2877 and RFC 1572.

  10. Enter the Device Name used in the TN5250 Connect.

  11. Click on the Add button to add a line to define Screen handler.

  12. In the Expression field, type an expression comparing the test data against the test field's XPath (e.g. ScreenDoc.XPath("string(SCREEN/FIELD[5])")= =" Display Messages").

    NOTE:   The XPath string function is applied to make sure the comparison works properly.

  13. In the AID/DispatchKey field, select a key to send in response to the screen.

    5250DefineSystemScreen

  14. Click on OK to save the Handler, and click on OK to save the connection.

  15. Test your System Screen Handler by animating the component past the Logon Map Screen actions, setting a breakpoint, initiating the system message, and continuing your animation past an Enter Send Key action.




Copyright © 2004 Novell, Inc. All rights reserved. Copyright © 1997, 1998, 1999, 2000, 2001, 2002, 2003 SilverStream Software, LLC. All rights reserved.  more ...