3270 Connect User's Guide

CHAPTER 2

Getting Started with the 3270 Component Editor

 
Top of page

The Sample Transactions

For demonstration purposes, three transactions are used throughout this document in the samples presented: PART, GORD, and MENU. These transactions represent typical transactions used by operators. The PART transaction represents a scenario in which an operator uses a SKU number to drive an inquiry to a database. The GORD transaction represents a scenario in which an order for an item or several items is placed. And the MENU transaction represents a scenario in which an operator navigates through a menu-driven application to get to a particular screen. The PART, GORD, and MENU transactions are used to show you how to build Composer serviceComposer services that do the same things as the real life scenarios.

 
Top of section

Steps Commonly Used to Create a 3270 Component

There are many ways to go about creating 3270 components; however, the most commonly used steps in creating a simple 3270 component are as follows:

  1. Create XML Template(s) for the transaction.

  2. Create a Connection Resource.

  3. Create a component.

  4. Enter Record mode and navigate to transaction.

  5. Drag and drop input document data into screen.

  6. Process the transaction from the keyboard action.

  7. Drag and drop screen results into output document.

  8. Stop recording.

 
Top of page

Creating a 3270 Connection Resource

Before you can create a 3270 Component, you need to create a Connection Resource to access the mainframe transaction.

 
Top of section

About Connection Resources

When you create a Connection Resource for the 3270 Component, you have two choices: a TN3270 Connection or an EPI 3270 Connection. You can use the TN3270 Connection when you want to connect to an IBM mainframe environment, regardless of the application or Transaction Processing Monitor you are using. The EPI 3270 Connection is available when you want to connect directly to a CICS application region, that supports the External Presentation Interface (EPI) API. This connection allows you to utilize TCP/IP to access the EPI gateway on a CICS host.

 
Top of section

About Constant and Expression Driven Connections

You can specify Connection parameter values in one of two ways: as Constants or as Expressions. A constant based parameter uses the value you type in the Connection dialog every time the Connection is used. An expression-based parameter allows you to set the value using a programmatic expression, which can result in a different value each time the connection is used at runtime. This allows the Connection's behavior to be flexible and vary based on runtime conditions each time it is used.

