Sunday, August 19, 2012

SOA with JD Edwards Real Time Events


This article provides basic steps to configure a Real time event in JDE and consume in Oracle SOA server.
Product versions
- JD Edwards 9.1
-  Transaction Server over Weblogic AS 10.3.X
- Oracle SOA Suite over Weblogic AS 10.3.X

Assumption
 JDE and Transaction server are already in place. Transaction server is setup as per Oracle's standard guidelines.

RTE
JD Edwards EnterpriseOne provides feature of generating events when a business transaction occurs in the system. These events can be consumed by 3rd party systems to capture detail of business transaction.
There are many events available out of the box like : Sales Order, Addresbook, Customer, Item master, Equipments.. to name a few. In this article I will take a Sales order event as an example.

Scenario
Whenever a new sales order is created in JDE a 3rd party system needs Order detail in real time. This integration can be achieved with following steps :

Step 1: Configure Sales Order RTE
Step 2: Configure Queue on Transaction Server
Step 3 : Configure Oracle SOA server to communicate with RTE Queue
Step 4 : Consuming Events using SOA Composite

Step 1: Configure Sales Order RTE

In JDE fast path execute the program P90701A. It will open up a Event Definition Workbench.
Search for Sales Order event RTSOOUT2. 
(Note : RTSOOUT2 is a container event which is made up of 2 single event RTSOHDR2 and RTSODTL2, used for Sales order header and Sales Order detail respectively).


Select RTSOOUT2. It will open up Event entry form.Verify following configuration :
Event category - RTE, Event Aggregate - Container , Product Code H42. 
Similarly for RTSOHDR2 and RTSODTL2 Event category should be - SINGLE. 
RTSOHD2R follows data structure D4202410A and RTSODTL2 follows D4202410BD.

 


Once RTSOOUT2 configuration has been completed and\or verified, from P90701A, take the ‘Event Activation’ Form Exit. Add a recordRTSOOUT2 for RTSOOUT2 for the appropriate environment like DV / PY etc.  Ensure the RTABOUT records are at status ‘AV’(Active). 


Step 2: Configure Queue on Transaction Server
Now, above event needs to be mapped with a JMS queue in transaction server. lets name the queue as 'SalesOrderQueue'. (Verify that the H90\AS UDC Table has an entry for WebLogic AS).

Run P90702A and add a subscriber as follows.


Activate Subscriber: Run P90702A, find the Subscriber created in the above step. Select the ‘Row\Change Status’ option. Make sure the Subscriber status is ‘AV’ (Active).

Event Subscription: Run P90702A. Find the Subscriber you created in the above step. Take the ‘Event Subscriptions’ Option. Add to create a Subscription. provide any value to Subscriber name and description. Don't forget to change status from NA to AV.

Add event to Subscription: Find the subscription created above. Select the ‘Subscribed Events’ Row Exit. Add RTSOOUT2 event as shown below.


Add environment as required.

Now, create a JMS queue jms/SalesOrderQueue and connection factory jms/SalesOrderConnection in transaction server using Weblogic console. Steps are standard for creating queue in Weblogic. provide target as RTE server (RTE Server I assume already in place).

Step 3 : Configure Oracle SOA server to communicate with RTE Queue.

Since SOA server would be deployed on separate weblogic AS we need to create a foreign server on SOA local weblogic that will point to Transaction server queue.

Login to weblogic admin console. Create a new JMS Module (Or use existing SOA module just for testing. Though not recommended in QA or Production environment) .


Select the module and create a Foreign Server with any name. I named it JDE91PY_ForeignServer. Provide Transaction server detail as shown in screenshot below.


Create new destination for the queue. Provide Transaction server queue name as Remote JNDI name. and any name as Local JNDI Name. Local JNDI name will be used to search Queue in local SOA Domain.


Similarly create a connection factory with remote and local connection factory information.



We also need to create connection pool to retrieve JMS connection from local connection factory. For that go to deployments-> JMS Adapter -> Configuration -> Outbound connection pool -> New Outbound connection with properties as shown below.


With this SOA weblogic configuration is complete.
 (Please note these are the basic steps for initial setup to get going. there might be many other parameters need to be setup in production environment.)

Step 4 : Consuming Events using SOA Composite 

Now we just need to create a SOA composite in JDeveloper with a JMS adapter to consume queue. provide local JNDI and local Connection factory name  while creating adapter.

To consume JMS message we need a schema of Sales order event. The easy approach I followed is as follow:
- Undeploy the SOA composite that has JMS adapter for sales order.
- Create a new sales order in JDE. it will generate a event in JMS Sales order queue we created above.
- Go to queue monitoring and copy the XML content of the queue in text file.
- Generate schema from XML content. and use this schema in SOA composite and input structure of JMS message.
- Now create composite and deploy on enterprise manager.
- It should start receiving RTE as soon as Sales order is created / modified in JDE.

