1 Package pay_qpi_api as
2 /* $Header: pyqpirhi.pkh 120.1 2005/10/04 06:49:42 swinton noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |---------------------------------< lck >----------------------------------|
6 -- ----------------------------------------------------------------------------
7 -- {Start Of Comments}
8 --
9 -- Description:
10 -- The Lck process has two main functions to perform. Firstly, the row to be
11 -- deleted must be locked. The locking of the row will only be
12 -- successful if the row is not currently locked by another user.
13 -- Secondly, during the locking of the row, the row is selected into
14 -- the g_old_rec data structure which enables the current row values from the
15 -- server to be available to the api.
16 --
17 -- Pre Conditions:
18 -- None.
19 --
20 -- In Arguments:
21 -- The arguments to the Lck process are the primary key(s) which uniquely
22 -- identify the row.
23 --
24 -- Post Success:
25 -- On successful completion of the Lck process the row to be updated or
26 -- deleted will be locked and selected into the global data structure
27 -- g_old_rec.
28 --
29 -- Post Failure:
30 -- The Lck process can fail for two reasons:
31 -- 1) When attempting to lock the row the row could already be locked by
32 -- another user. This will raise the error HR_7165_OBJECT_LOCKED.
33 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
34 -- This error is trapped and reported using the message name
35 -- 'HR_7220_INVALID_PRIMARY_KEY'.
36 --
37 -- Access Status:
38 -- Public.
39 --
40 -- {End Of Comments}
41 --
42 procedure lck
43 (p_element_entry_id in number
44 ,p_assignment_action_id in number
45 );
46 --
47 -- ----------------------------------------------------------------------------
48 -- |---------------------------------< ins >----------------------------------|
49 -- ----------------------------------------------------------------------------
50 -- {Start Of Comments}
51 --
52 -- Description:
53 -- This procedure is the record interface for the insert business process
54 -- for the specified entity. The role of this process is to insert a fully
55 -- validated row, into the HR schema.
56 -- 1) If the p_validate argument has been set to true then a savepoint is
57 -- issued.
58 -- 2) The controlling validation process insert_validate is then executed
59 -- which will execute all private and public validation business rule
60 -- processes.
61 -- 3) The insert_dml process will physical perform the insert dml into the
62 -- specified entity.
63 -- 4) If the p_validate argument has been set to true an exception is raised
64 -- which is handled and processed by performing a rollback to the
65 -- savepoint which was issued at the beginning of the Ins process
66 --
67 -- Pre Conditions:
68 -- The main arguments to the business process have to be in the record
69 -- format.
70 --
71 -- In Arguments:
72 -- p_validate
73 -- Determines if the business process is to be validated. Setting this
74 -- boolean value to true will invoke the process to be validated. The
75 -- default is false. The validation is controlled by a savepoint and
76 -- rollback mechanism. The savepoint is issued at the beginning of the
77 -- business process and is rollbacked at the end of the business process
78 -- when all the processing has been completed. The rollback is controlled
79 -- by raising and handling the exception hr_api.validate_enabled. We use
80 -- the exception because, by raising the exception with the business
81 -- process, we can exit successfully without having any of the 'OUT'
82 -- arguments being set.
83 --
84 -- Post Success:
85 -- A fully validated row will be inserted into the specified entity
86 -- without being committed. If the p_validate argument has been set to true
87 -- then all the work will be rolled back.
88 --
89 -- Post Failure:
90 -- If an error has occurred, an error message will be supplied with the work
91 -- rolled back.
92 -- An insert will be disallowed if any of the following conditions are
93 -- found:
94 -- 1) An Assignment Process with an id of p_rec.assignment_action_id does
95 -- not exist.
96 -- 2) The Assignment Process does exist but it is not for a 'QuickPay Run'
97 -- Payroll Process.
98 -- 3) The Assignment Process has a status of complete.
99 -- 4) The Payroll Process current_task is not null.
100 -- 5) No Element Entry exists with an id of p_rec.element_entry_id.
101 -- 6) The entry is not for the assignment defined on the QuickPay Run
102 -- definition.
103 -- 7) The element type cannot be processed in run.
104 -- 8) The element entry does not exist as of the QuickPay date earned.
105 -- 9) The entry type is a balance adjustment, replacement adjustment
106 -- or additive adjustment.
107 -- 10) The element type is non-recurring and it has already been processed.
108 -- 11) The element type is recurring, the entry type is 'Additional entry'
109 -- or 'Override' and it has already processed.
110 -- 12) A QuickPay Inclusion for this Assignment Process and Element Entry
111 -- already exists.
112 --
113 -- Access Status:
114 -- Public.
115 --
116 -- {End Of Comments}
117 --
118 procedure ins
119 (p_rec in out nocopy pay_quickpay_inclusions%ROWTYPE
120 ,p_validate in boolean default false
121 );
122 --
123 -- ----------------------------------------------------------------------------
124 -- |---------------------------------< ins >----------------------------------|
125 -- ----------------------------------------------------------------------------
126 -- {Start Of Comments}
127 --
128 -- Description:
129 -- This procedure is the attribute interface for the insert business
130 -- process for QuickPay Inclusions and is the outermost layer. The role
131 -- of this process is to insert a fully validated row into the HR schema.
132 -- The processing of this procedure is as follows:
133 -- 1) The attributes are converted into a local record structure by
134 -- calling an internal convert_args function.
135 -- 2) After the conversion has taken place, the corresponding record ins
136 -- interface business process is executed.
137 -- 3) OUT arguments are then set to their corresponding record arguments.
138 --
139 -- Pre Conditions:
140 --
141 -- In Arguments:
142 -- p_validate
143 -- Determines if the business process is to be validated. Setting this
144 -- Boolean value to true will invoke the process to be validated.
145 -- The default is false.
146 --
147 -- Post Success:
148 -- A fully validated row will be inserted for QuickPay Inclusions
149 -- without being committed (or rollbacked depending on the p_validate
150 -- status).
151 --
152 -- Post Failure:
153 -- If an error has occurred, an error message will be supplied with the work
154 -- rolled back. For full details of the error conditions refer to the
155 -- 'ins' record interface.
156 --
157 -- Developer Implementation Notes:
158 -- None.
159 --
160 -- Access Status:
161 -- Public.
162 --
163 -- {End Of Comments}
164 --
165 procedure ins
166 (p_element_entry_id in number
167 ,p_assignment_action_id in number
168 ,p_validate in boolean default false
169 );
170 --
171 -- ----------------------------------------------------------------------------
172 -- |-------------------------< bulk_default_ins >-----------------------------|
173 -- ----------------------------------------------------------------------------
174 -- {Start Of Comments}
175 --
176 -- Description:
177 -- Inserts all default QuickPay Inclusions rows for one QuickPay Run
178 -- assignment process. This is faster than using the single row insert
179 -- procedures (ins record and attribute) as the assignment process and
180 -- element entry validation is only executed once.
181 -- Used when an assignment process has just been inserted for a QuickPay Run
182 -- payroll process.
183 --
184 -- Pre Conditions:
185 -- The QuickPay Run Payroll Process and Assignment Process details have
186 -- already been inserted into the HR schema. No QuickPay Inclusions exist
187 -- for the Assignment Process.
188 --
189 -- In Arguments:
190 -- p_assignment_action_id is the id of an inserted assignment process.
191 -- p_validate is set to true or false. This argument works in the same way
192 -- as the p_validate for the ins procedures.
193 --
194 -- Post Success:
195 -- Inserts a row into pay_quickpay_inclusions for every element entry
196 -- which match all of these conditions:
197 -- 1) The entry is for the assignment defined on the QuickPay Run
198 -- definition.
199 -- 2) The element type can be processed in run.
200 -- 3) The entry exists as of the QuickPay date earned.
201 -- 4) The entry type is not a balance adjustment, replacement adjustment
202 -- or additive adjustment.
203 -- 5) Non-recurring entries are only included if they have not already
204 -- been processed.
205 -- 6) Recurring entries which have an entry type of 'Additional entry'
206 -- or 'Override', are only included they have have not already been
207 -- processed.
208 --
209 -- Post Failure:
210 -- An error is raised and the insert is aborted if any of the following
211 -- conditions are found:
212 -- 1) An Assignment Process with the id p_assignment_action_id does not
213 -- exist.
214 -- 2) The corresponding Payroll Process for this Assignment Process is not
215 -- for a QuickPay Run.
216 -- 3) The Assignment Process has an action_status of 'C' for Complete.
217 --
218 -- Access Status:
219 -- Public.
220 --
221 -- {End Of Comments}
222 --
223 procedure bulk_default_ins
224 (p_assignment_action_id in pay_assignment_actions.assignment_action_id%TYPE
225 ,p_validate in boolean default false
226 );
227 --
228 -- ----------------------------------------------------------------------------
229 -- |---------------------------------< del >----------------------------------|
230 -- ----------------------------------------------------------------------------
231 -- {Start Of Comments}
232 --
233 -- Description:
234 -- This procedure is the record interface for the delete business process
235 -- for QuickPay Inclusions. The role of this process is to delete the
236 -- row from the HR schema. This process is the main backbone of the del
237 -- business process. The processing of this procedure is as follows:
238 -- 1) If the p_validate argument has been set to true then a savepoint is
239 -- issued.
240 -- 2) The controlling validation process delete_validate is then executed
241 -- which will execute all private and public validation business rule
242 -- processes.
243 -- 3) The pre_delete business process is then executed which enables any
244 -- logic to be processed before the delete dml process is executed.
245 -- 4) The delete_dml process will physical perform the delete dml for the
246 -- specified row.
247 -- 5) The post_delete business process is then executed which enables any
248 -- logic to be processed after the delete dml process.
249 -- 6) If the p_validate argument has been set to true an exception is raised
250 -- which is handled and processed by performing a rollback to the
251 -- savepoint which was issued at the beginning of the del process.
252 --
253 -- Pre Conditions:
254 -- The main arguments to the business process have to be in the record
255 -- format.
256 --
257 -- In Arguments:
258 -- p_validate
259 -- Determines if the business process is to be validated. Setting this
260 -- boolean value to true will invoke the process to be validated. The
261 -- default is false. The validation is controlled by a savepoint and
262 -- rollback mechanism. The savepoint is issued at the beginning of the
263 -- business process and is rollbacked at the end of the business process
264 -- when all the processing has been completed. The rollback is controlled
265 -- by raising and handling the exception hr_api.validate_enabled. We use
266 -- the exception because, by raising the exception with the business
267 -- process, we can exit successfully without having any of the 'OUT'
268 -- arguments being set.
269 --
270 -- Post Success:
271 -- The specified row will be fully validated and deleted without being
272 -- committed. If the p_validate argument has been set to true then all the
273 -- work will be rolled back.
274 --
275 -- Post Failure:
276 -- If an error has occurred, an error message will be supplied with the work
277 -- rolled back.
278 -- A delete will be disallowed if any of the following conditions are
279 -- found:
280 -- 1) The corresponding Assignment Process has an action_status of
281 -- Complete.
282 -- 2) The corresponding Payroll Process has a current_task which is
283 -- not null.
284 --
285 -- Developer Implementation Notes:
286 -- None.
287 --
288 -- Access Status:
289 -- Public.
290 --
291 -- {End Of Comments}
292 --
293 procedure del
294 (p_rec in pay_quickpay_inclusions%ROWTYPE
295 ,p_validate in boolean default false
296 );
297 --
298 -- ----------------------------------------------------------------------------
299 -- |---------------------------------< del >----------------------------------|
300 -- ----------------------------------------------------------------------------
301 -- {Start Of Comments}
302 --
303 -- Description:
304 -- This procedure is the attribute interface for the delete business
305 -- process for QuickPay Inclusions and is the outermost layer. The role
306 -- of this process is to validate and delete the specified row from the
307 -- HR schema. The processing of this procedure is as follows:
308 -- 1) The attributes are converted into a local record structure by
309 -- explicitly coding the attribute arguments into the
310 -- pay_quickpay_inclusion%ROWTYPE datatype.
311 -- 2) After the conversion has taken place, the corresponding record del
312 -- interface business process is executed.
313 --
314 -- Pre Conditions:
315 --
316 -- In Arguments:
317 -- p_validate
318 -- Determines if the business process is to be validated. Setting this
319 -- Boolean value to true will invoke the process to be validated.
320 -- The default is false.
321 --
322 -- Post Success:
323 -- The specified row will be fully validated and deleted for the specified
324 -- entity without being committed (or rollbacked depending on the
325 -- p_validate status).
326 --
327 -- Post Failure:
328 -- If an error has occurred, an error message will be supplied with the work
329 -- rolled back.
330 --
331 -- Access Status:
332 -- Public.
333 --
334 -- {End Of Comments}
335 --
336 procedure del
337 (p_element_entry_id in number
338 ,p_assignment_action_id in number
339 ,p_validate in boolean default false
340 );
341 --
342 end pay_qpi_api;