Understanding TreeMover
This topic provides an overview of TreeMover.
TreeMover enables you to move PeopleSoft trees between different PeopleSoft application databases. It enables you to export a tree to a flat file and to import a tree from a flat file. TreeMover moves all types of tree data, including the tree definition, tree structure, tree nodes, tree leaves, tree node data, and tree level data.
TreeMover does not support branched trees. If you import a branched tree, the branches become regular tree nodes.
Advantages of using TreeMover instead of other methods of moving trees, such as Data Mover or custom SQR, include:
TreeMover can move trees between different versions of PeopleSoft databases, for example, from a PeopleSoft Financials 7.5 database to a PeopleSoft EPM 8 database.
Tree Mover can move tree node data (description, setID, effective date, and effective status) for trees that have node data stored in the PS_TREE_NODE_TBL (the table that stores the tree node data is specified as part of the tree structure).
Tree Mover can move tree level data (long description, short description, setID, effective date, and effective status) for trees that have level data stored in the PS_TREE_LEVEL_TBL—the table that stores the tree level data is specified as part of the tree structure.
TreeMover uses the tree APIs, which means the same logic used for the PeopleSoft Tree Manager application is used to load and unload trees using TreeMover.
All the same edit checks are performed on a tree created with TreeMover as are performed on a tree created manually with PeopleSoft Tree Manager because both use the same functionality to create the tree. Because TreeMover processes are initiated from standard PeopleSoft pages, the ability to import and export tree data can be restricted by using PeopleSoft standard security mechanisms for limiting access to pages. If a source tree uses branches, you need to recreate them after TreeMover finishes its import operation.
Here are some example tasks that you can use with TreeMover:
Load a winter tree with nodes from a legacy financial database quickly and easily into PeopleSoft 8 databases.
Automatically replace an account tree every month with a new tree based on current information.
Note: When the PS_TREEBASEDIR environment variable is set, the flat file for the import process is located in %PS_TREEBASEDIR%\<USER>\InputFilename and the flat file for the export process is located in %PS_TREEBASEDIR%\<USER>\OutputFilename. You can override this and create another location using the Process Definition Override page.
TreeMover currently supports fixed-format files only.
TreeMover does not support related language tables.
When you export a tree containing text data, the data is saved in the codepage of the server—for example, CP1252 Western European on English Windows, or CP932 Shift-JIS on Japanese Windows. Any characters which are not valid in the server's codepage are converted into question mark characters.
TreeMover consists of three parts: a utility to export a tree from a PeopleSoft 8 database, a utility to import a tree into a PeopleSoft 8 database, and a utility to export a tree from a PeopleSoft 7.x database. The import and export functionality for a PeopleSoft 8 database is implemented as a PeopleSoft Application Engine application process. As with other Application Engine processes, they can be scheduled to run automatically from the Process Scheduler. The Application Engine process uses PeopleCode Tree APIs, PeopleCode File APIs, and file layout definitions. The utility that enables you to export trees from a PeopleSoft 7.x database is implemented as an SQR program (TMDOWNLD.SQR).
TreeMover uses the following PeopleTools system tables for trees during both the tree import and tree export processes:
PSTREEDEFN
PSTREENODE
PSTREELEAF
PSTREESTRCT
PSTREELEVEL
PS_TREE_LEVEL_TBL
PS_TREE_NODE_TBL
TreeMover also reads the PSSTATUS table during the tree export process to identify the version of the tree data exported.
As delivered, TreeMover uses seven different file layouts. All the data for an exported tree is contained in a single file. Prior to a change in the file layout used for the export file, TreeMover writes a header record to the file to indicate what the next file layout is. The following table lists the standard file formats, along with their actual file layout name and the text of the header record that precedes a given layout data.
File Layout |
Description |
Header Record Text |
---|---|---|
TREE_VERSION |
Contains the PeopleTools release number used to create the export data file. If a tree version is not provided, then the TreeMover import program assumes that the tree data is from a database before 8.1. |
999TREE_VERSION |
TREE_STRUCTURE |
Used for data from the PSTREESTRCT table. |
999TREE_STRCT |
TREE_DEFN |
Used for data from the PSTREEDEFN table. |
999TREE_DEFN |
TREE_USERLEVEL |
Used for data from PS_TREE_LEVEL_TBL. |
999TREE_USERLVL |
TREE_LEVEL |
Used for data from the PSTREELEVEL table. |
999TREE_LEVEL |
TREE_USERNODE |
Used for data from PS_TREE_NODE_TBL. |
999TREE_USERND |
TREE_NODE |
Used for data from the PSTREENODE and PSTREELEAF tables. |
999TREE_NODE |
The TreeMover export program processes the data in the order listed in the preceding table.
If you write your own export file, then you must adhere to the following rules:
The Tree Structure record, if present, must always come first in the file.
If it is not present, the TreeMover import program defaults to the record layouts used prior to release 8.1.
The Tree Definition record, if present, must come after the Tree Structure record.
The Tree Level records—only for trees with levels—must come before the Tree Node and Leaf records.
The Tree Node and Leaf records are required for any export file.
Prior to the change in the record layout, you must precede the next data record with the appropriate header record for that file format.
The TreeMover file formats and contents are:
999TREE_VERSION
Tree Version Data
999TREE_STRCT
Tree Structure Data
999TREE_DEFN
Tree Definition Data
999TREE_USERLVL
Tree Level Data 1
Tree Level Data 2
Tree Level Data N
999TREE_LEVEL
Tree Level 1
Tree Level 2
Tree Level N
999TREE_USERND
Tree Node Data 1
Tree Node Data 2
Tree Node Data N
999TREE_NODE
Tree Node 1
Tree Node 2
Tree Detail 1
Tree Detail 2
Tree Node 3
Tree Node 4
Tree Node N
Tree Detail 5
Tree Detail N
This is an example of TreeMover.

