This chapter contains the following topics:
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 IoT 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.
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
.
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.
Custom rule Java classes should implement the com.oracle.e1.rest.orchestrator.customjava.CustomRuleInterface
which requries 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.
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:
Deploying Custom Java on AIS Server on Oracle WebLogic Server
Deploying Custom Java on AIS Server on IBM WebSphere Application Server
To deploy the custom Java JAR file to an AIS Server on Oracle WebLogic Server:
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.
Restart the AIS Server using Server Manager.
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>
Redeploy JDERestProxy from Server Manager.
To deploy the custom Java JAR file to the AIS Server on Websphere Application Server:
Add the JAR as a shared library:
On WebSphere, expand Environment and select Shared Libraries.
In ClassPath, add the path to the JAR location on the server.
Associate the shared library with the JDERestProxy application:
In the left pane, expand Applications, Application Types, and then select WebSphere enterprise applications.
Select the appropriate AIS deployment.
Under References, select Shared library references.
Select the JDERestProxy check box and then select the Reference shared libraries button.
Use the directional arrow to move the JAR file to the Selected group.
Click OK.
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.
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.
Apply the changes and then return to the AIS Server home page.
Click the Synchronize Configuration button to restart the AIS Server.