Pre-process XML Publisher Reports with XSLT

While I'm a fan of the XML Publisher, I find that anytime I try to get too complex with my RTF template I get myself into trouble. The User Guide provides some examples, but inevitably I want to do something a little different and it just won't come together. It might be that I've got the syntax wrong, it might be that there's a bug in the tool, or it might simply be that it doesn't do that.

Oracle has a good forum for support as well as a pretty good blog . Both are good tools when you are stuck. And since it's based upon open source tools, you've got Google as a reference, too.

However, for my most recent XMLP report, I decided to do some pre-processing of the data with XSLT, so that the xml data the report was built upon looked a lot like the report itself. The challenge of the report was that it required four columns per page, then 1-to-n number of rows for each column. Again, probably doable in the XML Publisher template, but at best it would be fragile.

Instead of trying to do it all within the plug-in tool, I did the heavy lifting in PeopleCode. First I created and populated a rowset with my data; then I used the PeopleTools application package PSXP_XMLGEN:RowSetDS which turns a rowset into an xml string with the method getXMLData; finally I called built-in function TransformEx to run the xml string through an XSL template.

With the transformed xml, creating the XML Publisher report was quick and easy. Now I'm using the XML Publisher to do tasks like formatting and page breaks—things it does very well. It also means the client will be able to make changes to the report template without having to address any complex logic.

Status Monitor Pop Up

Since the days of client-server and the desktop installed application, PeopleSoft has struggled with how to treat a pop up window. In the old days, the trusty DoModal let you ask the user for a small amount of info while keeping the main page clear of the details. Running in a browser, however, the DoModal function doesn't provide a good user experience.

There are a few ways to address this. You can launch new browser windows without the PeopleSoft portal navigation on the left. That provides a slimmer pop up. You can even get fancy with your JavaScript and remove the menu bar and tool bar. However, you've really just done a transfer to a new component. You're no longer part of the original component.

Then along comes the Status Monitor in the Approval Workflow Engine. A brief over view: The status monitor is an html area on the page that shows you the approval steps for the transaction. It's a nice, big and bright visual representation of the process. Additionally, it lets you add approvers to the transaction. If you click on the plus icon, up pops a small browser window asking you for a new approver. When you enter the approver and click OK, the window goes away and the Status Monitor back on the original page gets updated with the new approver.

How does it do it? How did it solve the pop up problem? I'm glad you asked, because I think the answer is a pretty slick solution.

When the plus button gets clicked, JavaScript opens up a new pop up window (there's no server trip here for the main component). The url of the pop up window is an iScript. The iScript returns html to create a small form in the pop up window.

So far, so good, but here's where it gets interesting. When the OK button on the pop up is clicked, two things happen. The first is a submit to another iScript containing the info the user filled out. That iScript post loads the submitted data into a global variable. The second thing that happens is in the response from the iScript. The response includes JavaScript that calls back to the main page then closes the pop up.

The call back to the main page is a function that sets a field then submits the main page. The field that was updated (a work field on the Status Monitor subpage) has FieldChange PeopleCode on it. When that FieldChange runs, it checks the global variable and adds the new approver. When the main page comes back, it has the new approver in the Status Monitor.

When I saw the feature I was impressed. When I dug into the code I was even more impressed. I have to tip my cap to the folks behind this one. They took tools we're all familiar with and put them together to build something new.

Approval Workflow Engine (AWE)

I had a chance recently to work with the new Approval Workflow Engine (AWE). It leverages Application Classes and is a great example of what's possible in PeopleSoft.

 After having worked long hours with it's pre-cursor, the AWE functionality is quite refreshing. For example, if you don't want to build a query to identify approvers, you can just build a sql object. And if you've got some complicated rules, there's no need to write complex and fragile sql, just use an app class instead.

If you're evaluating whether or not to use the new functionality, I highly recommend it. There is a learning curve, but there are delivered exmaples that help. It's also written in Application Classes itself, so as a last resort you can always just crack open the code to see what it's doing.

One must have is the Red Paper that gives an overview and walks through the steps needed to build it. PeopleBooks refers you to Customer Connection to find the Red Paper. If anyone knows of a public link to the Red Paper, please post it. What's missing, however, is a good API in the Java Doc style. That would go a long way toward helping developers understand what's available.

Welcome to the Website

Welcome to As a couple of former developers, we just love to talk about our work. When you're working hard on a feature, there are two moments that stick out above others. The first is the obvious Aha moment when you get it to work. The next one is even better, when you walk over to the desk or cube or office next door to show the feature and explain how you got it to work.

Now, it turns out our friends and family just aren't that interested in how a few light touches of JavaScript can really improve the UI of PeopleSoft applicatins. Try as I might to explain how iScript is a great backbone for AJAX, their eyes just seem to glaze over. And that's how the website came to be.

We hope to provide not only tips and tricks to help with PeopleSoft development, but also share some ideas about what's possible. There's a great community out there and this is our little hello.