When desired data not available in RTE :
There might be scenario when all data required to 3rd party system may not be avaiable in RTE. in this case either a JDE business service can be created to fetch data or a custom RTE, data structure will require to be built. Most of the time customer may not like to customize standard JDE setup. so Business Services should help in this case. 
Once we have all data in SOA composite we can parse the way 3rd party system needs and send it accross.
 

16 comments:

Gaurav Gupta (Twitter @GauravGupta_99) said...

Don't forget to set transaction attribute in SOA composite while communicating with JMS Queue

Ashim said...

Hi Great post. You seem to be very knowledgeable. I have a question. Can you please help??

Question: Will you know pros and cons of E1 RTE-Transaction Server VS Business Service.

you help is appreciated.

Gaurav Gupta (Twitter @GauravGupta_99) said...

Hi Ashim, RTE and JDE business services are not right candidate to compare. They solve different purpose.
RTE is useful to get data in real time as soon as a transaction occurs in JDE. e.g. new customer created or existing order modified. how outside world would know about these transactions? JDE RTE is the solution. any outside application can get this data almost immediately from JMS queue created at Transaction server.

Business service is an approach to expose JDE objects (business function, Table) to outside world as web services. or business services can consume webservice exposed by outside world.
e.g if a CRM application needs to know what is credit limit of a customer it can use business service to query credit limit based on customer number as many time as it needs.
Hope this explanation helps.

Anonymous said...

Thanks. Simple and easy to understand.

Venky said...

Hi, thanks for this post, clear and simple. I landed on your blog while searching for options to have the RTE in JDE to invoke web services rather than send messages to a queue. From what I understand, RTE in JDE is delivered only via messages.

Do you know if the Oracle SOA suite can be configured to make a web service call upon receipt of an event from JDE?

Would that be the only way to make a service call from a JDE event?

The business case we have is to integrate a third party system with JDE, and this third party system does not have the ability to read message queues.

Appreciate your insight on this.

Gaurav Gupta (Twitter @GauravGupta_99) said...

Venky indeed SOA suite is the candidate for this scenario.
You can use OSB or BPEL to consume message from RTE JMS Queue.

My recommendation would be to use OSB to consume RTE. then call a BPEL process that contains business logic and takes care of invoking 3rd party web-service.

you can also call a webservice from OSB proxy if its just validation, transformation and invoke.

Anonymous said...

Thanks Gaurav, Very useful blog.
Is there anyway to get same RTE to multiple BPEL or 3rd party systems? Where can we configure that ?

Gaurav Gupta (Twitter @GauravGupta_99) said...

I would suggest to use a Service bus layer that will consume message from RTE queue and publish to a topic. later you can have as many Proxies / BPEL / other applications subscribing to the topic.

Anonymous said...

Hi Gaurav, first of all thank you for this useful post.

I need to write RTE for inventory events. Could you please help me on this.

Apart from configuring SOA is there any other way (I prefer some Java program) to read from JMS queue ?

Gaurav Gupta (Twitter @GauravGupta_99) said...

For Inventory please check RTIMOUT2,
this is the out of the box event.
Yes You can read from Java program as well. Transaction server keeps messages in JMS Queue. so its upto you how you want to consume it. For Java I would suggest to have a layer responsible only for message consumption, filtering and throttling and then pass right message to the business layer.

Venkat said...

How do i debug RTE publishing?

-->installed 9.1 on windows 7
--> configured Configure Sales Order RTE as per your blog
--> Created Queue in external weblogic
--> Configured Queue in JDE
--> Created and modified sales orders in JDE
But no messages were transmitted to Queue!!!

KeerthiPrince said...

Very Nice post,, useful. Thanks

Anonymous said...

Hi Gaurav,

Can we have RTE without SOA in E1 9.1?

Thanks
MUNISAMY

Gaurav Gupta (Twitter @GauravGupta_99) said...

Hi MUNISAMY, You can use RTE without SOA. RTE is feature of JDE. You can have your own queues and code for event consumption.

Io said...

Hi Gaurav, thank you for your great post.. clear and simple!

I have an issue regarding the JMSType not displayed (or not defined?) on the message seen in the Weblogic Server.
I need to send that type in order to let the 3rd party system choose the procedure to performe.
Could you help me?

I'm using RTE without SOA and I'm working on RTRECOUT and RTIBOUT2 events.

Thanks in advance.

Laura.

Sports education worldwide said...

Nice post thanks
alternatives to kissanime