Tuesday, September 2, 2008

PeopleSoft Enterprise Portal Pagelet Consume CI-based WS wrapped in BPEL

We have PeopleSoft Enterprise Portal (EP), Campus Solution and other PS modules. We are exploring ways for PeopleSoft Enterprise Portal to serve up the information from other modules; also comparing the approaches for developers to use to enhance the user interface/presentation; enabling mashup with external information to serve in EP. The other considerations are to have a best solution that simplifies the future PeopleSoft migration and maintenance; allows for centralizing management/monitoring of business transactions. The current skill set of the available resources in house also dictates largely what the best approach to take for application development and customization is.

From PeopleTools 8.48 up, it becomes possible/easier for PeopleSoft to integrate with SOA framework. We have Oracle SOA suite in our toolbox we could take advantage of. Currently the approach 1 might be shaping up to be our leading contender for this type of pattern.

For an introduction to iScript, take a look at this link: http://jjmpsj.blogspot.com/2008/02/what-is-iscript.html?showComment=1210730760000. BPELUtil is a utility Application class specifically make PeopleSoft Web Service easier to consumed by BPEL.

Approach 1: EP pagelet form post -> iScript in EP -> BPELUtil -> target system CI-based WS wrapped in BPEL

With this approach, we have ability to mashup with external information in BPEL layer. We developed a generic snippet of iScript that takes form variables posed to it and makes a BPELUtil function call to a service endpoint passed in the parameters as well. This approach is suitable for both PeopleSoft and non-PeopleSoft data. For PeopleSoft CI-based Web Service, wrapping as partnerlink in BPEL could hide the complexity of PeopleSoft schema.

Approach 2: EP pagelet form post -> iScript in target system -> CI in target system

We have EP and other PeopleSoft modules in the same domain, this approach is feasible. With this approach, we will need to set up SSO between EP and the target system. The draw back of this approach is: Having iScript in target system adds another modification that needs to be migrated with production, in addition to having to be synchronized with EP. We are an institution with limited resources and in house PeopleSoft knowledge. Given that reason, we might want to avoid using iScript in the target systems entirely.

For documentation purpose, here is some useful hint on configuring SSO. You will need to setup the target system node in EP and the EP node in the target system; also specify the content and portal URL's for the node. In the EP pagelet PeopleCode, you could use the function GenerateScriptContentURL to retrieve the target system iScript URL. For the user that has data in target system, you may need to create the user in the EP; and you will need to set up permission list for the target system iScript.

Approach 3: EP pagelet form post -> HTTPBindingServlet (SOA suite) -> target system CI-based WS wrapped in BPEL

We discovered that this release of BPEL HTTPBindingService has limited functionality. It works well if input is one single string. It doesn't work for us since we need to work with input as complex type. Alternatively if we could put the entire input element as XML text in the input field, this approach is workable solution. This was also blogged about in this link: http://technology.amis.nl/blog/?p=2386.

In addition to the above approaches, we also explored a way to create an instance of a target system component interface from PeopleCode written in the EP database. This is not feasible because the meta-data required to create the component interface and the data required to populate the component interface doesn't exist in the EP database. We do not consider copying the target system registry to the EP application as this was not the recommended approach because of the maintainese issues.

Other approaches for PeopleSoft integration such as Application Messaging, File Interfaces, and Java Integration might or might not find a way in our environment. We will be continuously exploring.

Monday, August 4, 2008

Resolve Peoplesoft Process Scheduler Error

This problem has shown up again, although this time in different disguise. There are also extra steps involved to resolve the problem.

Problem: cs90disc only has PSUNX server configured (check under PeopleTools - Process Scheduler - Process Monitor menu, then Server List page). But in the Server Definition tab for PSNT under PeopleTools - Process Scheduler - Servers menu, the various process types are defined to run on this server. It might have been default setting. The important thing to remember is if PSNT is not configured; don't define any process types to run on PSNT.

If there are already existing service operations in the "New" state before you have chance to correct the PSNT settings, you need to cancel the service operation. In the Process Monitor page, you will notice the corresponding process is in "Queued" state, you will need to also change the Run Status to "Cancelled". Otherwise the Application Engine program PRCSYSPURGE will end up in "Error" state since it can't purge the PSPRCSRQST table because it detects some process are in "Initial" state but is not processing.

