Thursday, March 02, 2006

PeopleCode to Java

A couple of my x-Team-members told me recently that they would be a part of the Team which would build the PeopleSoft-Oracle Fusion Upgrade (Note: I was never part of ORACLE Corporation and will never be.). I was exited about this and thought I would post some ideas that I would have implemented if I were to do this.

Most of the blogs that I’ve read recently point to one of the most crucial aspect of this Upgrade – Replacing PeopleCode with Java. I will post some thoughts of achieving this and then talk about the object level differences. The amazing thing about PeopleSoft upgrades is that they make life of an Upgrade Consultant to be a cake-walk.

The Fusion team must first concentrate on building an application which would parse the PeopleCode and convert them into Java equivalents. Make modifications to PeopleTools so that the compiler will actually compile Java instead of PeopleCode. Now, anybody who has written a small piece of code to parse a file will know for certain that the amount of time required to parse the file is going to take ages. Let me give you an example, I used to upgrade SQRs from older PS release to newer releases (7.5 to 8.8). PERSONAL_DATA was a pain – if an SQR had PERSONAL_DATA in old release, then in 8.8 it was not available to upgrade the SQR we had to replace PERSONAL_DATA with PERSON, ADDRESSES, NAMES and PERSDATAEFFDT depending on which fields were selected from PERSONAL_DATA, i.e. if in the old release NAME was selected from PERSONAL_DATA we had to replace it with NAMES and add two more criteria (NAME_TYPE = ‘PRI’ and EFFDT = current date). The code that I wrote had to check for so many different possibilities (Nobody follow standards!) and also take care of the documentation within the SQR ( “! Modified by ps-guy” – this kind of stuff for each modification). I think that is enough (I feel bored about it!), the point that I’m trying to make here is, when I finished this code I astonished by the amount of memory constraint on my machine and the amount of time it took, although I used a very efficient logic (This could also be attributed to the fact that I’m a VB programmer and not a Java geek – Too lazy to learn something, VB and PeopleSoft did not require any effort – Refer to the Title “Driven by …” – a small note here planning to change the Title to “Powered by PeopleSoft Motivated by MicroSoft”). The other important aspect of an application performing that job for you is that you do not have to do it anymore – Keep your machine busy rather than yourself. Although there will be huge amount of constraint on the time required for the application to complete this conversion of PC (PeopleCode) to Java it could save the effort.

But I think that ORACLE should plan this properly, Replacing Java compiler for PC compiler should be done with one more release of PeopleTools (say Tools 8.9, I heard that work for Tools 8.48 has started). Build PC-Java Converter and convert all the PS delivered PC for Application 8.9. Now the PS QA team (PS QA has a total strength of approximately 60 people for HR CORE compare this to 5 people on ORACLE side – Info based on yesterday’s discussion with my friends – PeopleSoft does not treat QA lightly) - will have their part to play, they will have to test all these conversions and make sure that they work as they used to. If any error is found then PC-Java team must review the code and try modifying the application to handle this scenario.

Once PC-Java is internally tested ORACLE could deliver it to the clients so that they can convert all their Customizations in PeopleCode to Java. The PC-Java application must allow the user to select all the PeopleCode that he wishes to convert (This will allow me to convert only the Customized PC and replacing the Non-Customized PC with the new delivered Java Code), thus reducing the amount of time required at the Client location. The application must allow the user to phase the conversion of PC to Java.

So will the PC-Java converter do the trick for us? It will to a certain extent, but still there is an issue of Customer training. We cannot ignore this factor as a Client would have recruited 100 Consultants with PC skills, they being his permanent employees and he cannot do away with them. For this ORACLE must take an initiative which would benefit them in the long run. ORACLE must provide Java training to all the Clients and Partners at their own expense. This would motivate the Clients in moving to Fusion (A benefit in the long run!).

