PortX JD Edwards Connector for Mule 4 – Demo – Retrieve a UBE’s Job Status

Introduction

The PortX JDE Connector leverages the internal capabilities of Oracle’s JD Edwards EnterpriseOne™ solution to a broader extent, and uses the power of Oracle’s Java Dynamic Connector to provide interoperability with JD Edwards EnterpriseOne™ and external systems.

After reading this guide, you should be able to retrieve a bathc process’s status from the server by passing it a job id.

At design time, the PortX JDE Connector allows you to discover functions by name providing full access to all Business Function signatures. Given that discovery is a heavy duty process, the Connector manages a cache repository for all function’s metadata used at least once.

The results of a function call will be injected into the flow as a Map containing key-value pairs with the invocation’s output values. This approach gives the end user freedom of choice to construct complex flows and manage custom exception strategies.

Furthermore, you can have all functions in the flow, processing within the same transaction, and commit or rollback all changes.

Prerequisites

This document assumes that you are familiar with Oracle’s JD Edwards EnterpriseOne™ basics, Mule the Anypoint™ Studio interface.

Requirements

Demo - Retrieve a Batch Process’s Status

It is recommended that you update AnyPoint Studio before starting with a PortX JDE Connector project.

Creating a new Mule Project

Create a new Mule Project with Mule Server 4.1.1 EE or greater as runtime:

image

Project Dependencies

In you pom.xml, add the following to you repositories section :

<repository>
    <id>portx-repository-releases</id>
    <name>portx-repository-releases</name>
    <url>https://portx.jfrog.io/portx/portx-releases</url>
</repository>

Add the following to you dependencies section :

<dependency>
<groupId>com.modus</groupId>
    <artifactId>mule-jde-connector</artifactId>
    <version>2.0.0</version>
    <classifier>mule-plugin</classifier>
</dependency>
<dependency>
    <groupId>com.jdedwards</groupId>
    <artifactId>jde-lib-bundle</artifactId>
    <version>1.0.0</version>
    <classifier>mule-4</classifier>
</dependency>

Add or update the following to you plugins section :

<plugin>
    <groupId>org.mule.tools.maven</groupId>
    <artifactId>mule-maven-plugin</artifactId>
    <version>$\{mule.maven.plugin.version}</version>
    <extensions>true</extensions>
    <configuration>
        <sharedLibraries>
            <sharedLibrary>
                <groupId>com.jdedwards</groupId>
                <artifactId>jde-lib-bundle</artifactId>
            </sharedLibrary>
        </sharedLibraries>
    </configuration>
</plugin>

Required files

Copy the JD Edwards EntrpriseOne™ configuration files to the following folders within the project:

  • Project Root

  • src/main/resources

If there is a requirement to use different configuration files per environment, you may create separate folders under src/main/resources corresponding to each environment as shown below.

image

The mule-arifact.json file needs to be updated per environment as below

{
	"minMuleVersion": "4.1.4",
	"classLoaderModelLoaderDescriptor": {
		"id": "mule",
		"attributes": {
			"exportedResources": [
				"JDV920/jdeinterop.ini",
				"JDV920/jdbj.ini",
				"JDV920/tnsnames.ora",
				"JPY920/jdeinterop.ini",
				"JPY920/jdbj.ini",
				"JPY920/tnsnames.ora",
				"jdelog.properties",
				"log4j2.xml"
			],
			"exportedPackages": [
				"JDV920",
				"JPY920"
			],
			"includeTestDependencies": "true"
		}
	}
}

Other Considerations

To redirect the JD Edwards EntrpriseOne™ Logger to Mule Logger (allowing you to see the JDE activity in both Console and JDE files defined in the jdelog.properties, you may add the following Async Loggers to log4j2.xml file.

_<!-- JDE Connector wire logging -->_
<AsyncLogger name="org.mule.modules.jde.handle.MuleHandler" level="INFO" />
<AsyncLogger name="org.mule.modules.jde.JDEConnector" level="INFO" />

Troubleshooting

If you are having trouble resolving all dependencies,

  1. Shut down AnyPoint Studio

  2. Run the following command in the project root folder from the terminal/command prompt,

mvn clean install

  1. Open AnyPoint Studio and check dependencies again.

Configure the Global Element

To use the PortX JDE Connector in your Mule application, you must configure a global element that can be used by the connector (read more about Global Elements).

Open the Mule flow for the project, and select the Global Elements tab at the bottom of the Editor Window.

image

Click Create

image

Type “JDE” in the filter edit box, and select “JDE Config”. Click OK

image

On the General tab, enter the required credential and environment

image

Click Test Connection. You should see the following message appear.

image

You are now ready to start using the PortX JDE Connector in your project

Creating a HTTP Listener for your flow

NOTE : This use case example will create a simple flow to retrieve the status of UBE R000P_XJDE0001 from the Oracle’s JDE EnterpriseOne Server.

Log into your JDE EnterpriseOne, and navigate to submitted jobs. Find a previously submitted job for ube R0008P, version XJDE0001, and note the job number (248 in this case)

image

NOTE : (You can view the demo application “*Submit a Batch Process”*, for detail on how to submit this report from a flow)

Go back to the Message Flow tab

image

From the Mule Palette (typically top right), select HTTP, and drag Listener to the canvas

image

Select the HTTP Listener component from the canvas, and inspect the properties window

image

The connector requires a Connector Configuration. Click on Add to create a connector configuration.

Give the HTTP endpoint a more descriptive name like get-ubestatus-http-endpoint and press OK to go back to the global HTTP endpoint dialog box:

image

Add a path to the URL eg. getubestatus

image

Select Mime Type, and add a parameter for job number

image

Save the project. The connector will be ready to process requests.

Get a UBE’s Status

Locate the JDE Connector, and select Get batch process information. Drag this to the canvas.

image

Drag the connector over to the canvas. Select it and review the properties window.

image

Under the General section, click on the drop-down for UBE Name / Operation

image

You may now assign the input parameters. You can do this by either entering the payload values manually, or via the Show Graphical View button.

image

Map the query parameter jobnumber to the Job_ID input parameter, and click Done

image

Troubleshooting

If the operation fails (possibly due to a timeout), you will see the below message

image

Please review the timeout settings in Anypoint Studio's Preferences.

To do this go the the Window > Preferences menu

image

Go to Anypoint Studio > DataSense and change the DataSense Connection Timeout setting as below

image

Go to Anypoint Studio > Tooling and change the Default Connection Timeout and Default Read Timeout settings as below

image

Set Payload Output

In the Mule Palette, you can either select Core, scroll down to Transformers or type “Payload” in the search bar.

image

Drag and drop the Set Payload to your canvas.

image

Select the Set Payload component, and review the properties, and click Show Graphical View.

image

Change the payload to reflect the desired output, and save the project

image

Testing the Mule Flow

To Test your flow, you need to start the Mule application. Go to the Run menu, and select Run.

image

After the project has been deployed, you can test you flow by typing the URL into a web browser eg. http://localhost:8081/getubestatus

image

Handling exceptions

From your Mule Pallete, select and drag the Error Handler to your canvas

imageimage

Now select and drag the On Error Continue into the Error Handler

image

Select the On Error Continue scope, and under Type enter JDE:ERROR_GETTING_JOB_STATUS

image

NOTE : The operation error types can be seen when selecting the operation on your canvas, going to Error Mapping, and clicking add. You may also map this error to a aplication specific error.

image

Drag the Set Payload component to the Error Handler, and set an appropriate message

image

PortX JDE Connector – Demo Projects

Additional Demos

There are additional demo applications with step by step guides available for download. These cover all the basic operations, and are