Bridging the gap to Fusion through our PeopleSoft Solutions Extenders
Grey Sparling PeopleSoft Expert's Corner
Oracle Blogs
 Subscribe Now!

Monday, August 23, 2010

PeopleSoft Component Interface Testing Tools

One of the projects that we have hosted on Code.GreySparling is a very cool way to work with PeopleSoft Component Interfaces. If you do any sort of testing or data loading or Component Interface development with PeopleSoft applications, then this is for you.

What's a Component Interface?

For those that haven't worked with Component Interfaces before, they provide programmatic access to PeopleSoft components and are used extensively within PeopleSoft applications as well as providing the underlying mechanisms for PeopleSoft Web Services. When you see Oracle Fusion in action at OpenWorld this year and it accesses anything from within the traditional PeopleSoft applications, Component Interfaces are likely being used under the covers.

PeopleBooks has good information if you're just getting started with Component Interfaces. Here's the PeopleTools 8.50 Component Interface PeopleBooks that Oracle hosts.

Introducing the Grey Sparling Component Interface Shell

Component Interfaces support other ways of accessing them than just from within PeopleSoft or Web Services though. You can also access them directly from Java, and that is what forms the basis of the Grey Sparling Component Interface Shell.

The Component Interface Shell provides an interactive shell where you can experiment live with PeopleSoft Component Interfaces (subject to your security of course). It's kind of like the Component Interface Tester inside of Application Designer, but with a few cool twists.

Component Interface Scripting

One important piece to the Component Interface Shell is that it's completely scriptable. As you're experimenting with a particular component interface in the shell, it's very easy to save off what you're doing as a reusable script that you can run again and again in the future. The scripts can be used for automated testing of PeopleSoft, automated data loads, or just as a starting point for future work in the Component Interface Shell.

The scripting language used is python, which can run on top of the Java Virtual Machine (the java implementation of python is called jython). Jython is also the scripting language used for the WebLogic Scripting Tool (WLST), so we're in good company :-)

Jim Marion of Oracle has a nice writeup on using different scripting languages from within Java/PeopleCode, so be sure to take a look at that if you're interested in more details about how that sort of thing.

Cross Platform

Ah yes, Application Designer is still Windows only, but there are a number of folks out there that want more choices (our App Designer on Linux blog post got a fair number of interesting comments :-)

The ComponentInterfaceShell takes advantage of Java's cross platform nature and allows you to connect directly from Windows, Linux, Unix, Mac OS X, etc. You can develop your scripts on one platform and deploy them elsewhere, so if you have a Mac laptop, but run PeopleSoft on Oracle Linux, you're good to go.

Multiple PeopleSoft Environments

Even better than being cross-platform is that you can use the ComponentInterfaceShell to connect to multiple PeopleSoft environments at the same time, even across different PeopleTools release levels. That's useful for verifying data between PeopleSoft environments or even copying data between environments.

Automated Testing

It's easy to hook up your ComponentInterfaceShell scripts with something like Hudson and use it for automatically running tests against your PeopleSoft environments. We'll have more to say about this in a future blog post.

Data Loading

PeopleTools has included the ExcelToCI tool for the last several PeopleTools releases and it works great for data loading. Especially for functional users that really like working within Excel.

If you need to take a more programmatic approach to handling your data loading though, then the ComponentInterfaceShell offers up the full power of python to handle things. Combine that with the ability to access multiple PeopleSoft environments at once, and you can solve some of your harder data loading/scrubbing issues fairly quickly.

Great, What Does It Cost?

The Component Interface Shell is free of charge for PeopleSoft customers. Even better, you can watch what bug reports and enhancement requests have been filed, what the most recent version control checkins for the Component Interface Shell were or even file your own.

The ComponentInterfaceShell home page is the place to get started with installation instructions and example scripts. Don't hesitate to contact us if you have any questions.

Labels: , , , , ,

Saturday, August 21, 2010

Adding Hints to Dynamically Generated App Engine SQL

Dave Kurtz has a nice writeup over at OakTable.net on using App Engine meta-sql to add hints to dynamically generated SQL.

I missed it when it was first published back in March, but it just came in handy for me. Thanks Dave!

Labels: , , ,

Friday, July 09, 2010

Syntax Highlighting for PeopleSoft SQL Traces

This is an update to our Editing Enhancements for PeopleCode and SQR blog entry, and was covered in one of our recent webinars for learning to be an expert in PeopleSoft.

