Using TreeMover

This chapter provides an overview of TreeMover and discusses how to:

Note. The flat files for both the import and export processes are located in the working directory for PeopleSoft Application Engine as specified on the Process Type Definition page in PeopleSoft Process Scheduler. You can override this and create another location using the Process Definition Override page.

See Also

Defining Process Type Definitions

Click to jump to parent topicUnderstanding TreeMover

This section discusses:

Click to jump to top of pageClick to jump to parent topicPurpose 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:

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:

Note. 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).

Click to jump to top of pageClick to jump to parent topicPopulated Record Types

TreeMover uses the following PeopleTools system tables for trees during both the tree import and tree export processes:

TreeMover also reads the PSSTATUS table during the tree export process to identify the version of the tree data exported.

Click to jump to top of pageClick to jump to parent topicTreeMover File Formats

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 TreeMover file formats and contents are:

This is an example of TreeMover:

Click to jump to top of pageClick to jump to parent topicTreeMover File Rules

TreeMover reads these records in the following strict order during an import:

  1. PeopleTools Version (optional).

    This record is needed only if loading data from an 8.1 or later PeopleSoft database.

  2. Tree Structure (optional).

    This record is needed only if the structures do not already exist. One or more structure records can be loaded.

  3. Tree Definition (required).

    The information needed to create a tree. Only one tree definition record can exist in the input file.

  4. Tree Level Data (optional).

    The detailed level data for a tree. One or more level data records can exist in the input file.

  5. 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.

  6. Tree Node Data (optional).

    The detailed tree node information: description, effective date, and so on.

  7. 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.

Click to jump to top of pageClick to jump to parent topicFile Layout Details

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.

The following table provides file layout details:

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 greater.

NODE_PNLGRPNAME

Character

50

487

536

Only for release 8.1 and greater.

DTL_PNLGRPNAME

Character

50

538

587

Only for release 8.1 and greater.

LEVEL_ITEMNAME

Character

30

589

618

Only for release 8.1 and greater.

NODE_ITEMNAME

Character

30

620

649

Only for release 8.1 and greater.

DTL_ITEMNAME

Character

30

651

680

Only for release 8.1 and greater.

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.

The following table provides tree definition layout details:

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 greater.

BRANCH_IMAGE

Character 

30

170

199

Only for Release 8.1 and greater.

NODECOL_IMAGE

 Character

30

201

230

Only for Release 8.1 and greater.

NODEEXP_IMAGE

 Character

30

232

261

Only for Release 8.1 and greater.

LEAF_IMAGE

Character

30

263

292

Only for Release 8.1 and greater.

Tree User Level Data Layout (TREE_USERLEVEL)

The columns in this layout correspond to the columns in the TREE_LEVEL_TBL record.

The following table provides tree user level data layout details:

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.

The following table provides tree level layout details:

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.

The following table provides tree node data layout details:

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.

The following table provides tree node record details:

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 greater.

NODECOL_IMAGE

Character

8

160

167

Only for Release 8.1 and greater.

NODEEXP_IMAGE

Character

8

169

176

Only for Release 8.1 and greater.

Click to jump to parent topicImporting and Exporting PeopleSoft 8 Trees

This section provides an overview of using TreeMover with PeopleSoft 8 databases and discusses how to:

Click to jump to top of pageClick to jump to parent topicUnderstanding TreeMover and PeopleSoft 8.x Trees

As with other PeopleSoft Application Engine processes, you initiate the TreeMover process from PeopleSoft pages. You need to submit a few required parameters at runtime, including the file name for each tree import (load) or tree export (unload). You can run TreeMover each time you need to load a tree, or you can set PeopleSoft Process Scheduler to run a tree load process automatically.

To view the results of TreeMover processes, perform the following steps from the Tree Import or Tree Export page:

  1. Click the Process Monitor link.

    The Process List page appears. The run status for your process will appear as Success, No Success, or Warning.

    Note. If you receive a No Success or Warning status, you should also review the TreeMover log file. This file may include additional information that the Process Monitor does not include.

  2. Click the Details link.

    The Process Detail page appears.

  3. Click the Message Log button.

  4. Click the Explain button for further details on each message.

You can also view the log output file. To find this file, navigate to the log_output directory. The location of the log_output directory is specified in the Process Scheduler configuration file. After you are accessed the log_output directory, navigate to the following path: /AE_TREEMOVER_<PROCESS_ID>/TreeMover-<Date-Time>.log.

This example shows the full path to the log output file – the italicized portion of the path is specified in the Process Scheduler configuration file:

C:\Documents and Settings\admin\psft\pt\8.50-810-R1\appserv\prcs\QEDMO\log_output\AE_TREEMOVER_59\TreeMover-2009-06-18-09.44.59.log

This is a sample of the log file:

The delivered TreeMover application can move only tree node data that is associated with the PS_TREE_NODE_TBL and only tree level data that is associated with the PS_TREE_LEVEL_TBL. You can modify TreeMover to support other tables for node and level data.

Note. Creating TreeMover customization for moving non-standard node and detail user data is a complicated process. Oracle recommends using PeopleSoft Data Mover or other database tool when you move user data from a source database to a target database.