With the above works, it might still not solve the problem. What I had to do to finally succeed is to Purge Cache of App Server. You will need to go to PSADMIN to do that.

To speed up the testing of batch job, you could go to PeopleTools - Process Scheduler - System Settings menu, System Purge Options page, change the "Next Purge Date/Time" to be some thing close. Then go to PSADMIN to stop/start Process Scheduler.

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!

Wednesday, June 4, 2008

BPEL Console Security

We would like to partition BPEL domain by groups for multiple departments and/or interests. With the Oracle SOA suite 10.1.3.1.0 install, we have come to realize that the BPEL console security is very coarse grained - you can get in and do everything or you can't get in at all.

What this means is for example:
Group A owns domain D1 and have management access to D1,
Group B owns domain D2 and have management access to D2,
There is need for Group A to have read access to domain D2, but not being able to modify it. We are out of luck!

The other drawback is that If we want to tie in LDAP or OID as authentication model, it is a custom step.

Oracle do have plans for 11 release to support, I am not sure when we will have version 11 installed and tested.
  • Finer-grained control (read vs modify)
  • Tie in to SSO, LDAP, etc

Here is the exercise I went through setting up BPEL domain:

1. Login as oc4jadmin, create the domain D1.

2. As oc4jadmin, from JDeveloper, publish applications to D1. (When creating application server connections in the Connection Navigator, only oc4jadmin user account can be used. All other accounts including bpeladmin, default, do not have the RMI permissions. That means user foobar won’t be able to set up server connection without oc4jadmin account.)

3. Configure to use a XML based provider

4. Create a group/role "BPMD1DomainAdmin"
JAZN:> addrole jazn.com BPMD1DomainAdmin

5. Create a user "foobar" and grant the role "BPMD1DomainAdmin"
to the user.
JAZN:> adduser jazn.com foobar pwd
JAZN:> grantrole BPMD1DomainAdmin jazn.com foobar

6. Assign the domain admin permission to the "BPMD1DomainAdmin"
role by running:
cd C:\product\10.1.3.1\OracleAS_1\config
java -Xbootclasspath/a:/c:/product/10.1.3.1/OracleAS_1/bpel/lib/orabpel-boot.jar -jar c:/product/10.1.3.1/OracleAS_1/j2ee/home/jazn.jar -grantperm jazn.com -role BPMD1DomainAdmin com.collaxa.security.DomainPermission D1 all

7. Restart SOA suite. Now the user foorbar could login to BPEL console, and only see his domain.

Wednesday, May 28, 2008

Oracle AS ESB File FTP Adapter Part 2

Continued from Part 1:

With not much log message to go on when configuring ESB SFTP adapter, I decided to try BPEL SFTP adapter to see if that yields more hints. The strategy seems to help pinpoint the problem.

Here is the BPEL SFTP error msg in log:


JCA: Uncaught exception
oracle.classloader.util.AnnotatedNoClassDefFoundError in
JCA-work-instance:FTP Adapter-4 - cause:

Missing class: com.maverick.ssh.SshTransport

Dependent class: oracle.tip.adapter.ftp.SshImpl.SshImplFactory
Loader: FtpAdapter:0.0.0
Code-Source:
/C:/oracle/product/10.1.3.1/OracleAS_1/j2ee/home/connectors/FtpAdapter/FtpAdapter/ftpAdapter.jar
Configuration: <code-source> in
C:\oracle\product\10.1.3.1\OracleAS_1\j2ee\home\connectors\FtpAdapter\FtpAdapter

The missing class is not available from any code-source or loader in
the system.

The forums.oracle.com has one entry that mentioned that for Oracle AS B2B package, there is a patch # 6353697 available for getting SFTP to work. It makes one think that it is what I needed too but I got to find the confirmation and the right patch. After setting up access to Oracle Metalink, I came across an entry that points to the patch (# 5852001) I need. Since my SOA window install has different path setup, I have to correct the referred path in the patch before applying it. I am glad the final outcome is a success!

There are more things to try for the File/FTP adapter.

1. Test the Synchronous Read File operation, which reads the current contents of a file.

2. Test different options for when to write to new file. The factors are: Number of Messages, Elapsed Time, and File Size.

