[Home] [Help]
PACKAGE BODY: APPS.PER_PAT_SHD
Source
4 -- ----------------------------------------------------------------------------
1 Package Body per_pat_shd as
2 /* $Header: pepatrhi.pkb 120.6 2012/01/10 10:39:57 srannama ship $ */
3 --
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' per_pat_shd.'; -- Global package name
9 g_debug boolean := hr_utility.debug_enabled;
10 --
11 -- ----------------------------------------------------------------------------
12 -- |---------------------------< constraint_error >---------------------------|
13 -- ----------------------------------------------------------------------------
14 Procedure constraint_error
15 (p_constraint_name in all_constraints.constraint_name%TYPE
16 ) Is
17 --
18 l_proc varchar2(72) := g_package||'constraint_error';
19 --
20 Begin
21 --
22 If (p_constraint_name = 'PER_ALLOCATED_TASKS_PK') Then
23 fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
24 fnd_message.set_token('PROCEDURE', l_proc);
25 fnd_message.set_token('STEP','5');
26 fnd_message.raise_error;
27 Else
28 fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
29 fnd_message.set_token('PROCEDURE', l_proc);
30 fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
31 fnd_message.raise_error;
32 End If;
33 --
34 End constraint_error;
35 --
36 -- ----------------------------------------------------------------------------
40 (p_allocated_task_id in number
37 -- |-----------------------------< api_updating >-----------------------------|
38 -- ----------------------------------------------------------------------------
39 Function api_updating
41 ,p_object_version_number in number
42 )
43 Return Boolean Is
44 --
45 --
46 -- Cursor selects the 'current' row from the HR Schema
47 --
48 Cursor C_Sel1 is
49 select
50 allocated_task_id
51 ,allocated_checklist_id
52 ,task_name
53 ,description
54 ,performer_orig_system
55 ,performer_orig_sys_id
56 ,task_owner_person_id
57 ,task_sequence
58 ,target_start_date
59 ,target_end_date
60 ,actual_start_date
61 ,actual_end_date
62 ,action_url
63 ,mandatory_flag
64 ,status
65 ,object_version_number
66 ,attribute_category
67 ,attribute1
68 ,attribute2
69 ,attribute3
70 ,attribute4
71 ,attribute5
72 ,attribute6
73 ,attribute7
74 ,attribute8
75 ,attribute9
76 ,attribute10
77 ,attribute11
78 ,attribute12
79 ,attribute13
80 ,attribute14
81 ,attribute15
82 ,attribute16
83 ,attribute17
84 ,attribute18
85 ,attribute19
86 ,attribute20
87 ,information_category
88 ,information1
89 ,information2
90 ,information3
91 ,information4
92 ,information5
93 ,information6
94 ,information7
95 ,information8
96 ,information9
97 ,information10
98 ,information11
99 ,information12
100 ,information13
101 ,information14
102 ,information15
103 ,information16
104 ,information17
105 ,information18
106 ,information19
107 ,information20
108 from per_allocated_tasks
109 where allocated_task_id = p_allocated_task_id;
110 --
111 l_fct_ret boolean;
112 --
113 Begin
114 --
115 If (p_allocated_task_id is null and
116 p_object_version_number is null
117 ) Then
118 --
119 -- One of the primary key arguments is null therefore we must
120 -- set the returning function value to false
121 --
122 l_fct_ret := false;
123 Else
124 If (p_allocated_task_id
125 = per_pat_shd.g_old_rec.allocated_task_id and
126 p_object_version_number
127 = per_pat_shd.g_old_rec.object_version_number
128 ) Then
129 --
130 -- The g_old_rec is current therefore we must
131 -- set the returning function to true
132 --
133 l_fct_ret := true;
134 Else
135 --
136 -- Select the current row into g_old_rec
137 --
138 Open C_Sel1;
139 Fetch C_Sel1 Into per_pat_shd.g_old_rec;
140 If C_Sel1%notfound Then
141 Close C_Sel1;
142 --
143 -- The primary key is invalid therefore we must error
144 --
145 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
146 fnd_message.raise_error;
147 End If;
148 Close C_Sel1;
149 If (p_object_version_number
150 <> per_pat_shd.g_old_rec.object_version_number) Then
151 fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
152 fnd_message.raise_error;
153 End If;
154 l_fct_ret := true;
155 End If;
156 End If;
157 Return (l_fct_ret);
158 --
159 End api_updating;
160 --
161 -- ----------------------------------------------------------------------------
162 -- |---------------------------------< lck >----------------------------------|
163 -- ----------------------------------------------------------------------------
164 Procedure lck
165 (p_allocated_task_id in number
166 ,p_object_version_number in number
167 ) is
168 --
169 -- Cursor selects the 'current' row from the HR Schema
170 --
171 Cursor C_Sel1 is
172 select
173 allocated_task_id
174 ,allocated_checklist_id
175 ,task_name
176 ,description
177 ,performer_orig_system
178 ,performer_orig_sys_id
179 ,task_owner_person_id
180 ,task_sequence
181 ,target_start_date
182 ,target_end_date
183 ,actual_start_date
184 ,actual_end_date
185 ,action_url
186 ,mandatory_flag
187 ,status
188 ,object_version_number
189 ,attribute_category
190 ,attribute1
191 ,attribute2
192 ,attribute3
193 ,attribute4
194 ,attribute5
195 ,attribute6
196 ,attribute7
202 ,attribute13
197 ,attribute8
198 ,attribute9
199 ,attribute10
200 ,attribute11
201 ,attribute12
203 ,attribute14
204 ,attribute15
205 ,attribute16
206 ,attribute17
207 ,attribute18
208 ,attribute19
209 ,attribute20
210 ,information_category
211 ,information1
212 ,information2
213 ,information3
214 ,information4
215 ,information5
216 ,information6
217 ,information7
218 ,information8
219 ,information9
220 ,information10
221 ,information11
222 ,information12
223 ,information13
224 ,information14
225 ,information15
226 ,information16
227 ,information17
228 ,information18
229 ,information19
230 ,information20
231 from per_allocated_tasks
232 where allocated_task_id = p_allocated_task_id
233 for update nowait;
234 --
235 l_proc varchar2(72) := g_package||'lck';
236 --
237 Begin
238 hr_utility.set_location('Entering:'||l_proc, 5);
239 --
240 hr_api.mandatory_arg_error
241 (p_api_name => l_proc
242 ,p_argument => 'ALLOCATED_TASK_ID'
243 ,p_argument_value => p_allocated_task_id
244 );
245 hr_utility.set_location(l_proc,6);
246 hr_api.mandatory_arg_error
247 (p_api_name => l_proc
248 ,p_argument => 'OBJECT_VERSION_NUMBER'
249 ,p_argument_value => p_object_version_number
250 );
251 --
252 Open C_Sel1;
253 Fetch C_Sel1 Into per_pat_shd.g_old_rec;
254 If C_Sel1%notfound then
255 Close C_Sel1;
256 --
257 -- The primary key is invalid therefore we must error
258 --
259 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
260 fnd_message.raise_error;
261 End If;
262 Close C_Sel1;
263 If (p_object_version_number
264 <> per_pat_shd.g_old_rec.object_version_number) Then
265 fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
266 fnd_message.raise_error;
267 End If;
268 --
269 hr_utility.set_location(' Leaving:'||l_proc, 10);
270 --
271 -- We need to trap the ORA LOCK exception
272 --
273 Exception
274 When HR_Api.Object_Locked then
275 --
276 -- The object is locked therefore we need to supply a meaningful
277 -- error message.
278 --
279 fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
280 fnd_message.set_token('TABLE_NAME', 'per_allocated_tasks');
281 fnd_message.raise_error;
282 End lck;
283 --
284 -- ----------------------------------------------------------------------------
285 -- |-----------------------------< convert_args >-----------------------------|
286 -- ----------------------------------------------------------------------------
287 Function convert_args
288 (p_allocated_task_id in number
289 ,p_allocated_checklist_id in number
290 ,p_task_name in varchar2
291 ,p_description in varchar2
292 ,p_performer_orig_system in varchar2
293 ,p_performer_orig_sys_id in number
294 ,p_task_owner_person_id in number
295 ,p_task_sequence in number
296 ,p_target_start_date in date
297 ,p_target_end_date in date
298 ,p_actual_start_date in date
299 ,p_actual_end_date in date
300 ,p_action_url in varchar2
301 ,p_mandatory_flag in varchar2
302 ,p_status in varchar2
303 ,p_object_version_number in number
304 ,p_attribute_category in varchar2
305 ,p_attribute1 in varchar2
306 ,p_attribute2 in varchar2
307 ,p_attribute3 in varchar2
308 ,p_attribute4 in varchar2
309 ,p_attribute5 in varchar2
310 ,p_attribute6 in varchar2
311 ,p_attribute7 in varchar2
312 ,p_attribute8 in varchar2
313 ,p_attribute9 in varchar2
314 ,p_attribute10 in varchar2
315 ,p_attribute11 in varchar2
316 ,p_attribute12 in varchar2
317 ,p_attribute13 in varchar2
318 ,p_attribute14 in varchar2
319 ,p_attribute15 in varchar2
320 ,p_attribute16 in varchar2
321 ,p_attribute17 in varchar2
322 ,p_attribute18 in varchar2
323 ,p_attribute19 in varchar2
324 ,p_attribute20 in varchar2
325 ,p_information_category in varchar2
326 ,p_information1 in varchar2
327 ,p_information2 in varchar2
328 ,p_information3 in varchar2
329 ,p_information4 in varchar2
330 ,p_information5 in varchar2
331 ,p_information6 in varchar2
332 ,p_information7 in varchar2
333 ,p_information8 in varchar2
334 ,p_information9 in varchar2
335 ,p_information10 in varchar2
336 ,p_information11 in varchar2
337 ,p_information12 in varchar2
338 ,p_information13 in varchar2
339 ,p_information14 in varchar2
340 ,p_information15 in varchar2
341 ,p_information16 in varchar2
342 ,p_information17 in varchar2
343 ,p_information18 in varchar2
344 ,p_information19 in varchar2
345 ,p_information20 in varchar2
346 )
347 Return g_rec_type is
348 --
349 l_rec g_rec_type;
350 --
351 Begin
352 --
353 -- Convert arguments into local l_rec structure.
354 --
355 l_rec.allocated_task_id := p_allocated_task_id;
356 l_rec.allocated_checklist_id := p_allocated_checklist_id;
357 l_rec.task_name := p_task_name;
358 l_rec.description := p_description;
359 l_rec.performer_orig_system := p_performer_orig_system;
360 l_rec.performer_orig_sys_id := p_performer_orig_sys_id;
361 l_rec.task_owner_person_id := p_task_owner_person_id;
362 l_rec.task_sequence := p_task_sequence;
363 l_rec.target_start_date := p_target_start_date;
364 l_rec.target_end_date := p_target_end_date;
365 l_rec.actual_start_date := p_actual_start_date;
366 l_rec.actual_end_date := p_actual_end_date;
367 l_rec.action_url := p_action_url;
368 l_rec.mandatory_flag := p_mandatory_flag;
369 l_rec.status := p_status;
370 l_rec.object_version_number := p_object_version_number;
371 l_rec.attribute_category := p_attribute_category;
372 l_rec.attribute1 := p_attribute1;
373 l_rec.attribute2 := p_attribute2;
374 l_rec.attribute3 := p_attribute3;
375 l_rec.attribute4 := p_attribute4;
376 l_rec.attribute5 := p_attribute5;
377 l_rec.attribute6 := p_attribute6;
378 l_rec.attribute7 := p_attribute7;
379 l_rec.attribute8 := p_attribute8;
380 l_rec.attribute9 := p_attribute9;
381 l_rec.attribute10 := p_attribute10;
382 l_rec.attribute11 := p_attribute11;
383 l_rec.attribute12 := p_attribute12;
384 l_rec.attribute13 := p_attribute13;
385 l_rec.attribute14 := p_attribute14;
386 l_rec.attribute15 := p_attribute15;
387 l_rec.attribute16 := p_attribute16;
388 l_rec.attribute17 := p_attribute17;
389 l_rec.attribute18 := p_attribute18;
390 l_rec.attribute19 := p_attribute19;
391 l_rec.attribute20 := p_attribute20;
392 l_rec.information_category := p_information_category;
393 l_rec.information1 := p_information1;
394 l_rec.information2 := p_information2;
395 l_rec.information3 := p_information3;
396 l_rec.information4 := p_information4;
397 l_rec.information5 := p_information5;
398 l_rec.information6 := p_information6;
399 l_rec.information7 := p_information7;
400 l_rec.information8 := p_information8;
401 l_rec.information9 := p_information9;
402 l_rec.information10 := p_information10;
403 l_rec.information11 := p_information11;
404 l_rec.information12 := p_information12;
405 l_rec.information13 := p_information13;
406 l_rec.information14 := p_information14;
407 l_rec.information15 := p_information15;
408 l_rec.information16 := p_information16;
409 l_rec.information17 := p_information17;
410 l_rec.information18 := p_information18;
411 l_rec.information19 := p_information19;
412 l_rec.information20 := p_information20;
413 --
414 -- Return the plsql record structure.
415 --
416 Return(l_rec);
417 --
418 End convert_args;
419 --
420 end per_pat_shd;