1 Package hr_api_hook_internal AUTHID CURRENT_USER as
2 /* $Header: peahkbsi.pkh 115.1 2002/12/03 16:28:52 apholt ship $ */
3 --
4 --
5 -- -------------------------------------------------------------------
6 -- |---------------------< create_api_hook >-------------------------|
7 -- -------------------------------------------------------------------
8 -- {Start Of Comments}
9 --
10 -- Description:
11 -- The HR_API_HOOKS table lists the points which are available in each API
12 -- module. It contains data sourced from the HR core Development team. If
13 -- legislation group/ partners and legislation vertical market groups
14 -- implement additional APIs which have user hooks they will also own rows
15 -- in the table. Each row is created using this procedure.
16 --
17 -- Each row should be a child of a parent API module which already exists on
18 -- the HR_API_MODULES table. The p_api_module_id acts as a foreign key to
19 -- this table.
20 --
21 -- The hook package and hook procedure parms are both mandatory. An API
22 -- developer should not create two different hook points which call the same
23 -- hook package. The combination of hook package and hook procedure should be
24 -- unique in HR_API_HOOKS.
25 --
26 -- The Legislation Code value should only be set if the API module contains at
27 -- least one user hook and will be maintained by a legislation group or a
28 -- legislation vertical market. Only the legislation group which created the
29 -- row where the Legislation Code is not null can update or delete the row.
30 -- A null value in Legislation Code indicates that the API module contains at
31 -- least one user hook, was implemented and is maintained by HR core
32 -- development. Only HR core development can maintain rows where Legislation
33 -- Code is Null. Again, these two rules are not enforced by code.
34 --
35 -- The Legislation Package defines the name of the database package to be
36 -- called to derive the legislation code. The legislation function is
37 -- contained within this package. The function must return the legislation
38 -- code and any parms it needs must be available in the hook package. This
39 -- function will only be called when legislation specific logic exists and
40 -- p_business_group_id is not a parm to the hook package procedure.
41 -- Legislation package and function must be both null or both not null. If
42 -- either of these two columns are populated then the other must also be
43 -- populated. Or both must contain blank values.
44 --
45 -- Prerequisites:
46 -- An API Module must have been created so that the Hook can be attached to
47 -- it.
48 --
49 -- In Parameters:
50 -- Name Reqd Type Description
51 -- p_validate N boolean If true, the database remains
52 -- unchanged. If false a valid
53 -- hook is created in
54 -- the database.
55 -- p_effective_date Y date Effective date of the row.
56 --
57 -- p_api_module_id Y number The id of the parent API
58 -- module
59 --
60 -- p_api_hook_type Y varchar2 The type of the hook. Should
61 -- be AI, AU or AD if the parent
62 -- module is a Row Handler.
63 -- Should be BP or AP if the
64 -- parent module is an API
65 --
66 -- p_hook_package Y varchar2 Hook package name
67 --
68 -- p_hook_procedure Y varchar2 Hook Procedure name.
69 --
70 -- p_legislation_code N varchar2 Legislation Code.
71 --
72 -- p_legislation_package N varchar2 Holds the name of the database
73 -- package containing a function
74 -- to derive the legislation
75 -- code, when the legislation
76 -- specific logic exists and
77 -- p_business_group_id is not a
78 -- known parameter to the hook
79 -- package.
80 --
81 -- p_legislation_function N varchar2 Name of the function within
82 -- the legislation package to
83 -- call when the legislation
84 -- code needs to be known.
85 --
86 -- Post Success:
87 -- The API sets the following out parameters:
88 --
89 -- Name Type Description
90 -- p_api_hook_id number Unique ID for the hook
91 -- created by the API
92 --
93 -- Post Failure:
94 -- The API does not create the hook and raises an error.
95 --
96 -- Access Status:
97 -- Public.
98 --
99 -- {End Of Comments}
100 --
101 procedure create_api_hook
102 (p_validate in boolean default false,
103 p_effective_date in date,
104 p_api_module_id in number,
105 p_api_hook_type in varchar2,
106 p_hook_package in varchar2,
107 p_hook_procedure in varchar2,
108 p_legislation_code in varchar2 default null,
109 p_legislation_package in varchar2 default null,
110 p_legislation_function in varchar2 default null,
111 p_api_hook_id OUT NOCOPY number);
112 --
113 -- ----------------------------------------------------------------
114 -- |---------------------< delete_api_hook >-------------------------|
115 -- ----------------------------------------------------------------
116 -- {Start Of Comments}
117 --
118 -- Description:
119 -- This API deletes a row on the HR_API_HOOKS table.
120 --
121 -- A hook cannot be deleted if it is reference by a row in the
122 -- HR_API_HOOK_CALLS. Only HR core development can delete a row where
123 -- LEGISLATION_CODE is null. Only the legislation group which created the
124 -- row where legislation code is not not null can delete the row.
125 -- These two checks are not enforced by code.
126 --
127 -- Prerequisites:
128 -- An existing API hook.
129 --
130 -- In Parameters:
131 -- Name Reqd Type Description
132 -- p_validate N boolean If true, the database remains
133 -- unchanged. If false, the hook
134 -- is deleted.
135 --
136 -- p_api_hook_id Y number Unique ID for the hook to be
137 -- deleted.
138 --
139 -- Post Success:
140 -- The API does not set any out parameters
141 --
142 -- Post Failure:
143 -- The API does not delete the hook and raises an error.
144 --
145 -- Access Status:
146 -- Public.
147 --
148 -- {End Of Comments}
149 --
150 procedure delete_api_hook
151 (p_validate in boolean default false,
152 p_api_hook_id in number);
153 --
154 -- ----------------------------------------------------------------
155 -- |---------------------< update_api_hook >-------------------------|
156 -- ----------------------------------------------------------------
157 -- {Start Of Comments}
158 --
159 -- Description:
160 -- This business process allows HR core Development team to update
161 -- existing API hook information.
162 --
163 -- Prerequisites:
164 -- An API Hook must have been created before it can be updated.
165 --
166 -- In Parameters:
167 -- Name Reqd Type Description
168 -- p_validate N boolean If true, the database remains
169 -- unchanged. If false a valid
170 -- hook is updated in the
171 -- database.
172 -- p_effective_date Y date Effective date of the row.
173 --
174 -- p_api_hook_id Y number Unique ID for the hook
175 -- to be updated by the API
176 --
177 -- p_api_hook_type N varchar2 The type of the hook. Should
178 -- be AI, AU or AD if the parent
179 -- module is a Row Handler.
180 -- Should be BP or AP if the
181 -- parent module is an API
182 --
183 -- p_hook_package N varchar2 Hook package name
184 --
185 -- p_hook_procedure N varchar2 Hook Procedure name.
186 --
187 -- p_legislation_package N varchar2 Holds the name of the database
188 -- package containing a function
189 -- to derive the legislation
190 -- code, when the legislation
191 -- specific logic exists and
192 -- p_business_group_id is not a
193 -- known parameter to the hook
194 -- package.
195 --
196 -- p_legislation_function N varchar2 Name of the function within
197 -- the legislation package to
198 -- call when the legislation
199 -- code needs to be known.
200 --
201 -- Post Success:
202 -- The API sets no out parameters.
203 --
204 -- Post Failure:
205 -- The API does not update the hook and raises an error.
206 --
207 -- Access Status:
208 -- Public.
209 --
210 -- {End Of Comments}
211 --
212 procedure update_api_hook
213 (p_validate in boolean default false,
214 p_effective_date in date,
215 p_api_hook_id in number,
216 p_api_hook_type in varchar2 default hr_api.g_varchar2,
217 p_hook_package in varchar2 default hr_api.g_varchar2,
218 p_hook_procedure in varchar2 default hr_api.g_varchar2,
219 p_legislation_package in varchar2 default hr_api.g_varchar2,
220 p_legislation_function in varchar2 default hr_api.g_varchar2
221 );
222 --
223 end hr_api_hook_internal;