Previous Topic: Java and External JARsNext Topic: Configure the Run Java Code Operator


Configure the Java Module

You can invoke classes in an external Java Archive (JAR) file from all Run Java Code operators. Configure the Java module to apply settings to these operators to leverage the functionality that your existing Java code provides. Then use the Run Java Code operator to create a Java object.

Follow these steps:

  1. Specify the JARs you want to work with on a CA Process Automation orchestrator or agent machine. Locate the Default External Jars field for the module. Enter the paths to the external JARs to load for use by all the Run Java Code operators running on the orchestrator or agent. For each path, you can enter:
    1. The full path to a JAR file that resides on the machine where the orchestrator or agent is running. The full path starts with either of the following slash marks:
      /
      \\
      
      

      You can also designate the full path using a regular expression that starts with one character, then a colon (:), and then the rest of the string, including dot syntax as in:

      ^.:.* 
      
      
    2. The full path to a JAR file available over http:// or https://. The path does not require authentication and is not accessible through an http proxy.
    3. A relative path to a JAR file that was uploaded to the CA Process Automation User Resources folder. Unless you specify a full path, the application considers the path that you enter to be a relative path.

    The Java Module Class Loader, which all the running Run Java Code operators of the Java module share, loads the JARs that you list in this field. The JARs are loaded once when executing the first Java module operator, and later after any changes made to the default external JARs. Any JAR entered in this list are available to the Java code that the Run Java Code operators run. Any classes you define in the operator-level JARs override the same classes specified in the module-level JARs.

  2. In addition to external JARs, enter paths to any .class files that any Run Java Code operators running on the orchestrator or agent are using.
    1. For .class files in an unnamed package, enter a path that ends with the directory that contains the .class files. For example, MyAccount.java does not belong to a package, and MyAccount.class is in the following location:
      C:\java\tests\MyAccount.class
      

      Set the operator to use the following path:

      C:\\java\\tests
      
    2. For .class files in a named package, enter a path that ends with the directory that contains the root package. The root package is the first package in the full package name. For example, MyAccount.java belongs to package com.ca.tech. MyAccount.class is at the following path:
      C:\java\othertests\com\ca\tech\MyAccount.class
      

      Set the operator to use the following path:

      C:\\java\\othertests
      

    Note: Specify the path to a folder as a full path or as a relative path to CA Process Automation User Resources. Do not specify an http path. Specify the path to a folder to load .class files, not JAR files. Unlike .class files, each JAR file requires a separate path that ends with the JAR file (not the directory where it resides).

  3. (Optional) Upload the JARs you want to work with to the CA Process Automation User Resources.

    CA Process Automation automatically mirrors the JARs.

    Note: Resources, including user resources, are mirrored within the mirroring interval of the orchestrator or agent. Ensure that the JAR files you upload in the user resources are already mirrored before using them in the Java module operators.

  4. Verify that the JAR files containing the Java classes you want to work with are available to the orchestrator/agent whose touchpoint is running the operator.
  5. (Optional) Configure the module default logger. You can override this configuration at the operator level.
  6. (Optional) Override any module level settings by configuring individual operators. See the next procedure, Configure a Run Java Code Operator.
  7. Run any Run Java Code operators. The Java module captures any exceptions or errors that are encountered during an operation and alerts the user in the Reason field of the problem operator.