One of the things you'll notice if you go through a PeopleCode trace is that there's way too much detail if you're trying to learn what's going on under the covers. We've found that if you can navigate to the page you want to learn about, turn on tracing, perform a few actions, and then review the trace, you'll pick it up a lot faster. The real question is how to do it.

Well, there's really two pieces:

  1. Providing a way to turn tracing on and off right at the point in which you want to record your SQL
  2. Provide a way to more easily review the SQL trace generated by PeopleSoft
So, we've put together an iScript that has the tracing in it for SQL as well as PeopleCode tracing as well as extending the user defined language file that already has PeopleCode and SQR syntax highlighting in it for SQL traces.

How to get it

Well, the PeopleCode can be accessed here.

The syntax highlighting file can be found here. To apply the syntax highlighting to Notepad++, merely go to %APPDATA%\Notepad++ and overlay the userDefineLang.xml file that's there.

Limitations and Enhancements

The current set of limitations and enhancement requests for this example can be found here.

Labels: , ,

Thursday, June 24, 2010

Query Tip of the day: Creating a Query from a PeopleSoft Component Name

One of the biggest challenges of end-users is to figure out where the data they want to query against resides. This is yet another tip from our "Advanced Query Tips and Techniques" webinar. By combining the PeopleCode Query Classes with knowledge of the PeopleTools tables underlying the component definition, you can provide a page that allows queries to be easily created.

Getting the Records to put in the Query

