1 Package per_dpf_shd AUTHID CURRENT_USER as
2 /* $Header: pedpfrhi.pkh 120.0 2005/05/31 07:45:06 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 deployment_factor_id number(9),
11 position_id per_deployment_factors.position_id%TYPE,
12 person_id per_deployment_factors.person_id%TYPE,
13 job_id number(9),
14 business_group_id number(15),
15 work_any_country varchar2(30),
16 work_any_location varchar2(30),
17 relocate_domestically varchar2(30),
18 relocate_internationally varchar2(30),
19 travel_required varchar2(30),
20 country1 varchar2(30),
21 country2 varchar2(30),
22 country3 varchar2(30),
23 work_duration varchar2(30),
24 work_schedule varchar2(30),
25 work_hours varchar2(30),
26 fte_capacity varchar2(30),
27 visit_internationally varchar2(30),
28 only_current_location varchar2(30),
29 no_country1 varchar2(30),
30 no_country2 varchar2(30),
31 no_country3 varchar2(30),
32 comments varchar2(2000), -- pseudo column
33 earliest_available_date date,
34 available_for_transfer varchar2(30),
35 relocation_preference varchar2(30),
36 relocation_required varchar2(30),
37 passport_required varchar2(30),
38 location1 varchar2(30),
39 location2 varchar2(30),
40 location3 varchar2(30),
41 other_requirements varchar2(2000),
42 service_minimum varchar2(30),
43 object_version_number number(9),
44 attribute_category varchar2(30),
45 attribute1 varchar2(150),
46 attribute2 varchar2(150),
47 attribute3 varchar2(150),
48 attribute4 varchar2(150),
49 attribute5 varchar2(150),
50 attribute6 varchar2(150),
51 attribute7 varchar2(150),
52 attribute8 varchar2(150),
53 attribute9 varchar2(150),
54 attribute10 varchar2(150),
55 attribute11 varchar2(150),
56 attribute12 varchar2(150),
57 attribute13 varchar2(150),
58 attribute14 varchar2(150),
59 attribute15 varchar2(150),
60 attribute16 varchar2(150),
61 attribute17 varchar2(150),
62 attribute18 varchar2(150),
63 attribute19 varchar2(150),
64 attribute20 varchar2(150)
65 );
66 --
67 -- ----------------------------------------------------------------------------
68 -- | Global Definitions - Internal Development Use Only |
69 -- ----------------------------------------------------------------------------
70 --
71 g_old_rec g_rec_type; -- Global record definition
72 g_api_dml boolean; -- Global api dml status
73 --
74 -- ----------------------------------------------------------------------------
75 -- |------------------------< return_api_dml_status >-------------------------|
76 -- ----------------------------------------------------------------------------
77 -- {Start Of Comments}
78 --
79 -- Description:
80 -- This function will return the current g_api_dml private global
81 -- boolean status.
82 -- The g_api_dml status determines if at the time of the function
83 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
84 -- is being issued from within an api.
85 -- If the status is TRUE then a dml statement is being issued from
86 -- within this entity api.
87 -- This function is primarily to support database triggers which
88 -- need to maintain the object_version_number for non-supported
89 -- dml statements (i.e. dml statement issued outside of the api layer).
90 --
91 -- Prerequisites:
92 -- None.
93 --
94 -- In Parameters:
95 -- None.
96 --
97 -- Post Success:
98 -- Processing continues.
99 -- If the function returns a TRUE value then, dml is being executed from
100 -- within this api.
101 --
102 -- Post Failure:
103 -- None.
104 --
105 -- Access Status:
106 -- Internal Row Handler Use Only.
107 --
108 -- {End Of Comments}
109 -- ----------------------------------------------------------------------------
110 Function return_api_dml_status Return Boolean;
111 --
112 -- ----------------------------------------------------------------------------
113 -- |---------------------------< constraint_error >---------------------------|
114 -- ----------------------------------------------------------------------------
115 -- {Start Of Comments}
116 --
117 -- Description:
118 -- This procedure is called when a constraint has been violated (i.e.
119 -- The exception hr_api.check_integrity_violated,
120 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
121 -- hr_api.unique_integrity_violated has been raised).
122 -- The exceptions can only be raised as follows:
123 -- 1) A check constraint can only be violated during an INSERT or UPDATE
124 -- dml operation.
125 -- 2) A parent integrity constraint can only be violated during an
126 -- INSERT or UPDATE dml operation.
127 -- 3) A child integrity constraint can only be violated during an
128 -- DELETE dml operation.
129 -- 4) A unique integrity constraint can only be violated during INSERT or
130 -- UPDATE dml operation.
131 --
132 -- Prerequisites:
133 -- 1) Either hr_api.check_integrity_violated,
134 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
135 -- hr_api.unique_integrity_violated has been raised with the subsequent
136 -- stripping of the constraint name from the generated error message
137 -- text.
138 -- 2) Standalone validation test which corresponds with a constraint error.
139 --
140 -- In Parameter:
141 -- p_constraint_name is in upper format and is just the constraint name
142 -- (e.g. not prefixed by brackets, schema owner etc).
143 --
144 -- Post Success:
145 -- Development dependant.
146 --
147 -- Post Failure:
148 -- Developement dependant.
149 --
150 -- Developer Implementation Notes:
151 -- For each constraint being checked the hr system package failure message
152 -- has been generated as a template only. These system error messages should
153 -- be modified as required (i.e. change the system failure message to a user
154 -- friendly defined error message).
155 --
156 -- Access Status:
157 -- Internal Development Use Only.
158 --
159 -- {End Of Comments}
160 -- ----------------------------------------------------------------------------
161 Procedure constraint_error
162 (p_constraint_name in all_constraints.constraint_name%TYPE);
163 --
164 -- ----------------------------------------------------------------------------
165 -- |-----------------------------< api_updating >-----------------------------|
166 -- ----------------------------------------------------------------------------
167 -- {Start Of Comments}
168 --
169 -- Description:
170 -- This function is used to populate the g_old_rec record with the
171 -- current row from the database for the specified primary key
172 -- provided that the primary key exists and is valid and does not
173 -- already match the current g_old_rec. The function will always return
174 -- a TRUE value if the g_old_rec is populated with the current row.
175 -- A FALSE value will be returned if all of the primary key arguments
176 -- are null.
177 --
178 -- Prerequisites:
179 -- None.
180 --
181 -- In Parameters:
182 --
183 -- Post Success:
184 -- A value of TRUE will be returned indiciating that the g_old_rec
185 -- is current.
186 -- A value of FALSE will be returned if all of the primary key arguments
187 -- have a null value (this indicates that the row has not be inserted into
188 -- the Schema), and therefore could never have a corresponding row.
189 --
190 -- Post Failure:
191 -- A failure can only occur under two circumstances:
192 -- 1) The primary key is invalid (i.e. a row does not exist for the
193 -- specified primary key values).
194 -- 2) If an object_version_number exists but is NOT the same as the current
195 -- g_old_rec value.
196 --
197 -- Developer Implementation Notes:
198 -- None.
199 --
200 -- Access Status:
201 -- Internal Development Use Only.
202 --
203 -- {End Of Comments}
204 -- ----------------------------------------------------------------------------
205 Function api_updating
206 (
207 p_deployment_factor_id in number,
208 p_object_version_number in number
209 ) Return Boolean;
210 --
211 -- ----------------------------------------------------------------------------
212 -- |---------------------------------< lck >----------------------------------|
213 -- ----------------------------------------------------------------------------
214 -- {Start Of Comments}
215 --
216 -- Description:
217 -- The Lck process has two main functions to perform. Firstly, the row to be
218 -- updated or deleted must be locked. The locking of the row will only be
219 -- successful if the row is not currently locked by another user.
220 -- Secondly, during the locking of the row, the row is selected into
221 -- the g_old_rec data structure which enables the current row values from the
222 -- server to be available to the api.
223 --
224 -- Prerequisites:
225 -- When attempting to call the lock the object version number (if defined)
226 -- is mandatory.
227 --
228 -- In Parameters:
229 -- The arguments to the Lck process are the primary key(s) which uniquely
230 -- identify the row and the object version number of row.
231 --
232 -- Post Success:
233 -- On successful completion of the Lck process the row to be updated or
234 -- deleted will be locked and selected into the global data structure
235 -- g_old_rec.
236 --
237 -- Post Failure:
238 -- The Lck process can fail for three reasons:
239 -- 1) When attempting to lock the row the row could already be locked by
240 -- another user. This will raise the HR_Api.Object_Locked exception.
241 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
242 -- This error is trapped and reported using the message name
243 -- 'HR_7220_INVALID_PRIMARY_KEY'.
244 -- 3) The row although existing in the HR Schema has a different object
245 -- version number than the object version number specified.
246 -- This error is trapped and reported using the message name
247 -- 'HR_7155_OBJECT_INVALID'.
248 --
249 -- Developer Implementation Notes:
250 -- For each primary key and the object version number arguments add a
251 -- call to hr_api.mandatory_arg_error procedure to ensure that these
252 -- argument values are not null.
253 --
254 -- Access Status:
255 -- Internal Development Use Only.
256 --
257 -- {End Of Comments}
258 -- ----------------------------------------------------------------------------
259 Procedure lck
260 (
261 p_deployment_factor_id in number,
262 p_object_version_number in number
263 );
264 --
265 -- ----------------------------------------------------------------------------
266 -- |-----------------------------< convert_args >-----------------------------|
267 -- ----------------------------------------------------------------------------
268 -- {Start Of Comments}
269 --
270 -- Description:
271 -- This function is used to turn attribute parameters into the record
272 -- structure parameter g_rec_type.
273 --
274 -- Prerequisites:
275 -- This is a private function and can only be called from the ins or upd
276 -- attribute processes.
277 --
278 -- In Parameters:
279 --
280 -- Post Success:
281 -- A returning record structure will be returned.
282 --
283 -- Post Failure:
284 -- No direct error handling is required within this function. Any possible
285 -- errors within this function will be a PL/SQL value error due to conversion
286 -- of datatypes or data lengths.
287 --
288 -- Developer Implementation Notes:
289 -- None.
290 --
291 -- Access Status:
292 -- Internal Row Handler Use Only.
293 --
294 -- {End Of Comments}
295 -- ----------------------------------------------------------------------------
296 Function convert_args
297 (
298 p_deployment_factor_id in number,
299 p_position_id in number,
300 p_person_id in number,
301 p_job_id in number,
302 p_business_group_id in number,
303 p_work_any_country in varchar2,
304 p_work_any_location in varchar2,
305 p_relocate_domestically in varchar2,
306 p_relocate_internationally in varchar2,
307 p_travel_required in varchar2,
308 p_country1 in varchar2,
309 p_country2 in varchar2,
310 p_country3 in varchar2,
311 p_work_duration in varchar2,
312 p_work_schedule in varchar2,
313 p_work_hours in varchar2,
314 p_fte_capacity in varchar2,
315 p_visit_internationally in varchar2,
316 p_only_current_location in varchar2,
317 p_no_country1 in varchar2,
318 p_no_country2 in varchar2,
319 p_no_country3 in varchar2,
320 p_comments in varchar2,
321 p_earliest_available_date in date,
322 p_available_for_transfer in varchar2,
323 p_relocation_preference in varchar2,
324 p_relocation_required in varchar2,
325 p_passport_required in varchar2,
326 p_location1 in varchar2,
327 p_location2 in varchar2,
328 p_location3 in varchar2,
329 p_other_requirements in varchar2,
330 p_service_minimum in varchar2,
331 p_object_version_number in number,
332 p_attribute_category in varchar2,
333 p_attribute1 in varchar2,
334 p_attribute2 in varchar2,
335 p_attribute3 in varchar2,
336 p_attribute4 in varchar2,
337 p_attribute5 in varchar2,
338 p_attribute6 in varchar2,
339 p_attribute7 in varchar2,
340 p_attribute8 in varchar2,
341 p_attribute9 in varchar2,
342 p_attribute10 in varchar2,
343 p_attribute11 in varchar2,
344 p_attribute12 in varchar2,
345 p_attribute13 in varchar2,
346 p_attribute14 in varchar2,
347 p_attribute15 in varchar2,
348 p_attribute16 in varchar2,
349 p_attribute17 in varchar2,
350 p_attribute18 in varchar2,
351 p_attribute19 in varchar2,
352 p_attribute20 in varchar2
353 )
354 Return g_rec_type;
355 --
356 end per_dpf_shd;