The COBOL Project - TemperatureConverter

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

The following steps show the features required in order to deploy it alongside the other two projects.

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

    The JVM COBOL program appears.

  2. Open the Outline pane to show 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 > resources and double-click cobconfig.properties.

    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 cobconfig.properties is deployed as part of the project:
    1. Right-click TemperatureConverter then choose Properties.
    2. Choose Deployment Assembly.

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

      Deployed assembly