Welcome to Open Discussion

Erik H
  • Erik H

    Erik H - 2011-03-05

    Welcome to Open Discussion

  • Anonymous - 2012-05-17

    Hi Erik. Love this tool, this is very useful code that you have written here.

    My question is related to going the other direction, that is, writing to the Pcode tables. Is this at all possible?

  • Erik H

    Erik H - 2012-06-04

    (sorry for the late reply - an entry added to an existing thread does not show up in the forum statistics).

    No, the tool  cannot compile PeopleCode text into bytecode. I have actually done some tests to see if I could parse PeopleCode and those tests went quite well, but I did not really see the point of creating an Eclipse plug-in (or whatever) to actually compile code and do all the other things that the app designer does.

  • Roger  Davies

    Roger Davies - 2013-10-04

    I'm quite interested in getting our PPC customizations into a repository. I've been using the PSPCMTXT tables to get cleartext out of the database. I noticed in one of your bug reports that a user was seeing truncations. It appears your conjecture that Oracle is creating PROGSEQ sequences for very long PCM programs is correct.

    In my installation, I have instance PCM programs that go as high as PROGSEQ = 17. Are you attempting to concatenate these mutliple sequences together into a single code block before loading to SVN?

  • Erik H

    Erik H - 2013-10-05

    Yes, I'm just concatenating all the PSPCMTXT rows for the same code segment. Not sure what else I could/should do to retrieve the plain text - it just looks like some text is missing.

    As you've probably seen in the bug report, you can set a flag to make my program ignore the PSPCMTXT table. It will then decode the bytecode in PSPCMPROG; works quite well.

  • Jose Antonio Juarez P

    I'm getting this error when I try to run your tool, and using HP-UX, with Peopletool 8.49.30, and Oracle DB 12

    Exception in thread "main" java.lang.NoClassDefFoundError: decodepcode/Controler

  • Erik H

    Erik H - 2015-02-23

    Hi Jose

    That sounds like a simple problem with your classpath. Please base your script on one of the .sh scripts (I just noticed that I don't have a version that includes the Git library, will add it), and start your script from the top directory (because it expects the 'bin' subdirectory). For Unix, the entries in the classpath need to be separated by colons, not semicolons.

    BTW if you run into other problems, please log a ticket under tickets/bugs.

  • Alexei Tetenov

    Alexei Tetenov - 2015-03-13

    Hi Erik,
    Thank you for sharing your wonderful tool.
    I'm just learning about Git. Do you have a recommendation on how to store the peoplecode into Git, in the case where we have multiple environments?
    I have considered a separate Git project for each environment, demo, dev, stage, test, prod, but I don't think that this would enable easy comparison of unexpected differences between environments.
    I have also considered creating a separate branch for each environment, with the main branch being linked to the dev environment, but I'm unsure if this is a good solution.

    Do you have any thoughts?
    Can you share your experiences?

  • Erik H

    Erik H - 2015-03-14

    Hi Alexei


    Yes, I built in a feature to do just that. Check out the attached file 'sample_for_Git_DecodePC.properties'. It's a slightly modified version of what I use for a project. When you run DecodePCODE_Git.bat with this configuration, the PeopleCode/SQL of 4 different PS environment will be committed to a single Git repository, in different folders (under D:\gitrepo\PS).

    To prime the repository, run the script with argument 'custom'. This will commit all customized code. Then, run it with argument 'since-days 1' (this will create last-time.txt). Finally, schedule it to run nightly with argument 'since-last-time'.

    If you then modify some delivered code in your DEV environment, the code will not only be committed to the DEV folder, but the (not-yet-modified) code from the other environments will also be committed (to the other folders).

    I must say, however, that I haven't found a good way to compare the folders with Git. As far as Git is concerned, they are not branches. With Subversion and Eclipse, I was able to compare the files but with Git it does not seem to be so easy.

    Perhaps it's necessary to actually create branches in Git (probably by branching DEV off ACC off PRD off DEMO) - I haven't tried that yet. Perhaps someone who knows Git better than I can suggest a way to do this.

  • Alexei Tetenov

    Alexei Tetenov - 2015-03-20

    Hi Erik,
    Thank you for you feedback.

    I have another question, what is the gitbase parameter for? This seems to create another subdirectory and I'm not sure why this is needed.

    I think that based on what I have read about git so far, I want to have my dev code be the master branch, and my demo, stage, test, and prod instances be other branches off the master branch. The difference between this and other sw dev practices is that I don't envision even merging between these branches. And as a developer at a place that only refreshes dev 3-4 times/year, I am typically more interested in what is in dev, vs what is in prod. This is why I think I would make the "master" branch be my code from dev, instead of prod. At other places, the production code was the master code branch.

    Hmm, if I made master be the prod code and then rebased the dev branch, after a refresh, then I could probably easily see refreshes represented in the git repository. Rebasing a dev branch after a refresh should be pretty easy, just take all of the prod changes, there should only be very few dev specific peoplecode differences, if any, after a refresh.

    Hmm, branching prod off demo also seems to be a good idea.

    I found a good entry on stack overflow about using different workflows in git at http://stackoverflow.com/questions/18220663/advice-on-multiple-release-lines-and-git-flow-for-git-non-gurus
    The poster references Driessen's branching model located at http://nvie.com/posts/a-successful-git-branching-model/

    I'm not familiar with the compare in git but I have found a product, Beyond Compare, to be the best file and folder comparison tool.

    Another question, have you figured out how to enable syntax highlighting in git?

    I'm not sure how to modify the java to look for a parameter to pick a different file layout structure, but I'm including my java changes to the getFile function for your consideration. I'd like to be able to set a configuration file parameter to get all of the record peoplecode files in one directory. For example, in the Record_PeopleCode folder, I'd have a file FUNCLIB_RIT_SHB.LDAPAUTH.FieldDefault.pcode. I think that this would make it easier to scan and search for peoplecode.


    public File getFile(PeopleToolsObject obj, String extension)
            throws IOException 
        String pcType = JDBCPeopleCodeContainer.objectTypeStr(obj.getPeopleCodeType());
        File f = new File(rootDir, pcType);
        /* get the last item in the directory structure being created 30-JAN-2015 artisd */
        int last = -1;
        for (int i = 0; i < obj.getKeys().length; i++)
            if (obj.getKeys()[i] != null && obj.getKeys()[i].trim().length() > 0)
                last = i;
        /* don't want a nested directory tree for peopletools objects.  ex. peoplecode  30-JAN-2015 -artisd
        for (int i = 0; i < last; i++)
            String dirName = filterFileName(obj.getKeys()[i]);
            f = new File(f, dirName);
    f = new File(f, filterFileName(obj.getKeys()[last]) + "." + extension);
        /* create the container directory ex. Record_PeopleCode */
    /* want a dot'ed file naming convention for peopletools (peoplecode) objects.  ex. FUNCLIB_RIT_SHB.LDAPAUTH.FieldDefault.pcode by type, ex in Record_PeopleCode folder 30-JAN-2015 -artisd */
    String firstPartOfFileName = "";
    for (int i = 0; i < last; i++)
      firstPartOfFileName = firstPartOfFileName + filterFileName(obj.getKeys()[i]) + ".";
        f = new File(f, firstPartOfFileName + filterFileName(obj.getKeys()[last]) + "." + extension);
        return f;
    • Erik H

      Erik H - 2015-03-21

      Hi Alexei

      About the gitbase parameter: I wanted to store the various environments into the same repository. I did it the Subversion way, by creating a new folder tree for a new branch.

      Perhaps it should be done differently for Git. Switching branches with Git may be tricky, though - it seems to replace your entire set of files whenever you checkout to a different branch. Given the frequency of commits, I can't have that.

      I'm now thinking of a different approach: submitting the various versions of a file (DEMO, PROD, the DEV) to the same location in a single branch, whenever a new PeopleCode segment is added to the repository. That way, the file's history will show how the segment was customized.

      I don't have any suggestions on syntax highlighting. I use the GitList viewer - I don't think it can handle that. For SVN, I use WebSVN which seems to be more configurable, but I haven't tried to set this up.

      If you want to create a different folder structure, create a class that implements PToolsObjectToFileMapper and use it in the constructor of WriteToDirectoryTree.

  • Alexei Tetenov

    Alexei Tetenov - 2015-03-20

    Hi Erik,
    I just found an issue that I'm not sure how to reliably identify. It seems that sometimes the contents between pspcmprog and pspcmtxt differ. I have a long section of record peoplecode that spans 6 segments in these tables.

    To identify this, I did a comparison between my dev and stage folders containing the record peoplecode for a particular project and saw there was a difference.

    To resolve this, I migrated this particular record peoplecode from stage back to dev.

    Do you know how to programmatically identify differences like this?

    I'm wondering if it would be worth loading the java into the db (oracle pl/sql package), and run a comparison of the 2 tables for the parameters being passed in, via a pl/sql package, before extracting the peoplecode...
    Or just maybe a comment somewhere in the program.

  • Erik H

    Erik H - 2015-03-21

    Hi again

    Are you using a recent version of the tool? There was an issue with multi-segment PeopleCode a few versions ago - I assumed that the code was split up the same way in PSPCMPROG and PSPCMTXT, but that is not the case (if you decode the bytecode in the i-th segment of PSPCMPROG, you don't get the plain text in the i-th segment of PSPCMTXT).

    I believe I fixed that bug, and I haven't heard about discrepancies between PSPCMTXT and what you see in App Designer.

    Let me know if I misunderstood your question.

  • Erik H

    Erik H - 2015-03-26

    I just published v0.60, which contains new way to process multiple environments. It should make it easier to compare the DEV, PROD and DEMO versions of PeopleCode objects.

    Enjoy, and let me know if you have any issues with it.

  • Alexei Tetenov

    Alexei Tetenov - 2015-03-30

    Hi Erik,
    Yes, I was using version 0.55. The discrepancy is that pspcmtxt was showing a different version of my record peoplecode vs pspcmprog. This sounds like a peopletools level bug.

    I plan to try out version 0.60 this week.
    Thank you!!!

  • John Bush

    John Bush - 2016-12-07

    There actually is a problem on the PeopleSoft side, where the text in PSPCMTXT is different than the actual text in App Designer. If you run the delivered App Engine UPGPTHASH, it will recompile the PeopleCode and update the PSPCMTXT data.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks