The COBOL Project - TemperatureConverter

The JVM COBOL project that contains the business logic for the application.

The following steps introduce you to the features that enable you to deploy this project alongside the other two projects.

  1. In the COBOL Explorer pane, navigate to TemperatureConverter > COBOL Sources > src > com > microfocus > converter and double-click TemperatureConverter.cbl.

    The JVM COBOL program appears.

  2. Open the Outline pane to show the two methods. Click each entry to jump to the code in the editor.

    Outline pane

    The toCelsius and toFahrenheit methods both contain the conversion algorithms, accepting and returning primitive data types compatible with Java.

    The toFahrenheit method

  3. In the COBOL Explorer pane, navigate to TemperatureConverter > resource and double-click

    Resource file

    This file is required to ensure the JVM COBOL run-time system works correctly in the EJB environment; each .jar file that is packaged into the deployed .war file requires one of these files. If one does not exist, use the File > New > File options to add a new resource file.

  4. You must ensure that the resource file is deployed as part of the project:
    1. Right-click TemperatureConverter then choose Properties.
    2. Choose Deployment Assembly.

      The file is in the resource directory, and so is set to be included in the assembly when it is deployed.

      Deployed assembly

    3. Click Cancel to close the Properties page.