When a tree replaces an existing tree using the Tree Import Utility, the system import a new tree using a unique name and check if the tree creation process is successful. If the tree creation process turns out to be successful, the system delete the existing tree and rename the newly created tree. If the import file from which you are importing is corrupted, you don't lose your existing tree.

Also, if the existing tree was secured by Definition Security, it is automatically removed from the Definition Security Group at the time of deletion. Because the removal of the tree from the Definition Security Group occurs prior to the import, the utility has no knowledge of the tree being secured, and therefore, the new tree will have to be manually secured after the import is complete.

See Also

Modifying the TreeMover Application Engine Program

Click to jump to top of pageClick to jump to parent topicPages Used to Import and Export PeopleSoft 8 Trees

Page Name

Definition Name

Navigation

Usage

Tree Export

RUN_TREEMOVER_EXP

Tree Manager, Tree Utilities, Export Tree

Export trees using TreeMover.

Tree Import

RUN_TREEMOVER_IMP

Tree Manager, Tree Utilities, Import Tree

Import trees using TreeMover.

Click to jump to top of pageClick to jump to parent topicExporting PeopleSoft 8 Trees to an External File

Access the Tree Export page by selecting Tree Manager, Tree Utilities, Export Tree.

This is an example of the Tree Export page:

To export a tree to an external file:

  1. In the Tree Export page, enter the correct output file name.

    The flat file is sent to the working directory for PeopleSoft Application Engine as specified on the Process Type Definition page in Process Scheduler. If this is not the location you want, enter the valid path name for the directory on the application server that runs the process.

  2. Enter the tree name, effective date, and tree key value.

    Note. The tree key value applies to only setID, business unit, or user-defined key trees (tree key type is set in the tree structure). For trees that have no additional key value, the field is not available.

  3. Select the tree data to export.

    You can export the tree structure data, the tree definition, the tree levels, the tree level data, the tree nodes and leaves, and the tree node data. You also can export the tree definition, tree level, and tree node/leaf data.

    Note. You need to select Tree Structure if the tree structure does not already exist in the target database. You can also select the Tree User Level option to move related data from the PS_TREE_LEVEL_TBL table, and select the Tree User Nodes option to move related data from the PS_TREE_NODE_TBL.

  4. Click the Run button to move the tree.

  5. Verify that the settings on the Process Scheduler Request page are correct, and click OK to run the process.

  6. Check the run status in the Process Monitor.

    If an Error or Warning status exists for the process, check the TreeMover log file which may contain additional information that describes the problem. Potential problems are not limited to – but may include – the following:

Click to jump to top of pageClick to jump to parent topicImporting PeopleSoft 8 Trees from an External File

Access the Tree Import page by selecting Tree Manager, Tree Utilities, Import Tree.

Note. PeopleSoft Tree Manager does not accept wildcard characters. To prevent creating a corrupted tree, the Tree Import utility checks for invalid tree node names.

This is an example of the Tree Import page:

To import an existing PeopleSoft tree:

  1. In the Tree Import page, enter the correct input file name.

    The flat file is sent to the working directory for PeopleSoft Application Engine as specified on the Process Type Definition page in PeopleSoft Process Scheduler. If this is not the location you want, enter the valid path name for the directory on the application server that runs the process.

  2. Select a save method.

    By default, you should use the Save option. However, if you think the tree might not pass all the PeopleSoft tree audits, then select the Save Draft option, which saves the tree in draft mode and functions just as it does in PeopleSoft Tree Manager.

  3. If the tree already exists in your database, select the Replace Tree if Exists option.

    Note. If the tree already exists in your database and you do not select the Replace Tree if Exists option, the tree will not be imported.

  4. Select the Load Tree Defn from File (load tree definition from file) option if the tree definition is contained in the input file and you want to load the tree with the same tree definition values.

    Note. In most cases, you want to load the tree definition from the file. If you select this option and the tree definition does not exist in the input file, then the load process fails.

  5. Enter the basic tree information if you are not loading the tree definition from the input file.

    If you are not loading the tree definition from the input file, then you are required to specify all the basic tree information on the run control page. These fields correspond to the same values that you’d have to enter if you were creating the tree using PeopleSoft Tree Manager. TreeMover skips the input record that contains the tree definition information and instead use the values that you enter.

    You must load the tree definition from the file if you’re also loading the tree structure from the file. If you try to load the structure from the file, but have overridden the definition values on the page, then the process will not run completely.

    TreeMover loads a new tree structure only if the structure doesn't already exist.

    Note. If your TreeMover data file contains user level data or user node data and you are changing the setID of your tree on import, the user data will retain the original setID. TreeMover import does not support the changing of user data setIDs.

  6. Click the Run button to move the tree.

  7. Verify the successful completion of the process by checking the run status of the process in the Process Monitor page.

    If you receive either a run status of Warning or No Success, view the message log explanations for details and recommendations. You should also view the TreeMover log for more information.

    Note. You can also check the log file. If the process completed successfully, the log file states PeopleSoft TreeMover Completed Successfully.

    If you’re loading a tree that contains detail values, then those detail values must exist in the target database before you load the tree. If they do not exist, then the tree import process fails.