TreeMover reads these records in the following strict order during an import:
PeopleTools Version (optional).
This record is needed only if loading data from an 8.1 or later PeopleSoft database.
Tree Structure (optional).
This record is needed only if the structures do not already exist. One or more structure records can be loaded.
Tree Definition (required).
The information needed to create a tree. Only one tree definition record can exist in the input file.
Tree Level Data (optional).
The detailed level data for a tree. One or more level data records can exist in the input file.
Tree Levels (required for leveled trees).
The levels defined for the tree. Must include enough to define all the nodes. One or more level records can exist in the input file.
Tree Node Data (optional).
The detailed tree node information: description, effective date, and so on.
Tree nodes and leaves (required).
Tree node and detail information. Each node must contain either a parent node or a previous sibling node. The referenced node—parent or sibling—must precede the node that references it in the input file.
Detail values for a tree must exist in the database before importing the tree.
One or more node records listed in level plus sibling order—that is, the root node on the first level, nodes on the second level, and so on—can exist in the input file.
Each record starts with a unique identifier for that record type, followed by the associated column data. All data is in a fixed format.
Tree Structure Layout (TREE_STRUCTURE)
For the Tree Structure layout, most column names map directly to the PSTREESTRCT record.
Note: The tree structure record is optional if the database already has the structure defined for the new tree.
Column Name |
Column Type |
Length |
Start Position |
End Position |
Comments |
---|---|---|---|---|---|
File Record ID |
Number |
1 |
1 |
1 |
Always 1. |
UPDATE_ACTION |
Character |
1 |
2 |
2 |
Always A (only add mode is supported at this time) |
TREE_STRCT_ID |
Character |
18 |
3 |
20 |
None |
DESCR |
Character |
30 |
21 |
50 |
None |
TREE_STRCT_TYPE |
Character |
1 |
51 |
51 |
None |
DYNAMIC_RANGE |
Character |
1 |
52 |
52 |
Y or N |
SETCNTRL_IND |
Character |
1 |
53 |
53 |
S, B, U, or N |
LEVEL_RECNAME |
Character |
15 |
54 |
68 |
None |
LEVEL_PNLNAME |
Character |
18 |
69 |
86 |
None |
LEVEL_MENUNAME |
Character |
30 |
87 |
116 |
None |
LEVEL_BARNAME |
Character |
30 |
117 |
146 |
None |
NODE_RECNAME |
Character |
15 |
147 |
161 |
None |
NODE_PNLNAME |
Character |
18 |
162 |
179 |
None |
NODE_FIELDNAME |
Character |
18 |
180 |
197 |
None |
SETCNTRLFLD |
Character |
18 |
198 |
215 |
None |
NODE_MENUNAME |
Character |
30 |
216 |
245 |
None |
NODE_BARNAME |
Character |
30 |
246 |
275 |
None |
DTL_RECNAME |
Character |
15 |
276 |
290 |
None |
DTL_FIELDNAME |
Character |
18 |
291 |
308 |
None |
DTL_PNLNAME |
Character |
18 |
309 |
326 |
None |
DTL_MENUNAME |
Character |
30 |
327 |
356 |
None |
DTL_BARNAME |
Character |
30 |
357 |
386 |
None |
DTL_SETID |
Character |
5 |
387 |
391 |
None |
SETCNTRLVALUE |
Character |
20 |
392 |
411 |
None |
DTL_TREE_NAME |
Character |
18 |
412 |
429 |
None |
DTL_TREE_LEVEL_NUM |
Character |
5 |
430 |
434 |
None |
LEVEL_PNLGRPNAME |
Character |
50 |
436 |
485 |
Only for release 8.1 and later. |
NODE_PNLGRPNAME |
Character |
50 |
487 |
536 |
Only for release 8.1 and later. |
DTL_PNLGRPNAME |
Character |
50 |
538 |
587 |
Only for release 8.1 and later. |
LEVEL_ITEMNAME |
Character |
30 |
589 |
618 |
Only for release 8.1 and later. |
NODE_ITEMNAME |
Character |
30 |
620 |
649 |
Only for release 8.1 and later. |
DTL_ITEMNAME |
Character |
30 |
651 |
680 |
Only for release 8.1 and later. |
TreeMover Tree Definition Layout (TREE_DEFN)
The tree definition record columns require either a tree structure defined in the database or a previous tree structure record in the file. For the Tree Definition layout, most column names map directly to the PSTREEDEFN record.
Column Name |
Column Type |
Length |
Start Position |
End Position |
Comments |
---|---|---|---|---|---|
File Record ID |
Number |
1 |
1 |
1 |
Always 2. |
UPDATE_ACTION |
Character |
1 |
2 |
2 |
Always A (only add is mode supported at this time). |
SETID |
Character |
5 |
3 |
7 |
None |
SETCNTRLVALUE |
Character |
20 |
8 |
27 |
None |
TREE_NAME |
Character |
18 |
28 |
45 |
None |
EFFDT |
Date |
10 |
46 |
55 |
YYYY-MM-DD format. |
TREE_STRCT_ID |
Character |
18 |
56 |
73 |
None |
DESCR |
Character |
30 |
74 |
103 |
None |
NODE_COUNT |
Character |
10 |
104 |
113 |
None |
ALL_VALUES |
Character |
1 |
114 |
114 |
Y or N |
USE_LEVELS |
Character |
1 |
115 |
115 |
S, L, or N |
DUPLICATE_LEAF |
Character |
1 |
116 |
116 |
Y or N |
TREE_CATEGORY |
Character |
18 |
117 |
134 |
None |
EFF_STATUS |
Character |
1 |
135 |
135 |
None |
TREE_ACC_METHOD |
Character |
1 |
136 |
136 |
None |
TREE_ACC_SELECTOR |
Character |
1 |
137 |
137 |
None |
TREE_ACC_SEL_OPT |
Character |
1 |
138 |
138 |
None |
LEAF_COUNT |
Character |
10 |
139 |
148 |
None |
TREE_IMAGE |
Character |
30 |
139 |
168 |
Only for release 8.1 and later. |
BRANCH_IMAGE |
Character |
30 |
170 |
199 |
Only for release 8.1 and later. |
NODECOL_IMAGE |
Character |
30 |
201 |
230 |
Only for release 8.1 and later. |
NODEEXP_IMAGE |
Character |
30 |
232 |
261 |
Only for release 8.1 and later. |
LEAF_IMAGE |
Character |
30 |
263 |
292 |
Only for release 8.1 and later. |
Tree User Level Data Layout (TREE_USERLEVEL)
The columns in this layout correspond to the columns in the TREE_LEVEL_TBL record.
Column Name |
Column Type |
Length |
Start Position |
End Position |
Comments |
---|---|---|---|---|---|
File Record ID |
Number |
1 |
1 |
1 |
Always 3. |
UPDATE_ACTION |
Character |
1 |
2 |
2 |
Always A (only add mode is supported at this time). |
SETID |
Character |
5 |
3 |
7 |
None |
TREE_LEVEL |
Character |
10 |
8 |
17 |
None |
EFFDT |
Date |
10 |
18 |
27 |
YYYY-MM-DD format. |
EFF_STATUS |
Character |
1 |
28 |
28 |
None |
DESCR |
Character |
30 |
29 |
58 |
None |
DESCRSHORT |
Character |
10 |
59 |
68 |
None |
Tree Level Record Layout (TREE_LEVEL)
The tree level layout requires a tree definition record in the file previous to this record type. The columns in this layout correspond to the columns in the PSTREELEVEL record.
Note: No-level records should be defined for no-level trees.
Column Name |
Column Type |
Length |
Start Position |
End Position |
Comments |
---|---|---|---|---|---|
File Record ID |
Number |
1 |
1 |
1 |
Always 4. |
UPDATE_ACTION |
Character |
1 |
2 |
2 |
Always A (only add mode is supported at this time). |
TREE_LEVEL |
Character |
10 |
3 |
12 |
None |
TREE_LEVEL_NUM |
Character |
3 |
13 |
15 |
None |
ALL_VALUES |
Character |
1 |
16 |
16 |
Y or N |
Tree Node Data Layout (TREE_USERNODE)
The columns in this layout correspond to the columns in the TREE_NODE_TBL record.
Column Name |
Column Type |
Length |
Start Position |
End Position |
Comments |
---|---|---|---|---|---|
File Record ID |
Number |
1 |
1 |
1 |
Always 5. |
UPDATE_ACTION |
Character |
1 |
2 |
2 |
Always A (only add mode is supported at this time). |
SETID |
Character |
5 |
3 |
7 |
None |
TREE_NODE |
Character |
20 |
8 |
27 |
None |
EFFDT |
Date |
10 |
28 |
37 |
YYYY-MM-DD format. |
EFF_STATUS |
Character |
1 |
38 |
38 |
None |
DESCR |
Character |
30 |
39 |
68 |
None |
Tree Node Record Columns (TREE_NODE)
Tree node record columns require a tree definition record in the file previous to this record type and level records if the tree has levels. Node records must have parents defined before their children. Detail records can be interspersed between node records.
Note: Node type is either G or R. G is for standard nodes, and R is for Query Access Group record nodes. Branch nodes are not supported at this time.
Column Name |
Column Type |
Length |
Start Position |
End Position |
Comments |
---|---|---|---|---|---|
File Record ID |
Number |
1 |
1 |
1 |
Always 6. |
UPDATE_ACTION |
Character |
1 |
2 |
2 |
Always A (only add mode is supported at this time). |
TREE_NODE |
Character |
20 |
3 |
22 |
Only for node records. |
PARENT_NODE_NAME |
Character |
20 |
23 |
42 |
Tree TREE_NODE for the parent node of the node or detail. |
TREE_NODE_TYPE |
Character |
1 |
43 |
43 |
Only for node records; must be G or R. |
TREE_LEVEL_NUM |
Character |
3 |
44 |
46 |
Only for node records. |
TREE_NODE_PREV_SIB |
Character |
20 |
47 |
66 |
Only for node records. |
RANGE_FROM |
Character |
30 |
67 |
96 |
Only for detail records. |
RANGE_TO |
Character |
30 |
97 |
126 |
Only for detail records. |
DYNAMIC_RANGE |
Character |
1 |
127 |
127 |
Only for detail records; must be Y or N. |
LEAF_IMAGE |
Character |
30 |
129 |
158 |
Only for release 8.1 and later. |
NODECOL_IMAGE |
Character |
8 |
160 |
167 |
Only for release 8.1 and later. |
NODEEXP_IMAGE |
Character |
8 |
169 |
176 |
Only for release 8.1 and later. |