For instance, one very simple use of an expression driven parameter in a EPI 3270 Connection would be to define the User ID and Password as PROJECT Variables (e.g. PROJECT.XPATH("USERCONFIG/MyDeployUser"). This way when you deploy the project, you can update the PROJECT Variables in the Deployment Wizard to values appropriate for the final deployment environment. At the other extreme, you could have a custom script that queries a Java business object in the Application Server to determine what User ID and Password to use.

Procedure To switch a parameter from Constant driven to Expression driven:

  1. Click the RMB in the parameter field you are interested in changing.

  2. Select Expression from the context menu and the editor button will appear or become enabled.

  3. Click on the button and then create an expression that evaluates to a valid parameter value at runtime.

NewConnectionResourceTN327027

Procedure To create a 3270 Connection Resource:

  1. From the Composer File menu, select New, then xObject, then open the Resource tab and select Connection.

    NOTE:   Alternatively, you can highlight Connection in the Composer window category pane, right click your mouse button, then select New.

    The Create a New Connection Resource Wizard appears.

    GSCreateNewConnection01

  2. Type a Name for the connection object.

  3. Optionally, type Description text.

  4. Click Next.

Procedure To select an EPI 3270 Connection:

  1. Select EPI 3270 Connection if you are connecting to a CICS application through the CICS Java Gateway.

    EPI3270ConnectionResource27

  2. In the Gateway URI field, enter the physical address of the machine to which you are connecting. In the example above, tcp://localhost.2006 is an alias for a physical machine where tcp:// is the protocol, localhost is the name of the machine, and 2006 is the default gateway to CICS.

    NOTE:   The Gateway URI field is case sensitive.

  3. In the Server field, enter the region alias or server name. Your system administrator will provide you with this name, which is defined in a separate client initialization file.

  4. The Screen wait (seconds) field, displays the amount of time in seconds that a 3270 Terminal component will wait for the arrival of the next screen in the Map Screen Action pane.

  5. Enter a UserID and Password. They are simply defined here (password is encrypted). The user will have access to UserID and Password from ECMAScript, allowing them to map UserID and Password as a variable into the screen. This way, no one ever sees the passwords.

  6. Select the Default check box if you'd like the settings you've entered to become the default settings for subsequent 3270 Connections.

  7. Click on Advanced to display the System Handling dialog.

    AdvScreenHandler

    For more details on adding screens and AID keys to handle them, refer to the Screen Handling procedures mentioned in "Handling System Messages" below.

  8. Click Finish. The newly created resource connection object appears in the Composer Connection Resource detail pane.

Procedure To select a TN3270 Connection:

  1. Select a TN3270 Connection type i f you are using an application other than CICS.

    3270createnewconnectionresourceTN32701

  2. In the Host or IP Address field, enter the physical address or alias for the machine to which you are connecting. Your system administrator will provide you with this information, which is defined in a separate host file.

  3. In the Telnet Port field, enter the number of the port. The default port number is 23.

  4. In the Code Page field, specify a code page (See "About Code Page Support" on page 19).

  5. The Screen wait (seconds) field, displays the amount of time in seconds that a 3270 Terminal component will wait for the arrival of the next screen in the Map Screen Action pane.

  6. In the Delay (ms)/Small Size (bytes) field, enter an appropriate setting. This setting helps solve network performance issues by waiting extra time (ms) for a complete packet to arrive when the packet received is smaller than (bytes). In the above example, the network is instructed to wait an additional 1600 ms for a complete packet to arrive when the packet received is smaller than 24 bytes. An additional parameter, -waitEOR, allows a `screen complete' state to be determined by waiting for a packet containing EOR (End of Record).

  7. Enter a UserID and Password. These are not actually submitted to the host during the establishment of a connection. They are simply defined here (password is encrypted). The user will have access to UserID and Password from ECMAScript, allowing them to map UserID and Password as a variable into the screen. This way, no one ever sees the passwords.

  8. In the Terminal Type field, lists the various types of terminals supported by 3270 components, including different screen sizes (i.e. 24x80 and 27x32). Select from the drop down list box the type of terminal you are using.

  9. Select the Terminal Type from the dropdown list.

    3270createnewconnectionTN32702

  10. Click in the checkbox to enable Version 2.7 Compatability.

  11. Click on Advanced to display the System Handling dialog.

    AdvScreenHandler

    For more details on adding screens and AID keys to handle them, refer to the Screen Handling procedures mentioned in "Handling System Messages" below.

  12. Select the Default check box if you'd like the settings you've entered to become the default settings for subsequent TN3270 Connections.

  13. Click on the Test Button to see if your connection works.

  14. Click Finish. The newly created resource connection object appears in the Composer Connection Resource detail pane.

 
Top of section

About Code Page Support

Code Page support in exteNd Composer Connection Resources allows you to specify which Character Encoding scheme to use when translating characters sent between exteNd Composer and other host systems. exteNd Composer data uses UniCode character encoding (the Java and XML standard). Existing legacy and other host systems use a variety of character encoding schemes (i.e., Code Pages) specific for their language or usage. A mechanism is needed to translate the character encoding between these systems if they are to communicate with one another. This is handled in exteNd Composer by specifying the Code Page used by a host system in the Connection Resource used to access that system. For more information on encoding, see Java Code Pages.

CodePageTranslation

Figure 2-1

 
Top of page

Handling System Messages

A special feature of 3270 Connections is the ability to handle unpredictable message screens received during a terminal session that would be problematic to a 3270 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 3270 Component interacting with a system transaction. These system messages are usually dispatched by a user hitting an AID key after having read them.

Both types of 3270 Connections (TN3270 and EPI 3270) allow 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.

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 3270 Component that uses a 3270 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 3270 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.

    a. 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.)

    b. Animate the component by pressing F5.

    c. Run to the Breakpoint by pressing F9.

    d. Pause the Animation by pressing F6.

    e. Initiate the system message.

    f. 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

  1. 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."

  2. 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])

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

  4. In the Composer window, select the Connection Resource for the component and open it.

  5. On the Connection Info tab, press click on the Advanced button and the System Screen handling dialog appears.

  6. Check to Enable TN3270E protocol support. If the checkbox is unchecked, disable and clear the Resource Name Text field.

  7. Enter the Resource Name used in the TN3270 Connect, leave blank if the Server is supplying the name. If you right-click on the Resource Name field, you can change the value from a constant to an Expression and use ECMAScript to fill in the value.

  8. Click on the + icon to add a line to define Screen handler.

  9. 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.

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

    AdvancedTN3270Options

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

  12. 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.

 
Top of page

Creating a Style Sheet Resource

An additional resource associated with the 3270 Connector is the style sheet resource. This allows you to create a style sheet with which to display the emulation screen in the native environment pane.

Procedure To create a Style Sheet Resource:

  1. Select File>New>xObject from the Composer menu, then click on the Resource tab and select Terminal Style Sheet.

    NOTE:   Alternatively, you may highlight Terminal Style Sheet in the Resource section of Composer's category pane, click your right mouse button, and select New.

    The Create a New Terminal Style Sheet wizard appears.

    3270StyleSheetWizard01

  2. Type a Name for the new style sheet. Optionally, you may type in Description text.

  3. Click the Next button. The Style Sheet Editor window appears.

    3270StyleSheetWizard02

  4. Use the Style Sheet Editor as described below to configure your style sheet:

  5. Click OK. The newly created style sheet resource appears in Composer's detail pane.

 
Top of page

Creating XML Templates for Your Component

In addition to a connection resource, a 3270 component may also require that you have already created XML templates so that you have sample documents for designing your component. See Chapter 5, Creating XML Templates in the exteNd Composer User's Guide for more information.

In many cases, your input documents will be designed to contain data that a terminal operator might type into the transaction interactively. Likewise, the output documents are designed to receive data returned to the screen as a result of the operator's input. For example, in a business scenario, a terminal operator may receive a phone request from a customer interested in the price or availability of an item. The customer gives the operator a SKU number, which he or she enters into the system. This represents a SKU number in an input document. Likewise, when the operator's terminal receives information back from the mainframe, based on the SKU, and the operator provides this information back to the customer, this represents the output document.

Also, if your component design calls for any other xObject resources such as custom scripts or code table maps, it is best to create these before creating the 3270 Component. For more information, see the exteNd Composer User's Guide.



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