Click to jump to parent topicImporting and Exporting PeopleSoft 7.x Trees

This section provides an overview of the TMDOWNLD SQR program and discusses how to:

Click to jump to top of pageClick to jump to parent topicUnderstanding the TMDOWNLD SQR Program

TreeMover provides the TMDOWNLD SQR program for unloading a PeopleSoft tree from a PeopleSoft 7 or 7.5 database. (The SQR should also work against a PeopleSoft 6 database, but it has not been tested against that version and is not certified for it.) This program exports most of the same tree information as the Tree Export functionality provided with PeopleTools 8. Differences include:

Click to jump to top of pageClick to jump to parent topicInstalling the SQR Program

To install the TMDOWNLD SQR program, copy the TMDOWNLD.SQR file from your PeopleTools 8 PS_HOME/SQR directory to the SQR directory for your PeopleTools 7 or 7.5 install.

Note. If you do not have a copy of TMDOWNLD.SQR, contact PeopleSoft Customer Service.

When you run this SQR against a given version of a PeopleSoft database, you must run it with the common SQC files that are delivered for that PeopleTools version. For example, if you run it against a PeopleSoft 7 database, you should run it so that it uses the SQC files delivered with PeopleTools 7. Otherwise, the process will not run correctly.

Click to jump to top of pageClick to jump to parent topicRunning the SQR Program

To run the TMDOWNLD SQR program:

  1. Run the TMDOWNLD SQR program from the SQR command line.

  2. Follow the system prompts.

    Note. There is no associated run control page with this SQR for PeopleSoft 7 or 7.5 databases. In order to schedule this process to run without manual intervention, you need to create a run control for the process. See your PeopleTools manual for more information on creating run controls.

See Also

SQR documentation.

Introducing the Sample SQR Program

Click to jump to parent topicCustomizing TreeMover for Additional Node and Level Data Records

This section discusses how to:

Note. Creating TreeMover customization for moving non-standard node and detail user data is a complicated process. Oracle recommends using PeopleSoft Data Mover or other database tool when you move user data from a source database to a target database.

The TreeMover program only moves data in the standard PeopleSoft tree tables. PeopleSoft trees generally have application node data stored in the PS_TREE_NODE_TBL table and application level data stored in the PS_TREE_LEVEL_TBL table.

However, the tables used to hold the application data for the detail values, such as leaves, are always application-specific; there are no default tables for storing that application data. For example, you might have trees that reference employees as leaf values, and the employee information is stored in the PERSONAL_DATA_TBL table. TreeMover does not handle moving data from application tables. Generally, when you move trees between different PeopleSoft databases, you should move the application data using other means, such as with DataMover. However, you can also customize the TreeMover program to copy other application data. As with any PeopleSoft application, you should avoid performing any customizations whenever possible.

Note. Before customizing TreeMover, you should consider the tables for which you intend to add support. Application tables that hold data used by other parts of the PeopleSoft system should be moved by other means, such as DataMover.

Click to jump to top of pageClick to jump to parent topicModifying the TreeMover Application Engine Program

The TreeMover process is a PeopleSoft Application Engine process called TREEMOVER. To add support for additional node and level tables, you must perform two basic steps: create the file layout to be used for the new data and modify the TREEMOVER_AET PeopleCode according to the following steps.

Note. You should not need to make any modifications to the actual Application Engine code.

To modify the TreeMover Application Engine program:

  1. Create file layouts for your desired tree node data record or tree level data record using Application Designer file layout functionality.

    Use one of the existing TreeMover file layouts as an example (TREE_DEFN, TREE_NODE, and so on). Each file layout you add for TreeMover must have a unique file record ID, which is specified as part of the file layout record properties; the existing TreeMover file layouts use numbers 1 through 6.

    Each file layout you add must also have the UPDATE_ACTION field.

  2. In the TREEMOVER_AET record, modify the PROCESS_INSTANCE FieldFormula PeopleCode as follows:

Note. In the steps above, do not modify the original code in the functions. You should add new code only within new “if” conditions. If you change any of the existing code, trees based on the PS_TREE_LEVEL_TBL and PS_TREE_NODE_TBL will no longer be handled with TreeMover.

Click to jump to top of pageClick to jump to parent topicModifying the TreeMover SQR Program

If you have modified the TREEMOVER Application Engine program, then you also need to make similar changes to the TMDOWNLD.SQR, assuming you’re using that SQR to download trees from a PeopleSoft 7.x database.

To modify the TMDOWNLD SQR program:

  1. Change the Download-TreeUserLevel procedure to handle the new tree level data tables.

    Be sure to add conditional logic so that the existing logic is still executed when the tree structure uses PS_TREE_LEVEL_TBL. The tree level record name is stored in the variable &TS.LEVEL_RECNAME.

  2. Change the Download-TreeUserNode procedure to handle the new tree node data tables.

    Be sure to add conditional logic so that the existing logic is still executed when the tree structure uses PS_TREE_NODE_TBL. The tree node record name is stored in the variable &TS.NODE_RECNAME.