DBA Data[Home] [Help]

PACKAGE BODY: APPS.IRC_REC_TEAM_MEMBERS_API

Source


1 Package Body IRC_REC_TEAM_MEMBERS_API as
2 /* $Header: irrtmapi.pkb 120.3 2008/01/22 10:16:41 mkjayara noship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := '  IRC_REC_TEAM_MEMBERS_API.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |--------------------------< CREATE_REC_TEAM_MEMBER >----------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_rec_team_member
13   (p_validate                      in     boolean  default false
14   ,p_person_id                     in     number
15   ,p_vacancy_id                    in     number
16   ,p_job_id                        in     number   default null
17   ,p_start_date                    in     date     default null
18   ,p_end_date                      in     date     default null
19   ,p_update_allowed                in     varchar2 default 'Y'
20   ,p_delete_allowed                in     varchar2 default 'Y'
21   ,p_rec_team_member_id            out nocopy    number
22   ,p_object_version_number         out nocopy    number
23   ,p_interview_security             in      varchar2 default 'SELF'
24   ) is
25   --
26   -- Declare cursors and local variables
27   --
28   --
29   l_proc                    varchar2(72) := g_package||'create_rec_team_member';
30   l_object_version_number   number;
31   l_start_date              date;
32   l_end_date                date;
33   l_rec_team_member_id      number;
34   --
35 begin
36   hr_utility.set_location('Entering:'|| l_proc, 10);
37   --
38   -- Issue a savepoint
39   --
40   savepoint create_rec_team_member;
41   --
42   -- Truncate the time portion from all IN date parameters
43   --
44   l_start_date := trunc(p_start_date);
45   l_end_date   := trunc(p_end_date);
46   --
47   -- Call Before Process User Hook
48   --
49   begin
50     IRC_REC_TEAM_MEMBERS_BK1.CREATE_REC_TEAM_MEMBER_B
51     (p_rec_team_member_id  =>   p_rec_team_member_id
52     ,p_person_id           =>   p_person_id
53     ,p_vacancy_id          =>   p_vacancy_id
54     ,p_job_id              =>   p_job_id
55     ,p_start_date          =>   l_start_date
56     ,p_end_date            =>   l_end_date
57     ,p_update_allowed      =>   p_update_allowed
58     ,p_delete_allowed      =>   p_delete_allowed
59     ,p_interview_security   =>   p_interview_security
60     );
61   exception
62     when hr_api.cannot_find_prog_unit then
63       hr_api.cannot_find_prog_unit_error
64         (p_module_name => 'CREATE_REC_TEAM_MEMBER'
65         ,p_hook_type   => 'BP'
66         );
67   end;
68   --
69   -- Process Logic
70   --
71   irc_rtm_ins.ins
72   (p_job_id                         => p_job_id
73   ,p_update_allowed                 => p_update_allowed
74   ,p_delete_allowed                 => p_delete_allowed
75   ,p_start_date                     => l_start_date
76   ,p_end_date                       => l_end_date
77   ,p_person_id                      => p_person_id
78   ,p_vacancy_id                     => p_vacancy_id
79   ,p_rec_team_member_id             => l_rec_team_member_id
80   ,p_object_version_number          => l_object_version_number
81   ,p_interview_security              => p_interview_security
82   );
83   --
84   -- Call After Process User Hook
85   --
86   begin
87     IRC_REC_TEAM_MEMBERS_BK1.CREATE_REC_TEAM_MEMBER_A
88     (p_rec_team_member_id           => l_rec_team_member_id
89     ,p_person_id                    => p_person_id
90     ,p_vacancy_id                   => p_vacancy_id
91     ,p_job_id                       => p_job_id
92     ,p_start_date                   => l_start_date
93     ,p_end_date                     => l_end_date
94     ,p_update_allowed               => p_update_allowed
95     ,p_delete_allowed               => p_delete_allowed
96     ,p_object_version_number        => l_object_version_number
97     ,p_interview_security            => p_interview_security
98     );
99   exception
100     when hr_api.cannot_find_prog_unit then
101       hr_api.cannot_find_prog_unit_error
102         (p_module_name => 'CREATE_REC_TEAM_MEMBER'
103         ,p_hook_type   => 'AP'
104         );
105   end;
106   --
107   -- When in validation only mode raise the Validate_Enabled exception
108   --
109   if p_validate then
110     raise hr_api.validate_enabled;
111   end if;
112   --
113   -- Set all output arguments
114   --
115   p_object_version_number  := l_object_version_number;
116   p_rec_team_member_id     := l_rec_team_member_id;
117   --
118   hr_utility.set_location(' Leaving:'||l_proc, 70);
119 exception
120   when hr_api.validate_enabled then
121     --
122     -- As the Validate_Enabled exception has been raised
123     -- we must rollback to the savepoint
124     --
125     rollback to CREATE_REC_TEAM_MEMBER;
126     --
127     -- Only set output warning arguments
128     -- (Any key or derived arguments must be set to null
129     -- when validation only mode is being used.)
130     --
131     p_object_version_number  := null;
132     p_rec_team_member_id := null;
133     hr_utility.set_location(' Leaving:'||l_proc, 80);
134   when others then
135     --
136     -- A validation or unexpected error has occured
137     --
138     rollback to CREATE_REC_TEAM_MEMBER;
139     --
140     -- Reset IN OUT parameters and set OUT parameters
141     --
142     p_object_version_number  := null;
143     p_rec_team_member_id := null;
144     hr_utility.set_location(' Leaving:'||l_proc, 90);
145     raise;
146 end CREATE_REC_TEAM_MEMBER;
147 --
148 -- ----------------------------------------------------------------------------
149 -- |--------------------------< UPDATE_REC_TEAM_MEMBER >----------------------|
150 -- ----------------------------------------------------------------------------
151 --
152 procedure update_rec_team_member
153   (p_validate                      in     boolean  default false
154   ,p_rec_team_member_id            in     number
155   ,p_person_id                     in     number   default hr_api.g_number
156   ,p_vacancy_id                    in     number   default hr_api.g_number
157   ,p_party_id                      in     number   default hr_api.g_number
158   ,p_object_version_number         in out nocopy number
159   ,p_job_id                        in     number   default hr_api.g_number
160   ,p_start_date                    in     date     default hr_api.g_date
161   ,p_end_date                      in     date     default hr_api.g_date
162   ,p_update_allowed                in     varchar2 default hr_api.g_varchar2
163   ,p_delete_allowed                in     varchar2 default hr_api.g_varchar2
164   ,p_interview_security             in     varchar2 default 'SELF'
165   ) is
166 --
167   --
168   -- Declare cursors and local variables
169   --
170   l_proc                   varchar2(72) := g_package||'update_rec_team_member';
171   l_object_version_number  number := p_object_version_number;
172   l_start_date             date;
173   l_end_date               date;
174 begin
175   hr_utility.set_location('Entering:'|| l_proc, 10);
176   --
177   -- Issue a savepoint
178   --
179   savepoint update_rec_team_member;
180   --
181   -- Truncate the time portion from all IN date parameters
182   --
183   l_start_date := trunc(p_start_date);
184   l_end_date   := trunc(p_end_date);
185   --
186   -- Call Before Process User Hook
187   --
188   begin
189     IRC_REC_TEAM_MEMBERS_BK2.UPDATE_REC_TEAM_MEMBER_B
190     (p_rec_team_member_id    =>   p_rec_team_member_id
191     ,p_person_id             =>   p_person_id
192     ,p_object_version_number =>   l_object_version_number
193     ,p_job_id                =>   p_job_id
194     ,p_start_date            =>   l_start_date
195     ,p_end_date              =>   l_end_date
196     ,p_update_allowed        =>   p_update_allowed
197     ,p_delete_allowed        =>   p_delete_allowed
198     ,p_interview_security     =>   p_interview_security
199     );
200   exception
201     when hr_api.cannot_find_prog_unit then
202       hr_api.cannot_find_prog_unit_error
203         (p_module_name => 'UPDATE_REC_TEAM_MEMBER'
204         ,p_hook_type   => 'BP'
205         );
206   end;
207   --
208   -- Process Logic
209   --
210   irc_rtm_upd.upd
211   (p_rec_team_member_id      => p_rec_team_member_id
212   ,p_person_id               => p_person_id
213   ,p_party_id                => p_party_id
214   ,p_vacancy_id              => p_vacancy_id
215   ,p_object_version_number   => l_object_version_number
216   ,p_job_id                  => p_job_id
217   ,p_update_allowed          => p_update_allowed
218   ,p_delete_allowed          => p_delete_allowed
219   ,p_start_date              => l_start_date
220   ,p_end_date                => l_end_date
221   ,p_interview_security       => p_interview_security
222   );
223   --
224   -- Call After Process User Hook
225   --
226   begin
227     IRC_REC_TEAM_MEMBERS_BK2.UPDATE_REC_TEAM_MEMBER_A
228     (p_rec_team_member_id     => p_rec_team_member_id
229     ,p_person_id              => p_person_id
230     ,p_object_version_number  => l_object_version_number
231     ,p_job_id                 => p_job_id
232     ,p_start_date             => l_start_date
233     ,p_end_date               => l_end_date
234     ,p_update_allowed         => p_update_allowed
235     ,p_delete_allowed         => p_delete_allowed
236     ,p_interview_security      => p_interview_security
237     );
238   exception
239     when hr_api.cannot_find_prog_unit then
240       hr_api.cannot_find_prog_unit_error
241         (p_module_name => 'UPDATE_REC_TEAM_MEMBER'
242         ,p_hook_type   => 'AP'
243         );
244   end;
245   --
246   -- When in validation only mode raise the Validate_Enabled exception
247   --
248   if p_validate then
249     raise hr_api.validate_enabled;
250   end if;
251   --
252   -- Set all output arguments
253   --
254   p_object_version_number := l_object_version_number;
255   --
256   hr_utility.set_location(' Leaving:'||l_proc, 70);
257 exception
258   when hr_api.validate_enabled then
259     --
260     -- As the Validate_Enabled exception has been raised
261     -- we must rollback to the savepoint
262     --
263     rollback to UPDATE_REC_TEAM_MEMBER;
264     --
265     -- Only set output warning arguments
266     -- (Any key or derived arguments must be set to null
267     -- when validation only mode is being used.)
268     --
269     --
270     -- Reset IN OUT parameters and set OUT parameters
271     --
272     p_object_version_number := l_object_version_number;
273     hr_utility.set_location(' Leaving:'||l_proc, 80);
274   when others then
275     --
276     -- A validation or unexpected error has occured
277     --
278     rollback to UPDATE_REC_TEAM_MEMBER;
279     --
280     -- Reset IN OUT parameters and set OUT parameters
281     --
282     p_object_version_number := l_object_version_number;
283     hr_utility.set_location(' Leaving:'||l_proc, 90);
284     raise;
285 end UPDATE_REC_TEAM_MEMBER;
286 --
287 -- ----------------------------------------------------------------------------
288 -- |--------------------------< DELETE_REC_TEAM_MEMBER >----------------------|
289 -- ----------------------------------------------------------------------------
290 --
291 procedure delete_rec_team_member
292   (p_validate                      in     boolean  default false
293   ,p_rec_team_member_id             in     number
294   ,p_object_version_number         in     number
295   ) is
296   --
297   -- Declare cursors and local variables
298   --
299   l_proc                varchar2(72) := g_package||'delete_rec_team_member';
300 begin
301   hr_utility.set_location('Entering:'|| l_proc, 10);
302   --
303   -- Issue a savepoint
304   --
305   savepoint delete_rec_team_member;
306   --
307   -- Call Before Process User Hook
308   --
309   begin
310     IRC_REC_TEAM_MEMBERS_BK3.DELETE_REC_TEAM_MEMBER_B
311     (p_rec_team_member_id    => p_rec_team_member_id
312     ,p_object_version_number => p_object_version_number
313     );
314   exception
315     when hr_api.cannot_find_prog_unit then
316       hr_api.cannot_find_prog_unit_error
317         (p_module_name => 'DELETE_REC_TEAM_MEMBER'
318         ,p_hook_type   => 'BP'
319         );
320   end;
321   --
322   -- Process Logic
323   --
324   irc_rtm_del.del
325   (p_rec_team_member_id    =>     p_rec_team_member_id
326   ,p_object_version_number =>     p_object_version_number
327   );
328   --
329   -- Call After Process User Hook
330   --
331   begin
332      IRC_REC_TEAM_MEMBERS_BK3.DELETE_REC_TEAM_MEMBER_A
333     (p_rec_team_member_id      => p_rec_team_member_id
334     ,p_object_version_number   => p_object_version_number
335     );
336   exception
337     when hr_api.cannot_find_prog_unit then
338       hr_api.cannot_find_prog_unit_error
339         (p_module_name => 'DELETE_REC_TEAM_MEMBER'
340         ,p_hook_type   => 'AP'
341         );
342   end;
343   --
344   -- When in validation only mode raise the Validate_Enabled exception
345   --
346   if p_validate then
347     raise hr_api.validate_enabled;
348   end if;
349   --
350   -- Set all output arguments
351   --
352   --
353   hr_utility.set_location(' Leaving:'||l_proc, 70);
354 exception
355   when hr_api.validate_enabled then
356     --
357     -- As the Validate_Enabled exception has been raised
358     -- we must rollback to the savepoint
359     --
360     rollback to DELETE_REC_TEAM_MEMBER;
361     --
362     -- Only set output warning arguments
363     -- (Any key or derived arguments must be set to null
364     -- when validation only mode is being used.)
365     --
366     hr_utility.set_location(' Leaving:'||l_proc, 80);
367   when others then
368     --
369     -- A validation or unexpected error has occured
370     --
371     rollback to DELETE_REC_TEAM_MEMBER;
372     hr_utility.set_location(' Leaving:'||l_proc, 90);
373     raise;
374 end DELETE_REC_TEAM_MEMBER;
375 --
376 end IRC_REC_TEAM_MEMBERS_API;