3. With FTP adapter, there are different methods for obtaining the modification time of files on the remote FTP server. I am able to use File System command “quote mdtm filename”, I need to experiment with Directory Listing and File Name Substring. For now, there is no time zone issue, since the time zone of the FTP server is same as the SOA instance.

4. We could use Public Key option to connect to SSH server.

Oracle AS ESB File FTP Adapter Part 1

We are prototyping how Oracle ESB File Transfer with Transformations works. This involves setting up File adapter and FTP (SFTP) adapter.

As always, I like to tackle a smaller piece before moving on. So I went with setting up ESB File adapter first.

Getting ESB File adapter set up is pretty smooth experience. Most of the time was spent on figuring out the exact off set for fix-length file transformation. Setting up ESB File adapter allows me to see how Oracle AS supports Unicode and what file format it supports. The Unicode test is successful. The native format builder works well with CSV file, fixed-length file. ESB console provides Processing Time statistics for each process.

I started out creating a schema file for validating incoming file format. I created a sample file (comma delimited) “sample_input_files\Student_Records_File_utf.csv” which contains all the fields that both output files require, and then feed this sample file into the Native Format Builder.

I then created a schema file for validating outgoing Josten system file format. I created a sample file (comma delimited) “sample_files_for_create_schema\Josten_File.csv” and then feed this sample file into the Native Format Builder. The output file produced is comma delimited Josten_TIMESTAMP.xls.

I also created a schema file for validating outgoing ParisDegree system file format. I created a sample file (fix length) “sample_files_for_create_schema\PARIS_Degree_File.txt” and then feed this sample file into the Native Format Builder. The output file produced is fix length delimited paris_degree_TIMESTAMP.txt.

Now it is time to move on to ESB FTP adapter.

Oracle FTP adapter documentation only provides instruction for setting up FTPS, which is not widely used anymore. UMS doesn’t have any FTP SSL in-house. After more googling and checking around, I decided to fiddle with the $ORACLE_HOME/j2ee/home/application-deployments/default/FtpAdapter/oc4j-ra.xml settings. I discovered that there is option to set useSFTP.

Instead of setting up a SSH server, I decided to test against Trillian SSH server.
The test is done with ESB FTP adapter. I turned on the logging output level to finest for oracle.tip.esb.server.service.impl.inadapter, That is very helpful.

The result is:
I am able to connect using FTP but getting some handshaking errors using SFTP. I checked the SSH config setting on trillion, it seems to allow publickey or password as AllowedAuthentications. I choose using password since it is easier to set up. The error I am getting is:
JCA: Settting up the SFTP connection with Transport provider=[socket]
JCA: Postcall, Closing managed connection.
JCA: The connection variable is null in postCall. This could be because of a call postCall w/o a preceeding call to preCall”

Continued to next blog article...

Monday, March 31, 2008

The university SOA project

The University has been relying on mainframe for its core business for the longest time. Mainframe is essentially an One-tier architecture: the presentation, application logic, and resource management layers are all in a single tier. Mainframe could be efficient because of some obvious advantages, for example the whole system shares a single execution context, no need to publish and maintain an interface, no complex data transformations and zero client development. But they are difficult and expensive to maintain at the same time. In some case, it has become unpractical to support the mainframe system due to vendor's discontinuation of the support and lack of clear understanding of the architecture with such system.

The technology changes such as Internet, the Web, faster and fatter connection, and the demand for electronic commerce has prompted the evolutionary of distributed information systems. Over the years in our environment, there have been consistent efforts of wrapping the underlying mainframe to expose the proper interface. The latest technology implemented is Web Services. The design is mostly driven by the characteristics of the underlying systems. The bottom-up design starts out examining the existing resources and the functionality mainframe offers then wrap the existing resources and integrate their functionality into a consistent interface. Presentation layer also adapt the output of the application logic so that it can be used with the required access channels (for example UPortal with Servlet approach) and client protocols. The advantage of Web services lies in their ability to make bottom-up designs more efficient, cost-effective, and simpler to design and maintain. The communication between mainframe, the wrapper web services, the Servlet presentation layer are synchronous interactions.

Fast forward to the current state of things, the University has purchased the PeopleSoft Campus Solutions to replace the legacy mainframe system. Campus Solutions is to provide comprehensive administrative functionality for students, alumni, faculty and staff. The fit-gap/conversion effort has been in place to identify if the out of box functionality satisfy the business need, what would be the pros and cons of customization and where would the customization make sense in terms of modifying business logic or bending the software to do what business dictates.

