9 Creating Custom Java for Orchestrations

This chapter contains the following topics:

9.1 Understanding Custom Java for Orchestrations

You can include a custom Java class for service requests and rules within an orchestration. Within the custom Java classes, any number of private attributes can be declared. As long as the accessor (get/set) methods are generated for the attributes, the JD Edwards EnterpriseOne Orchestrator can assign attributes from input values from the orchestration. Then within the appropriate method, those values can be used to make AIS calls into EnterpriseOne or any other logic to either evaluate a rule or perform another action.

9.2 Creating Custom Java

When creating custom Java classes, you must reference these JAR files, which are dependencies:

  • OrchestratorCustomJava.jar. This contains the definition of the interfaces.

  • AIS_Client.jar 1.1.0 or higher. This contains the loginEnvironment attribute and enables AIS calls to JD Edwards EnterpriseOne.

It is not necessary to include these JARs with the deployment as they are already deployed as part of the AIS Server deployment. After creating a custom Java class, you deploy the Java class or Java classes to a JAR file.

A custom rule should implement the CustomRuleInterface class included with the OrchestratorCustomJava.jar. The interface requires a loginEnvironment variable of type com.oracle.e1.aisclient.LoginEnvironment and an evaluate() method that takes no parameters and returns a Boolean value.

A custom service request should implement the CustomServiceRequestInterface class also included with the OrchestratorCustomJava.jar. The interface will require a loginEnvironment variable of type com.oracle.e1.aisclient.LoginEnvironment and a process() method that takes no parameters and returns a javax.ws.rs.core.Response.

9.2.1 Using Custom Java for the Orchestration Service Request

Custom service request Java classes should implement the com.oracle.e1.rest.orchestrator.customjava.CustomServiceRequstInterface which requires the following methods:

  • setLoginEnvironment(com.oracle.e1.aisclient.LoginEnvironment loginEnvironment). The method used to perform AIS calls.

  • process(). The method that returns javax.ws.rs.core.Response which is called automatically after all the attributes are set.

9.2.2 Using Custom Java for the Orchestration Rule

Custom rule Java classes should implement the com.oracle.e1.rest.orchestrator.customjava.CustomRuleInterface which requires the following methods:

  • setLoginEnvironment(com.oracle.e1.aisclient.LoginEnvironment loginEnvironment). The method used to perform AIS calls.

  • evaluate(). The method that returns Boolean and is called automatically after all the attributes are set.

9.3 Deploying Custom Java

You must deploy the JAR file that contains the custom Java to the AIS Server. Follow the instructions accordingly depending on the server on which the AIS Server is installed:

9.3.1 Deploying Custom Java on AIS Server on Oracle WebLogic Server

To deploy the custom Java JAR file to an AIS Server on Oracle WebLogic Server:

  1. Deploy the JAR as a shared library on the same WebLogic Server on which the AIS Server (otherwise referred to as the JDERestProxy) is deployed.

  2. Restart the AIS Server using Server Manager.

  3. Edit the weblogic.xml inside the JDERestProxy.war/WEB-INF to reference the custom java shared library, for example:

    <?xml version="1.0" encoding="UTF-8"?>
    <weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                      xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd"
                      xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app">
        <session-descriptor>
            <cookie-path>/jderest</cookie-path>
            <cookie-http-only>true</cookie-http-only>
        </session-descriptor>
        <context-root>jderest</context-root>
        <library-ref>
            <library-name>CustomJava</library-name>
        </library-ref>
    </weblogic-web-app>
    
  4. Redeploy JDERestProxy from Server Manager.

9.3.2 Deploying Custom Java on AIS Server on IBM WebSphere Application Server

To deploy the custom Java JAR file to the AIS Server on Websphere Application Server:

  1. Add the JAR as a shared library:

    1. On WebSphere, expand Environment and select Shared Libraries.

    2. In ClassPath, add the path to the JAR location on the server.

  2. Associate the shared library with the JDERestProxy application:

    This image is described in surrounding text.
    1. In the left pane, expand Applications, Application Types, and then select WebSphere enterprise applications.

    2. Select the appropriate AIS deployment.

    3. Under References, select Shared library references.

      This image is described in surrounding text.
    4. Select the JDERestProxy check box and then select the Reference shared libraries button.

    5. Use the directional arrow to move the JAR file to the Selected group.

    6. Click OK.

  3. Synchronize Server Manager with the deployed application:

    Saving the configuration in Websphere will redeploy the application, but you must synchronize Server Manager to recognize the deployed application.

    1. In Server Manager, locate the AIS Server and update a setting in the Configuration section. This is required so that Server Manager detects a change in the AIS Server when you click the Synchronize Configuration button.

    2. Apply the changes and then return to the AIS Server home page.

    3. Click the Synchronize Configuration button to restart the AIS Server.