1 PACKAGE HZ_HIERARCHY_V2PUB AS
2 /*$Header: ARH2HISS.pls 120.7 2006/08/17 10:19:03 idali noship $*/
3 /*#
4 * This package includes the public APIs for hierarchy retrieval.
5 * @rep:scope public
6 * @rep:product HZ
7 * @rep:displayname Hierarchy Retrieval
8 * @rep:category BUSINESS_ENTITY HZ_RELATIONSHIP
9 * @rep:lifecycle active
10 * @rep:doccd 120hztig.pdf Hierarchy Retrieval APIs, Oracle Trading Community Architecture Technical Implementation Guide
11 */
12
13 -----------------------------
14 -- declaration of record type
15 -----------------------------
16
17 TYPE related_nodes_list_rec IS RECORD (
18 related_node_id NUMBER(15),
19 related_node_table_name VARCHAR2(30),
20 related_node_object_type VARCHAR2(30),
21 level_number NUMBER(15),
22 top_parent_flag VARCHAR2(1),
23 leaf_child_flag VARCHAR2(1),
24 effective_start_date DATE,
25 effective_end_date DATE,
26 relationship_id NUMBER(15)
27 );
28
29 TYPE related_nodes_list_type IS TABLE OF related_nodes_list_rec INDEX BY BINARY_INTEGER;
30
31 -------------------------------------------------
32 -- declaration of public procedures and functions
33 -------------------------------------------------
34
35 /*#
36 * Use this routine to determine whether or not an entity is the top parent, or root, of a
37 * hierarchy. You must pass a valid hierarchy relationship type and any necessary parent
38 * information to the API, which then returns Y or N.
39 * @rep:scope public
40 * @rep:lifecycle active
41 * @rep:displayname Verify Top Parent Check
42 * @rep:doccd 120hztig.pdf Hierarchy Retrieval APIs, Oracle Trading Community Architecture Technical Implementation Guide
43 */
44 PROCEDURE is_top_parent(
45 p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
46 p_hierarchy_type IN VARCHAR2,
47 p_parent_id IN NUMBER,
48 p_parent_table_name IN VARCHAR2 := 'HZ_PARTIES',
49 p_parent_object_type IN VARCHAR2 := 'ORGANIZATION',
50 p_effective_date IN DATE := SYSDATE,
51 x_result OUT NOCOPY VARCHAR2,
52 x_return_status OUT NOCOPY VARCHAR2,
53 x_msg_count OUT NOCOPY NUMBER,
54 x_msg_data OUT NOCOPY VARCHAR2
55 );
56
57 /*#
58 * Use this routine to check whether two entities have a parent-child relationship in a
59 * hierarchy. You must pass a valid hierarchy relationship type and any necessary parent
60 * and child information to the API, which then returns Y or N.
61 * @rep:scope public
62 * @rep:lifecycle active
63 * @rep:displayname Verify Parent Child Relationship
64 * @rep:doccd 120hztig.pdf Hierarchy Retrieval APIs, Oracle Trading Community Architecture Technical Implementation Guide
65 */
66 PROCEDURE check_parent_child(
67 p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
68 p_hierarchy_type IN VARCHAR2,
69 p_parent_id IN NUMBER,
70 p_parent_table_name IN VARCHAR2 := 'HZ_PARTIES',
71 p_parent_object_type IN VARCHAR2 := 'ORGANIZATION',
72 p_child_id IN NUMBER,
73 p_child_table_name IN VARCHAR2 := 'HZ_PARTIES',
74 p_child_object_type IN VARCHAR2 := 'ORGANIZATION',
75 p_effective_date IN DATE := SYSDATE,
76 x_result OUT NOCOPY VARCHAR2,
77 x_level_number OUT NOCOPY NUMBER,
78 x_return_status OUT NOCOPY VARCHAR2,
79 x_msg_count OUT NOCOPY NUMBER,
80 x_msg_data OUT NOCOPY VARCHAR2
81 );
82
83 /*#
84 * Use this routine to retrieve the parent nodes of a child in a hierarchy. You must pass
85 * a valid hierarchy relationship type and any necessary parent type and child node
86 * information to the API, which then returns a set of parent nodes in that hierarchy.
87 * @rep:scope public
88 * @rep:lifecycle active
89 * @rep:displayname Get Parent Nodes
90 * @rep:doccd 120hztig.pdf Hierarchy Retrieval APIs, Oracle Trading Community Architecture Technical Implementation Guide
91 */
92 PROCEDURE get_parent_nodes(
93 p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
94 p_hierarchy_type IN VARCHAR2,
95 p_child_id IN NUMBER,
96 p_child_table_name IN VARCHAR2,
97 p_child_object_type IN VARCHAR2,
98 p_parent_table_name IN VARCHAR2,
99 p_parent_object_type IN VARCHAR2,
100 p_include_node IN VARCHAR2 := 'Y',
101 p_effective_date IN DATE := SYSDATE,
102 p_no_of_records IN NUMBER := 100,
103 x_related_nodes_list OUT NOCOPY RELATED_NODES_LIST_TYPE,
104 x_return_status OUT NOCOPY VARCHAR2,
105 x_msg_count OUT NOCOPY NUMBER,
106 x_msg_data OUT NOCOPY VARCHAR2
107 );
108
109 /*#
110 * Use this routine to retrieve the child nodes of a parent in a hierarchy. You must pass
111 * a valid hierarchy relationship type and any necessary child type and parent node
112 * information to the API, which then returns a set of child nodes in that hierarchy.
113 * @rep:scope public
114 * @rep:lifecycle active
115 * @rep:displayname Get Child Nodes
116 * @rep:doccd 120hztig.pdf Hierarchy Retrieval APIs, Oracle Trading Community Architecture Technical Implementation Guide
117 */
118 PROCEDURE get_child_nodes(
119 p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
120 p_hierarchy_type IN VARCHAR2,
121 p_parent_id IN NUMBER,
122 p_parent_table_name IN VARCHAR2,
123 p_parent_object_type IN VARCHAR2,
124 p_child_table_name IN VARCHAR2,
125 p_child_object_type IN VARCHAR2,
126 p_include_node IN VARCHAR2 := 'Y',
127 p_effective_date IN DATE := SYSDATE,
128 p_no_of_records IN NUMBER := 100,
129 x_related_nodes_list OUT NOCOPY RELATED_NODES_LIST_TYPE,
130 x_return_status OUT NOCOPY VARCHAR2,
131 x_msg_count OUT NOCOPY NUMBER,
132 x_msg_data OUT NOCOPY VARCHAR2
133 );
134
135 /*#
136 * Use this routine to retrieve the top parent nodes in a hierarchy. You must pass a
137 * valid hierarchy relationship type to the API, which then returns a set of the top parent
138 * nodes in that hierarchy.
139 * @rep:scope public
140 * @rep:lifecycle active
141 * @rep:displayname Get Top Parent Nodes
142 * @rep:doccd 120hztig.pdf Hierarchy Retrieval APIs, Oracle Trading Community Architecture Technical Implementation Guide
143 */
144 PROCEDURE get_top_parent_nodes(
145 p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
146 p_hierarchy_type IN VARCHAR2,
147 p_parent_table_name IN VARCHAR2 := 'HZ_PARTIES',
148 p_parent_object_type IN VARCHAR2 := 'ALL',
149 p_effective_date IN DATE := SYSDATE,
150 p_no_of_records IN NUMBER := 100,
151 x_top_parent_list OUT NOCOPY RELATED_NODES_LIST_TYPE,
152 x_return_status OUT NOCOPY VARCHAR2,
153 x_msg_count OUT NOCOPY NUMBER,
154 x_msg_data OUT NOCOPY VARCHAR2
155 );
156
157 END HZ_HIERARCHY_V2PUB;