Decode PeopleCode

There's a great Open Source project available on SourceForge.net which allows you to decode PeopleCode bytecode from your PeopleSoft environment. It can also extract SQL text.

The extracted text can either be stored in separate files, or submitted to a version control system (either Subversion or Git). Or particularly useful way to use the program is to let it submit all recently modified PeopleCode/SQL in a nightly script.

You can download the latest version of the project from here. At the moment it is still in beta, and may not work 100% right, but certainly worth a try.

Once you've downloaded the project, here's how to get it going (this is more focused on Oracle databases):

Decode PeopleCode

First, if you know specifically what PeopleCode you want to extract, place the relevant definitions into a project, for this example, I'll call that project SAMPLE.

Extract the zip file.

Depending on your database platform, you'll need to find the appropriate JDBC driver. For SQL server, this file will need to be called sqljdbc.jar and for oracle it will be called ojdbc5.jar. You can get these using a quick Internet search. For the oracle drivers, you can also just browse to your oracle client home, and they are available under jdbc/lib. You might be able to use a higher version of the driver, e.g.ojdbc6.jar; JDBC drivers are available for other databases as well. Copy the file to your Decode PeopleCode directory. If you use a driver other than sqlbc.jar or ojdbc5.jar, adjust the 'classpath' parameter in the batch file(s) you'll be using.

Next, you'll need to update the DecodePC.properties file. If you are using SQLserver, comment out the Oracle section and uncomment the SQL server section. For oracle, enter the appropriate user, password and schema owner (only read-only access to the PeopleTools tables is required). The JDBC url will be a bit tricky. To work this out, find your tnsnames.ora entry.

For example, if this is your tnsnames entry:

DBNAME, DBNAME.WORLD =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = specificserver.example.com)(PORT = 1521))
    (CONNECT_DATA = (SID = DBNAME.EXAMPLE.COM))
  )

Then, this would be your JDBC url:

url=jdbc:oracle:thin:@specificserver.example.com:1521/dbname.example.com

Save, the go to the command line and run the DecodePCODE.bat file (or its equivalent shell script) using parameters like:

C:\Temp\DecodePCODE.bat SAMPLE
C:\Temp\DecodePCODE.bat since-days 7

If you get any sort of Java stack error:

  • Check your DecodePC.properties file, have you got the correct user, password, database owner and url?
  • Did you copy the relevant JDBC file to the same directory as DecodePCODE.bat and rename it accordingly?
  • Can you connect to that database using the relevant SQL tool?

If it works, it will place all the files into a directory called output.

Project to File

When you pass this script the name of an exported PeopleSoft project (XML file), it will read it and extract all PeopleCode:

DecodePCODE.bat YOUR_PROJECT.xml

All output is put into a folder with the same name as the project, and subdirectories are created for relevant PeopleCode types. Incidentally, the tool also stores the text from SQL definitions.

Export to a Subversion version control system

Arguably the most useful feature of Decode PeopleCode is that it can directly submit the decoded PeopleCode and SQL text to an SVN (Subversion) repository. Usage is the same as DecodePCODE.bat, but you need to call a similar batch file DecodePCODE_SVN.bat (you also need to download an additional library: svnkit.jar, and you have to specify SVN connection parameters in the properties file). If you schedule a recurrent job which executes

DecodePCODE_SVN.bat since-last-time

the tool will submit all recently changed PeopleCode and SQL text, so that you will have an automatic and zero-cost method to track all changes in PeopleCode and SQL text. It is possible to configure the tool to process several PeopleSoft environments, each with a different SVN branch.

You can then use any of a number of excellent tools such as TortoiseSVN, or Eclipse with the Subclipse plugin-in, to compare and retrieve the PeopleCode and SQL text.

Export to a Git repository

The program can now also submit the extracted text to a Git repository.

Merge PeopleCode branches to re-apply customizations

The application now also contains functionality to do a three-way merge of PeopleCode. This is intended for a functional upgrade, where there may be PeopleCode segments that have been modified both by Oracle and by you. For instance, if your current system is HCM 8.9 and you are upgrading to HCM 9.1, there can be modifications in the vanilla Oracle branch (DMO89 -> DMO91) and also in your development branch (DMO89 -> your development environment).

If you have a (browser) compare report (UPGCUST) for the changes between the new vanilla environment (e.g. DMO91) and your dev system, the application will help you extract the relevant PeopleCode from the old vanilla environment, and will then try and do the three-way merge. Results can be retrieved via links in the compare report.

Comments

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License