Thursday, July 3, 2008

PeopleSoft outbound Sales Order to ESB

After just taking the Peoplesoft Integration Broker class, I was eager to get my first hand experience connecting Peoplesoft and ESB together. I found this great instruction on peoplesoft best practice site to get started. (ESB: Publishing PeopleSoft Outbound Sales Order to Enterprise Service Bus found on http://www.oracle.com/technology/tech/fmw4apps/peoplesoft/index.html)

This is a good case study to go through to demonstrate how to wire the Peoplesoft delivered application messages to external system.

Configuring Gateways and activating the Integration Broker Domains are the tasks that only need to be done once. Since I started working with a CRM discovery environment that does not have the Gateway set up before, that was the first thing I did.

CRM9.0 with PeopleTools 8.48 delivers some application messages and the integration points out of the box.

For the published application message CRM_SALES_ORDER, there is already a service and service operation defined with the same name. I just have to make sure the service/service operations are active. CRM_SALES_ORDER message/service use SALES_ORDER_LOAD queue which also already exists.

For the PeopleSoft Integration, we need to configure point to point routing. That includes configuring Node and Routing.

A Node representing ESB system needs to be defined in Peoplesoft. Since we are sending SOAP message out from Peoplesoft, the HTTPTARGET connector is selected.

A Routing is created by specifying sender node as PSFT_CR (default local node) and receiver node as SOADISC (the node ESB runs on). For the HTTPTARGET connector properties, we need to make sure it's SOAPACTION is set to "execute" and METHOD is set to POST. This is because SOAP binding only defines SOAP within HTTP POST requests. In the PRIMARYURL field, enter the same SOAP Endpoint URI that will be created later in ESB.

While configuring the Peoplesoft Integration Broker, I learned a few things.

Process Monitor is a good place to see if all processes fire correctly. In my case, The Process Scheduler was only configured for PSUNX and not for PSNT. I had to manually change all the associated Application Engine Process to run on PSUNX. There was not an obvious way finding out what Application Engine Process was associated with "Add Order" business flow, I had to just experiment. Each time a queued AE process in the process monitor points out some problem. The default scheduler get kick off seems to be PSNT which is the reason why the process didn't get run. Since queued process prevents progressing to next AE program, it took some time before I figure out all the AE process that needs to be configured to go to PSUNX. I suspect there is better way doing this.

By now, we are complete with the PeopleSoft side of configuration. There is still some step to go through in PeopleSoft but the purpose of it is to extracting out the message schema to facilitate creating of ESB project. For this Outbound Async one way wiring PeopleSoft application message to external system, we don't need to create a PeopleSoft Web Service. But we still go through the step to create Web Service next just to take advantage of the "Provide Web Service" function to get the XSD schema of the CRM_SALES_ORDER.

The "Provide Web Service" function generates a WSDL with inline XSD schema for any Service/Service Operation with an "Any to Local" inbound Routing. The steps we need to go through are:

1. Generate an Any-to-Local inbound routing for CRM_SALES_ORDER

2. Generate the WSDL

3. From the wsdl file, copy the part between “xsd:schema...” and “/xsd:schema”

Now we can move onto creating ESB process:

This part of the instruction is clear enough, but there is one thing worth pointing out. When we configure Peoplesoft routing, we supplied the SOAP Endpoint URI that will be created in ESB. What is being entered there has to match exactly what will get generated in ESB. It was not obvious at the first that what you put in when creating ESB System/Group become part of the SOAP URI. The mistake you will make if follow the instruction is that it had you put in "http://your_ip_address:port/event/PeopleSoft/Inbound/ReceivePSFTOrder_RS" in PeopleSoft Connector property setting. Later in the instruction on creating ESB System/Group, it asks you to enter "Peoplesoft" as name. After registering your ESB process, you will notice the SOAP Endpoint URI generated as :http://localhost:port/event/Peoplesoft/Inbound/ReceivePSFTOrder_RS". Notices the one URI spell “PeopleSoft” while the other "Peoplesoft". You could be ended up sitting there wondering why my ESB service is not invoked!