Define a reusable field

We now need to define our input fields. In doing this, we will demonstrate another feature of the Interface Mapper -- Reusable Fields. You create reusable fields from COBOL entry point fields for the purpose of using them across operations. In Java terms, a reusable field is a custom record according to the CustomRecord interface defined in the Common Client Interface (CCI) from Sun. For Java-based service interfaces, the Interface Mapper assigns a custom data type to interface fields created from reusable fields based on the CCI. Here we will create a group of reusable fields that contains only the fields used by the service interface, eliminating those that are not.

  1. Drag lnk-b-details to the Reusable Fields pane.
  2. Fully expand the tree under lnk_b_details in the Reusable Fields pane.
  3. Ungroup lnk_b_text_details so that all the items are at the same level. To do this, right-click each of the fields under lnk_b_text_details; then click Ungroup for each.
  4. Delete each elementary field in the Reusable Fields pane except lnk_b_title, lnk_b_author and lnk_b_stockno. To delete a field, either click it and press Delete or right-click it and select Delete from the context menu. If the tree view contracts, expand it to see what you have created.

    You have defined a group of reusable fields as shown here:
    The Reusable Mapping Created for your EJB

  5. Drag lnk_b_details from the Reusable Fields pane to the Interface Fields pane. Be sure not to drop it amongst the fields that are subordinate to readop_details.

    This creates an interface field of type lnk_b_details. By default, its name is also lnk_b_details.

    Note: If the new interface field does not appear automatically, double-click the entry for the Read operation in COBOL Explorer. This refreshes the Interface Mapper panes.
  6. Because Java requires that group fields have unique names across operations, change the name of lnk_b_details interface field to readop_input.
  7. Save the service interface.