Previous Topic Next topic Print topic


Define a Reusable Field

We now need to define our input fields. In doing this, we will demonstrate another feature of the Service Interfaces Editor -- 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 Service Interfaces Editor 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 lnk_b_text_details; then click Ungroup.
  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 popup 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.

  6. Because Java requires that group fields have unique names across operations, change its name to readop_input.
  7. Save the service interface.
Previous Topic Next topic Print topic