Understanding Tree Classes

Using the tree classes in your PeopleCode, you have access to all the functionality of PeopleSoft Tree Manager. Your application should instantiate the appropriate tree objects when it must work with the tree system database data, call the appropriate methods and properties, then close the objects when it is finished.

Creating or deleting a tree object does not create or delete tree system database information. You must call the method for that tree object directly to create or delete database information, that is, the Create or Delete method.

One instance of a tree or tree structure object can be created to work on multiple database entities. However, only one tree or tree structure can be open at a time. If you open a Tree before closing the one that’s currently open, you receive an error. You must explicitly close a tree or tree structure (using the Close method) before you try to open a second one.

All of the classes, and most of the properties and methods that make up the Tree Classes have a GUI representation in PeopleSoft Tree Manager. This document assumes that the reader is familiar with PeopleSoft Tree Manager.

The following classes make up the tree classes:

  • Branch Collection

  • Leaf

  • Level

  • Level Collection

  • Node

  • Tree

  • Tree Structure

With most of the classes of objects in PeopleTools, when you use a Getxxx method, you are fully instantiating an object. However, for the tree class, when you use GetTree (from the Session object), you get a closed tree. A closed tree is a tree object with just the key fields filled in. The rest of the data is not present. To open the tree, you must use the Open method. Working with closed trees can improve your performance. The same applies to a tree structure: it’s closed when you get it from the Session object, and you must open it before you can access its properties or change it.

There aren’t any built-in functions for the tree classes: objects are instantiated from identifiers, from other objects, or from a Session object.

Using the GenerateTree function, you can produce a GUI representation of a tree in the PeopleSoft Pure Internet Architecture.