Probably the most important part of this is to figure out what records are in a component (and then subsequently weeding out the extraneous records from the list). This information is stored in the PSPNLFIELD and PSPNLGROUP records (the PSPNLGROUP record tells you the list of pages you need to look at, and the PSPNLFIELD record tells you what records and fields are on those pages.

Here is sample peoplecode that will log the list of records from a component.

Now, let's get to the good stuff

Instead of extending our code to get the records to include in the query, we will start with some code to create a simple query definition, and then extend it accordingly. Here is the code to create a "Hello World" query against the GL_ACCOUNT_TBL record.

Add multiple fields to Query

The next step is to extend our code to add multiple fields to the query definition. For the purposes of this step, we are hard-coding the record alias to be "A", and passing in the field name for both the query fielname and query field heading.

Here are the modifications to accomplish this.

Determine what fields to add the query

The next step is to add the logic to determine which fields we should add to the query from the current record. As the goal is to identify the records for a starting point, we are taking the approach of adding the key fields of the current record to the query.

This information is stored in the PSRECFIELD table, in the USEEDIT field. This field is a bitmap integer where each base-2 position is a switch for a different attribute.

Here are the modifications to accomplish this.

Dynamically add records to Query

Now that we've got a single record and its key fields being added to our query, the next step is to add more than one record by selecting against the PSPNLFIELD and PSPNLGROUP records.

In addition to putting in the appropriate selection and looping logic, it is important to keep track of the alias by which the record will be referred (this ensures that logic for adding the selected fields puts the fields in the proper place). To accomplish this, we are using the Char peopletools function and adding 64 to the index value (65 is the ascii value of "A").

Here are the modifications to accomplish this.

Expanding to handle more records

Because most components contain a lot of records and fields that do not match the key structure of the component, we limited our logic in the prior step to only bring in the GL_ACCOUNT_TBL. At this point, we will expand it to determine what keys are required from the search record, and then only include records that match at least one field from the search record.

To accomplish this, we will be looking at the PSPNLGRPDEFN record, in the SEARCHRECNAME field. The code creates an array of fields, and then a separate function will compare this array to an array that contains the list of fields of the current record to be added to the query.

Here are the modifications to accomplish this.

Expand to support more complex components

The last step is to address some complexities that come from more complex component definitions. These issues include the following:

  • Components with search records that don't have any keys (e.g. INSTALLATION table)
  • Related Displays
The related display information is also stored in the FIELDUSE field on the PSPNLFIELD record, but in a different position in the bitmap. For the search records that don't have any keys, we took the shortcut of taking the first record in the component and using its keys to drive what gets included in the query.

Here are the modifications to accomplish this.

Last Step - Create a Page

The last step is to create a page to allow users to create the queries by picking a component name.

You can go to the project home page to pull down the whole project for your own use. When doing this, you will want to open up the component definition in application designer and use the wizard to add it to the portal registry and add it to one of your permission lists for testing.

Potential Enhancements

The code discussed here does have a number of places where it should be enhanced as part of deploying it widely. Those can be viewed here.

Labels: ,

Tuesday, June 22, 2010

Query Tip: Updating the Effective Dates of In-Tree Criteria

One limitation of PeopleSoft Query is that when you use "In Tree" criteria, the effective date of the tree is forever stored in that criteria. When reading through the release value proposition of PeopleTools 8.5, I was thinking that feature to dynamicall prompt tree-nodes at run-time was going to also address this limitation. Alas, that was not the case.

Fortunately, through a little bit of PeopleCode, this can be rectified relatively easily.

Cool. Show me the stuff

I decided to implement this using application engine, since most organizations would want to update the effective dates of the queries periodically (most likely on a nightly basis). To simplify the content of this project, I wrote it to process any queries that have GS in the first two characters. You can look at the contents here.

Step 1

The first step is to create the app engine program and put in some PeopleCode to prove you can open up a query with it. Here is that code.

Step 2 - Find the Criterion

The next step is to walk the query object to find its criterion. Here are the modifications to step 1 to log the fieldname of the first piece of criterion.

Step 3 - Loop through all criterion

Now that we know how to access the criteria in a query, we will want to loop through it to do our work.

Here are the modifications to loop through all the criteria and log the field names.

Step 4 - Evaluate Criterion

Now that we can see all the criteria, we need to process only the in-tree criteria (since that's all we care about for updating the effective date).

Here are the changes to process the criterion and determine whether it's in-tree criteria. Note that this code has been put into a new function to simplify readability.

Step 5 - Get the Criteria String

On of the things that isn't documented well, is exactly where the criteria is stored. I spent a little time walking through the debugger in the application designer to determine that it's in the expr2constant1 property as a comma separated value string.

Here are the modifications to log that value.

Step 6 - Decompose the criteria string

The next step is to take the contents of the exprconstant1 attribute and break it apart into its component parts. This is done using the split function to create an array of values.

Here are the modifications to accomplish this.

Step 7 - Find the new tree effective date

Now that we've decomposed the criteria string and know what tree we're using, we have the ability to determine the current effective dated version. This is done by selecting against the PSTREEDEFN table using the keys of the tree.

Here are the modifications to find the most recent effective date and apply it to the appropriate place in the criteria string and log it.

Step 8 - Save the updated query

Now that we've determined how to update the effective date in the criteria, it's time to save that change back into the system.

Here are the modifications to accomplish this.

Final Step - Loop through the queries

So far, we've only been processing a single, sample query. Now it's time to expand this code to look at all queries that start with our prefix of GS.

Here are the modifications to accomplish this. And, without further ado, the culmination of our work without showing the diffs.

Limitations / Opportunity for Enhancements

There are several areas where this code should be enhanced as part of putting it into place in your environment. You can find a list of them here.

Labels:

Wednesday, June 16, 2010

Generating Query SQL from App Engine

How often has your DBA wanted to be able to quickly get a set of files containing the SQL of commonly run queries? Perhaps you'd like to make sure you version that SQL to make sure that you can see how it changes over time. With a little PeopleCode, you can do this pretty easily.

Take a look at what you can get when you version your query SQL. Pretty cool, right?

Yeah... How'd you do it?

Well, let me walk you through it one step at a time. Otherwise, the PeopleCode can get a little daunting. In order to simplify things, this example creates a simple app engine program with one section in it containing PeopleCode. This way, it can be run anytime you want (and even scheduled).

Step 1

The first step is to open a query and prove you did it successfully. Here's a link to the code that does this.

Step 2

Step 2 is to extend the PeopleCode to get the metasql property of the query object. Here are the changes to the original code (you may want to play with the settings of the difference viewer to see more of the code).

Step 3

Step 3 is to create a file from the query we've opened and gotten the SQL from. Here are the modifications for that.

Step 4

Step 4 is to loop through all the queries that beging with "GS" and create a filename with the queryname in it. Here are the changes for this.

So, here's the final Peoplecode

Check it out. Most likely, you've also seen your first set of code in Code.GreySparling.com.

Potential Enhancements

The code discussed here does have a number of places where it should be enhanced as part of deploying it in your environment. Those can be viewed here.

Labels:

Tuesday, April 06, 2010

The PeopleSoft/IBM backstory

I was having some beers at Pleasaton's (in)famous Hopyard last night and the topic of IBM and PeopleSoft came up. Specifically in the context of the announcement at the last PeopleSoft Connect conference about how we (PeopleSoft) were going to start heavily using the IBM WebSphere technology stack. Since I also had a regular blog reader come up and harass me at the table about a lack of blog entries this year, I figured that this would be a good one to write-up. Besides, it's been awhile since we've shared any good behind-the-scenes dirt :-)

So, what happened?

If you'll recall, at the time of the PeopleSoft Connect conference in Sept. 2004, PeopleSoft had been battling Oracle for about 15 months. Aside from dealing with Oracle, PeopleSoft internally had a major issue going on trying to figure out what to do architecture-wise. SAP had shipped it's new NetWeaver platform earlier in the year and were making lots of noise about it. PeopleSoft sales people and industry analysts were all asking "What is the PeopleSoft equivalent of the refrigerator slide?"

It was a classic example of something that was an issue in the sales cycle, but not an issue that PeopleSoft customers really cared about. Sales is always an issue to a public company, but when a single quarter of bad sales could mean that your company gets acquired by one of your biggest rivals, then you really don't want to miss your numbers, so the lack of a "next generation" application platform was a big issue.

PeopleTools 9 / PeopleTools X

We've written before about the ill-fated attempts at coming up with a PeopleTools 9, so we won't go into that too much here, other than to point out that by this point (mid-2004) that the name PeopleTools 9 was jinxed enough internally that the last attempt at coming out with it was called PeopleTools X instead.

At the same time PeopleTools X was being scoped and worked on, there was another effort under way to work a deal with IBM. What IBM wanted was for PeopleSoft to completely switch over to WebSphere as a development/runtime platform. This would go way beyond the way that PeopleTools ran on top of BEA WebLogic and Tuxedo; instead it would be moving everything over to WebSphere. As Craig Conway was quoted in the press release that came out at the Connect conference:
"This is the most ambitious, most aggressive announcement from IBM and PeopleSoft," Conway said. "Maybe the most ambitions from the enterprise applications business ever."
Definitely ambitious and aggressive, but the term that we used internally in the PeopleTools group for it was something that rhymed with buster duck.

The problem wasn't so much with WebSphere itself, it was with the idea that IBM could somehow come up with a hundred-plus engineers that were WebSphere experts, match them up with developers in the PeopleTools team, and the combined team could come up with something that would work for customers in a fairly short timeframe (while also continuing to put out additional PeopleTools maintenance releases along the way of course). PeopleSoft didn't have the bandwidth to make this happen, and it didn't seem like IBM would be able to steer it to successful completion either.

An Alternate Ending

So, what would have happened if Larry Ellison had given up on buying PeopleSoft at that point?

For starters, PeopleSoft and IBM would have had to finish negotiating the contract for this ambitious partnership. That's right, there was never an actual contract in place for all of this. I think that this came as a surprise to Oracle when they completed the PeopleSoft acquisition to discover that they didn't actually have to do anything to unwind the deal with the IBM :-)

Then, after a signing a contract, there would have been a lot of work to do. This would have been the equivalent of what Oracle is doing with Fusion, but with more challenges to making it work. Here's a few of the key problems that would have needed to be overcome:
  • No common ownership. It's hard enough to get large groups of people to work together when they work for the same company, but with two separate companies it is much, much harder. Even within Oracle, progress on Fusion applications was slow until Thomas Kurian took over Fusion applications in addition to Fusion middleware.
  • No customer buy-in. PeopleSoft customers weren't asking for a conversion to WebSphere, so the fact that doing that could have helped PeopleSoft stay independent wouldn't have meant much to them, especially since the cost of moving to whatever a "PeopleSoft built on WebSphere" would have been significant.
  • No executive buy-in. This is related to the previous point, but it's worth calling out separately. If Oracle had walked away and the deal with IBM had gone through, and PeopleSoft customers got put through the wringer as part of WebSphere move, all of the PeopleSoft project teams would be put in the awkward position of explaining to their management why these additional costs and headaches were happening. Essentially they would need to "sell" the partnership internally to their own management team. That's not a fun conversation to have.

Looking Backward

Looking back on the whole thing 5+ years later and it's interesting to see how things played out.

Oracle ended up being the ones to deliver PeopleTools 9, except that they took it one step further and made it backwards-compatible with existing applications and called it PeopleTools 8.50.

Oracle also realized that really nailing a next generation application platform takes some time. They have definitely taken a few hits on this, since some of the early estimates of when Fusion applications would ship were too optimistic, but I think that most PeopleSoft customers are fairly pleased with how things have turned out.


IBM probably wishes that they had actually signed a contract with PeopleSoft to make WebSphere the strategic platform (although I don't think you'd get them to say that now). Although Oracle continues to support WebSphere as a web server platform for PeopleSoft applications, we don't see anyone that is not already an IBM shop starting to use WebSphere for PeopleSoft.

Labels: , , , ,