Modifying Java coding templates

The HPubTemplateHODBean.Customize and HPubTemplateHODBeanInfo.Customize templates contain Java™ code that is incorporated into the Integration Object Java bean code (.java) file when the Integration Object is compiled. The templates also contain constructs specifically for ZIETrans, which are prefaced with a percent sign (%). These constructs enable ZIETrans to create Java beans from the data that is specified by the user when the Integration Object is created. When modifying the template files, be careful not to delete the statements containing the ZIETrans constructs. Make backup copies of the HPubTemplateHODBean.Customize and HPubTemplateHODBeanInfo.Customize templates before you begin making changes to the template files.

For example, suppose that you want to trace the name and the x and y screen coordinates of the Host On-Demand Extract Events that are processed by an Integration Object.
Note: Extraction of the x and y screen coordinates is not available in the Web Services or EJB environments, because the x and y coordinates require access to internal variables that are not available in those environments.
Follow these steps:
  1. Back up the file HPubTemplateHODBean.Customize.
  2. Change the code that extracts the macro event in HPubTemplateHODBean.Customize to add the following lines after the pullVariableValueFromExtractData( haovWorkOnThis, data);... statement:
         // --- Trace X and Y screen coordinates example ---
         if (HPubTracingOn) {
           String strg = "Extracting variable: " + stringExtractNameForThisEvent +
                         " from screen location (" +
                         haovWorkOnThis.intXScreenLocation + "," +
                         haovWorkOnThis.intYScreenLocation + ")";
           Ras.trace( this.getClass().getName(),"macroExtractEvent", strg);
         }
    For example:
    ...
      public void macroExtractEvent(MacroExtractEvent oMacroExtractEvent)
      { // a HOD macroExtractEvent was fired for this macro
    
    ..
        pullVariableValueFromExtractData( haovWorkOnThis, data);
    
         // --- Trace X and Y screen coordinates example ---
         if (HPubTracingOn) {
           String strg = "Extracting variable: " + stringExtractNameForThisEvent +
                         " from screen location (" +
                         haovWorkOnThis.intXScreenLocation + "," +
                         haovWorkOnThis.intYScreenLocation + ")";
           Ras.trace( this.getClass().getName(),"macroExtractEvent", strg);
         }...
  3. Update the ZIETrans preferences to point to your new templates.
  4. Create an Integration Object as you normally would. If you want to modify an existing Integration Object to trace the name and the screen coordinates of the Host On-Demand Extract Events, re-create the Integration Object by right-clicking on the macro and selecting Create Integration Object. If you introduced Java syntax errors in your template changes, they will show up as compile error messages in the task list.
  5. Rebuild your ZIETrans project. In the ZIETrans projects view, select the name of your project and select Project > Clean from the Rational® SDP menu bar. You can clean all workspace projects or just selected projects.
  6. If you already have a way to invoke your Integration Object, skip this step. To test your Integration Object, right click the name of the Integration Object and select either Create Model 1 Web pages, Create Struts Web pages, or Create JSF Web Pages. This creates a page from which you can supply the required inputs and invoke your Integration Object.
  7. Test your modified Integration Object using the Run on Server function. In the ZIETrans projects view, right click the name of your project and select Run on Server.