I have solved the PC – Java puzzle to a certain extent (I strongly believe that this can be achieved!). How about the other objects? It still remains a mystery to me as to how ORACLE is planning to store the objects (Fields, Records, Pages etc…PS terms). I do have some idea on the approach that ORACLE will be taking and as always have a plan to clean things up – I’ll reserve that for a later post.

This is how I would handle Fusion Migration. If you have better ideas do let me know.

10 comments:

Anonymous said...

Let me ask, what makes you conclude Oracle is converting PeopleCode to Java?

Couldn't they shortcut it and simply write fusion in Java (taking designs and data models from Seibel and PS, but not actual code). This way come upgrade time they just map the PS data model to the fusion data model with SQL, ETL, etc. Then the customer is forced to re-write (re-apply for marketing people) customizations in Java.

I mean, why convert when they can map and force re-customizations? They have already strongly told customers to de-customize. I don't see them doing this if they had a converter or if they had confidence in their converter.

PS-GUY said...

hmmmm....

ab,

The problem with providing Fusion with Java and then forcing the Customer to re-write customizations will be mostly like an implementation rather than an upgrade (I'll justify). PeopleSoft NA labs were able to provide Customers with a fast-track upgrade (Remember NOW Upgrade!) and saving the Customers a lot of investment.

There a couple of folks who I know are mapping PS data model to SAP data model, this might make these vendors provide a cheaper migration from PS to SAP than PS to FUSION (Rates are not uniform throughout the world and a cheap vendor with this capability could do havoc).

Upgrade is not just data model mapping! It must move the Customer to the latest release with as little fuzz as possible. Thats y I believe that ORACLE must phase it out and not hurry with things, but ideally this is what I believe is going to happen. Most of the PS customers would wait because of the extended support and ORACLE with its requirement of bringing the Customers to FUSION would start providing better upgrade paths.

Anonymous said...

No doubt it is a re-implementation. I agree. I think the lifetime support is a tool to ward off SAP from stealing customers (position it against TomorrowNow). I think Oracle will try to offer a move-at-your-own-pace path, but I still think a re-implementation is likely.

And, if it is a re-implementation, you have to price out re-implementing on SAP, although I believe those numbers would be higher.

Anonymous said...

A great post and something I have been thinking a lot about. Here is a slightly different idea that I have been working on:

Rather than convert code-level PC to code-level Java, why not write an extension to PC to compile it down to Java bytecode and then mix-and-match it with Java extensions in Fusion. Oracle has declared they are abandoning PeopleTools and PeopleCode with it.

This is in essence the model of .NET where all languages compile down to IL and run together. I did some research on this and was amazed to see over 40 .NET languages that compile to IL (check out wikipedia - they list them). Some are MicroSoft (e.g. VB.NET) and others are 3rd party projects. I was only able to find only one language (Groove) that compiled to java IL. Part of the problem is that the Java syntax/language has become synonymous with the architecture, which is in fact not necessary.

While there are clearly differences between PC structure, events, exception handling, etc.. the componentized architecture of Java makes this very possible. Microsoft solved this problem by adding extensions to their core languages to retrofit them into the IL framework. My vote would be to add extensions to PC and compile it straight to bytecode.

Intersted to hear what you think. I'm gonna get around to finishing my blog entry on that soon.

Great blog - keep it coming,
Niel

PS-GUY said...

Niel,

That was a good one. The extension will allow the Customers a choice between PeopleCode and Java. I do not think ORACLE will buy the idea of allowing multiple language support in FUSION (May be they are just blinded by the concept of making everything 'standardized'). A choice of coding language will actually remove the requirement of Customer training.

Can't wait for your post on this!

PS: I have a small question on Newmerix (the Test Script maintainance application). Is it PeopleTools compatible? I think it would be of great value if it can help me maintain my Test Cases after an upgrade.

Chris Heller said...

There are actually a huge amount of languages that complile to Java byte code.

In fact, you can do things like run server side Python, Ruby, JavaScript, or Groovy from within PeopleSoft.

Here's a little puzzler for you to think about before trying to compile PeopleCode to Java byte code.

Local JavaObject &someThing = CreateObject("com.blah.does.something");
If DoModalComponent(blah, blah, blah) Then
&someThing.method1();
Else
&someThing.method2();
End-If;

This will fail at runtime. Why? And what does that mean for PeopleCode compiled to byte code?

PS-GUY said...

Chris,

I have never coded in Java or in any programming languages other than PeopleCode or Visual Basic, i.e. not a geek. My understanding of your puzzle is only from the logical aspect of it, basically because I'll not be able to distinguish different programming languages. The reason could be attributed to absolutely no programming done in school and my total IT experience is just 1 year and 9 months (I do not feel bad about it, this is one thing which motivates me and makes me feel that I have a long journey ahead).

Back to the puzzle. I think that the piece of code that you have written actually assigns a OLE Automation object instead of a Java Class to the Java object (This is just a guess, after I went through PeopleBooks!). This code when compiled by the PeopleCode compiler would know how to handle the OLE Automation object but when compiled to byte code we must have issues in handling this scenario.

The complexity of this scenario could be removed if we could build the logic which drives our PeopleCode compiler into our Extension which compiles PeopleCode to Java byte code.

I would like to hear your comments and the right solution to your puzzle.

P.S:This puzzle actually stole my sleep away!

Jim Marion said...

Answer to Chris Heller's puzzle:

In the PeopleBooks PeopleCode API Reference, you will see a Java Class topic. In this topic, select the From PeopleCode to Java link. Under that section, you want to look for the heading State Management Concerns. As this PeopleBook topic explains, Java objects have to be stateless, meaning they cannot persist between client requests. They are only active for the code that executes during a single request. A call to DoModalComponent sends a response to the client. The client's response is sent back in a separate request. Therefore, PeopleCode that calls DoModalComponent actually contains multiple requests.

A call to DoModalComponent sends a response to the client ending the current request. The PeopleCode appears to pause while waiting for the DoModalComponent function to complete. Unlike PeopleCode objects, The JavaObject is not persisted between requests, and therefore, contains an invalid object reference when the DoModalComponent function returns.

PeopleSoft says it doesn't persist the state of JavaObject's because the client's next request may execute in a different JVM than the previous request (different app server).

This doesn't mean you can't use a JavaObject across a call to DoModalComponent. For example, I use log4j a lot in my PeopleCode. What it does mean is that you have to implement your Java class in a manner that will facilitate "stateless" calls (such as static methods). Another alternative is to implement the serializable interface and persist your object between calls. If your users will always connect to the same app server during their session, then you can probably create a singleton object that contains a Hashtable or other mapped collection of JavaObjects. With this Hashtable, you would be able to retrieve your objects across requests.

I first ran across this behavior when trying to use a Java Hashtable as a component variable.

Chris Heller said...

Bingo!

The PeopleCode runtime engine can serialize it's entire state; the execution as well as the variables. When a "thinktime" function returns from the client side, the code begins executing on the next line.

JVMs can not do this.

Now, having said that they can't do that, there are some people doing interesting stuff with continuations out there.

Rhino (Javascript implementation on top of the JVM) has just recently started supporting continuations.

https://bugzilla.mozilla.org/show_bug.cgi?id=258844

The Seaside web framework is also interesting to look at with respect to continuations.

http://www-128.ibm.com/developerworks/java/library/os-lightweight8/index.html

And, there's even an prediction market set up for whether Sun will add continuation support to the JVM.

http://www.inklingmarkets.com/market/show/87

Here's some more good reading about what continuations are and how they work.

http://www.intertwingly.net/blog/2005/04/13/Continuations-for-Curmudgeons

PS-GUY said...

Firstly, thanks Jim.

I'm in a hurry would like to write a tribute on this, probably on Tuesday, after vacation.

Thanks Chris for taking your time.