We have been using a more standalone RPC based Web service for components integration. This is more of a point to point solution. With purchased Oracle SOA suite, we now have plenty of the ammunitions on hand to address the Enterprise integration issue (EAI). Our focus would be to integrate current systems Campus Solution, CRM, ERP and have those all talk to one centralized bus (ESB).

One important part of the SOA suite is BPEL engine for service composition. BPEL is a domain specific language; it is designed to be used to program in the large. The mainstream BPEL adopt web services as its external communication mechanism, it depends on WSDL to describe outgoing and incoming messages. In a service-oriented world, services are not used as stand alone applications. Usually they are composed into bigger processes to solve a certain problem. WS-BPEL is a common standard for how processes should be assembled based on services, and defined through WSDL. WSDL and BPEL are both XML specifications with different roles in SOA landscape. WSDL is fairly low level language, it only describe the service from provider point of view. BPEL comes into play if there is need to describe the dynamic dependency of services.

One of the first benefits we found of BPEL is to shield us from the change of Campus Solution component interface. We discovered that when exposing Campus Solution components as Web Service, the XML is really verbose. This is due to how Campus Solution drives the xml from Peoplesoft components, how the fields are generated from the page and then map back to the elements in PS. Using BPEL to map the functional data only, we greatly simplify the XML.

With Oracle SOA suite, we will be centralizing the web services management layer so we could uniformly apply security, policy, logging, testing on top of the web service. The big part of any Enterprise application development efforts are concerned with the aforementioned management issues. In addition, the ease of deployment and version control concerns ranked high on the efficiency of the SDLC.

Wednesday, February 6, 2008

Adding Spring AOP into Glue framework

I have recently tried to use Spring AOP to provide crosscutting logging control to our existing Glue framework; it proved to be lot of pain without much gain. I might try AspectJ to see if it provides more way working with Glue.

The most of the difficulties lies in:

Issue 1: Trying to work with an unsupported product Glue doesn't help. There is no easy way to modify Glue internal binding process to add Spring AOP ProxyFactory way of instantiate new object.

Issue 2: There is literally no documentation out there regarding to how to configure spring to work with Glue and Resin.

The alternative I took for the Issue 1 is to bind to, for example, transcriptrequest proxy, it then create a new TranscriptRequestImpl the Spring AOP way:

public TranscriptRequest() {

ProxyFactory factory = new ProxyFactory(new TranscriptRequestImpl());

impl = (ITranscriptRequest)factory.getProxy();

}

This solution is workable. The disadvantage is that for each Web Service, we need to add a proxy.

Issue 2 turns out to be a harder problem. Spring throws the following exceptions when loading applicationContext:

org.springframework.beans.BeanWrapperImpl] ~ Invoked write method [public void org.springframework.aop.framework.ProxyFactoryBean.setProxyInterfaces(java.lang.String[]) throws org.aopalliance.aop.AspectException,java.lang.ClassNotFoundException] with value [[Ljava.lang.String;@21d23b]

org.springframework.beans.BeanWrapperImpl] ~ Invoked write method [public void org.springframework.aop.support.RegexpMethodPointcut.setPattern(java.lang.String) throws org.apache.oro.text.regex.MalformedPatternException] with value [.*]

Don't know why it's using org.apache.oro.text.regex instead of java.util.regex, maybe it is missing some essential components. It could be the problem with dynamically loaded code, specifically stuff that does a class.forName(...). Since they are dynamic in nature, so can't use any static typing info to figure out what is going on.

To verify the Java code is working, it is just the configuration problem. I programmatically added the advice to the ProxyFacotory, it works fine:

public TranscriptRequest() {

ProxyFactory factory = new ProxyFactory(new TranscriptRequestImpl());

impl = (ITranscriptRequest)factory.getProxy();

factory.addInterface(ITranscriptRequest.class);

factory.addBeforeAdvice(new TracingBeforeAdvice());

factory.addAfterReturningAdvice(new TracingAfterAdvice());

factory.addThrowsAdvice(new LoggingThrowsAdvice());

}

At the level of java code that I directly control, I could see the binding and when it happens.

If we programmatically add the advice to the factory, we could get the logging implemented. But this approach undermines the original purpose of adding AOP.