Invoking a Java service

To call a Java service, you can discover a Java class and generate an external service. You can then use the external service in a service flow to call the Java service.

Before you begin

Before creating the external service, add the JAR file that contains the classes that you need. See Adding managed files. If the JAR files that you need are included in a toolkit, you can add a dependency to that toolkit to access those files. See Creating, changing, and deleting a toolkit dependency in the Designer view.

About this task

To use a Java service in Process Designer, you first discover the Java class and then generate an external service from it. The external service contains operations with inputs and outputs based on the methods in the discovered Java class. When you discover a service, if a corresponding external service already exists in Process Designer, you can either overwrite the existing service or create a new one.

Complete the following steps to discover a Java class and generate an external service.

  1. Create an external service in one of the following ways:
    • Beside Services in the library navigation, click the plus sign (+). Select External Service. In the New External Service page, choose Java, REST or Web service.
    • In the Service Flow editor, select a Service task. In the Implementation tab for the service, click New. In the New External Service page, choose Discover an existing service.
  2. Select Java service from Server File as the method to discover a service.
  3. Beside Managed file, click Select and select the file that you want.
  4. Beside Java class, select the class that you want from the drop-down list. Click Finish.
  5. An external service is created with a Java binding. The operations and their inputs and outputs are based on the methods in the discovered Java application. In the Details section, the service name is shown. You can also add a description. The discovered namespace is shown. Selecting Binding shows the Java binding type. Click a parameter and select Binding to see the native type of the parameter.
Tip: Because Java method signatures that are inspected in complied classes do not contain information about the parameter names, generic names and numbers are generated for them, for example, Parameter 1 (String), Parameter 2 (Integer). You can add BeanInfo classes that provide additional information about the classes and their methods. For more informations about how to implement BeanInfo classes, see Implementing Java integration components .

Results

After your external service is created, you can select it as an implementation of a service in a service flow. Select the operation that you want to use from the operation drop-down list and map the inputs and outputs in the Data Mapping tab. See Creating a service flow.