PeopleCode Usage with PeopleSoft Trees and Analytic Models
Use the AttachTree and DetachTree methods to work with PeopleSoft trees and analytic models.
AttachTree Method
Use the AttachTree method to:
-
Attach a tree to its corresponding dimension.
Analytic Calculation Engine attaches the tree to the dimension and then creates and displays the hierarchy.
-
Make changes to the tree.
-
Create a record that uses PSACETREEOVRD as a subrecord, then attach the new record to the dimension members to associate the member override function with the hierarchy.
Be aware of these restrictions:
-
Because the AttachTree method attaches a specific tree to an analytic model, the system throws an error if the tree's name, setID, or effective date is incorrect.
-
You can attach only one tree to a dimension.
-
If the analytic model is already loaded into an analytic server, the tree is not attached until the next time that the analytic model is reloaded.
DetachTree Method
Use the DetachTree method to detach the tree from the dimension.
Note:
If the application loads the analytic model after the tree is detached, the analytic model does not create a hierarchy for the dimension.
If the analytic model is already loaded into an analytic server, the DetachTree method is not applied to the tree until the next time the application loads the analytic model.
Updating a Tree at Runtime
To update a tree at runtime, perform these steps:
-
Unload the analytic model.
See PeopleCode API Reference: Unload method: AnalyticInstance class.
-
Use the DetachTree method to detach the tree from the analytic model.
-
Use the AttachTree method's parameters to update the tree with the changes.
Note:
Be aware of the details start level and tree discard level before making any changes to the tree.
-
Reload the analytic model.