DBA Data[Home] [Help]

PACKAGE BODY: APPS.IRC_ASG_STATUS_SWI

Source


1 Package Body irc_asg_status_swi As
2 /* $Header: iriasswi.pkb 120.0.12010000.2 2009/07/30 03:43:47 vmummidi ship $ */
3 --
4 -- Package variables
5 --
6 g_package  varchar2(33) := 'irc_asg_status_swi.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |-------------------------< create_irc_asg_status >-------------------------|
10 -- ----------------------------------------------------------------------------
11 PROCEDURE create_irc_asg_status
12   (p_validate                     in     number    default hr_api.g_false_num
13   ,p_assignment_id                in     number
14   ,p_assignment_status_type_id    in     number
15   ,p_status_change_date           in     date
16   ,p_status_change_reason         in     varchar2  default null
17   ,p_assignment_status_id         in     number
18   ,p_object_version_number           out nocopy number
19   ,p_return_status                   out nocopy varchar2
20   ,p_status_change_comments       in     varchar2  default null
21   ) is
22   --
23   -- Variables for API Boolean parameters
24   l_validate                      boolean;
25   --
26   -- Variables for IN/OUT parameters
27   --
28   -- Other variables
29   l_assignment_status_id         number;
30   l_proc    varchar2(72) := g_package ||'create_irc_asg_status';
31 Begin
32   hr_utility.set_location(' Entering:' || l_proc,10);
33   --
34   -- Issue a savepoint
35   --
36   savepoint create_irc_asg_status_swi;
37   --
38   -- Initialise Multiple Message Detection
39   --
40   hr_multi_message.enable_message_list;
41   --
42   -- Remember IN OUT parameter IN values
43   --
44   --
45   -- Convert constant values to their corresponding boolean value
46   --
47   l_validate :=
48     hr_api.constant_to_boolean
49       (p_constant_value => p_validate);
50   --
51   -- Register Surrogate ID or user key values
52   --
53   irc_ias_ins.set_base_key_value
54     (p_assignment_status_id => p_assignment_status_id
55     );
56   --
57   -- Call API
58   --
59   irc_asg_status_api.create_irc_asg_status
60     (p_validate                     => l_validate
61     ,p_assignment_id                => p_assignment_id
62     ,p_assignment_status_type_id    => p_assignment_status_type_id
63     ,p_status_change_date           => p_status_change_date
64     ,p_status_change_reason         => p_status_change_reason
65     ,p_assignment_status_id         => l_assignment_status_id
66     ,p_object_version_number        => p_object_version_number
67     ,p_status_change_comments       => p_status_change_comments
68     );
69   --
70   -- Convert API warning boolean parameter values to specific
71   -- messages and add them to Multiple Message List
72   --
73   --
74   -- Convert API non-warning boolean parameter values
75   --
76   --
77   -- Derive the API return status value based on whether
78   -- messages of any type exist in the Multiple Message List.
79   -- Also disable Multiple Message Detection.
80   --
81   p_return_status := hr_multi_message.get_return_status_disable;
82   hr_utility.set_location(' Leaving:' || l_proc,20);
83   --
84 exception
85   when hr_multi_message.error_message_exist then
86     --
87     -- Catch the Multiple Message List exception which
88     -- indicates API processing has been aborted because
89     --  at least one error message exists in the list.
90     --
91     rollback to create_irc_asg_status_swi;
92     --
93     -- Reset IN OUT paramters and set OUT parameters
94     --
95     p_object_version_number        := null;
96     p_return_status := hr_multi_message.get_return_status_disable;
97     hr_utility.set_location(' Leaving:' || l_proc,30);
98   when others then
99     --
100     -- When Multiple Message Detection is enabled catch
101     -- any Application specific or other unexpected
102     -- exceptions.  Adding appropriate details to the
103     -- Multiple Message List.  Otherwise re-raise
104     -- the error.
105     --
106     rollback to create_irc_asg_status_swi;
107     if hr_multi_message.unexpected_error_add(l_proc) then
108        hr_utility.set_location(' Leaving:' || l_proc, 40);
109        raise;
110     end if;
111     --
112     -- Reset IN OUT parameters and set OUT parameters
113     --
114     p_object_version_number        := null;
115     p_return_status := hr_multi_message.get_return_status_disable;
116     hr_utility.set_location(' Leaving: ' || l_proc, 50);
117 end create_irc_asg_status;
118 -- ----------------------------------------------------------------------------
119 -- |-------------------------< delete_irc_asg_status >-------------------------|
120 -- ----------------------------------------------------------------------------
121 PROCEDURE delete_irc_asg_status
122   (p_validate                     in     number    default hr_api.g_false_num
123   ,p_assignment_status_id         in     number
124   ,p_object_version_number        in     number
125   ,p_return_status                   out nocopy varchar2
126   ) is
127   --
128   -- Variables for API Boolean parameters
129   l_validate                      boolean;
130   --
131   -- Variables for IN/OUT parameters
132   --
133   -- Other variables
134   l_proc    varchar2(72) := g_package ||'delete_irc_asg_status';
135 Begin
136   hr_utility.set_location(' Entering:' || l_proc,10);
137   --
138   -- Issue a savepoint
139   --
140   savepoint delete_irc_asg_status_swi;
141   --
142   -- Initialise Multiple Message Detection
143   --
144   hr_multi_message.enable_message_list;
145   --
146   -- Remember IN OUT parameter IN values
147   --
148   --
149   -- Convert constant values to their corresponding boolean value
150   --
151   l_validate :=
152     hr_api.constant_to_boolean
153       (p_constant_value => p_validate);
154   --
155   -- Register Surrogate ID or user key values
156   --
157   --
158   -- Call API
159   --
160   irc_asg_status_api.delete_irc_asg_status
161     (p_validate                     => l_validate
162     ,p_assignment_status_id         => p_assignment_status_id
163     ,p_object_version_number        => p_object_version_number
164     );
165   --
166   -- Convert API warning boolean parameter values to specific
167   -- messages and add them to Multiple Message List
168   --
169   --
170   -- Convert API non-warning boolean parameter values
171   --
172   --
173   -- Derive the API return status value based on whether
174   -- messages of any type exist in the Multiple Message List.
175   -- Also disable Multiple Message Detection.
176   --
177   p_return_status := hr_multi_message.get_return_status_disable;
178   hr_utility.set_location(' Leaving:' || l_proc,20);
179   --
180 exception
181   when hr_multi_message.error_message_exist then
182     --
183     -- Catch the Multiple Message List exception which
184     -- indicates API processing has been aborted because
185     --  at least one error message exists in the list.
186     --
187     rollback to delete_irc_asg_status_swi;
188     --
189     -- Reset IN OUT paramters and set OUT parameters
190     --
191     p_return_status := hr_multi_message.get_return_status_disable;
192     hr_utility.set_location(' Leaving:' || l_proc,30);
193   when others then
194     --
195     -- When Multiple Message Detection is enabled catch
196     -- any Application specific or other unexpected
197     -- exceptions.  Adding appropriate details to the
198     -- Multiple Message List.  Otherwise re-raise
199     -- the error.
200     --
201     rollback to delete_irc_asg_status_swi;
202     if hr_multi_message.unexpected_error_add(l_proc) then
203        hr_utility.set_location(' Leaving:' || l_proc, 40);
204        raise;
205     end if;
206     --
207     -- Reset IN OUT parameters and set OUT parameters
208     --
209     p_return_status := hr_multi_message.get_return_status_disable;
210     hr_utility.set_location(' Leaving: ' || l_proc, 50);
211 end delete_irc_asg_status;
212 -- ----------------------------------------------------------------------------
213 -- |-------------------------< update_irc_asg_status >------------------------|
214 -- ----------------------------------------------------------------------------
215 PROCEDURE update_irc_asg_status
216   (p_validate                     in     number    default hr_api.g_false_num
217   ,p_status_change_reason         in     varchar2  default hr_api.g_varchar2
218   ,p_status_change_date           in     date
219   ,p_assignment_status_id         in     number
220   ,p_object_version_number        in out nocopy number
221   ,p_return_status                   out nocopy varchar2
222   ,p_status_change_comments       in     varchar2  default hr_api.g_varchar2
223   ) is
224   --
225   -- Variables for API Boolean parameters
226   l_validate                      boolean;
227   --
228   -- Variables for IN/OUT parameters
229   l_object_version_number         number;
230   --
231   -- Other variables
232   l_proc    varchar2(72) := g_package ||'update_irc_asg_status';
233 Begin
234   hr_utility.set_location(' Entering:' || l_proc,10);
235   --
236   -- Issue a savepoint
237   --
238   savepoint update_irc_asg_status_swi;
239   --
240   -- Initialise Multiple Message Detection
241   --
242   hr_multi_message.enable_message_list;
243   --
244   -- Remember IN OUT parameter IN values
245   --
246   l_object_version_number         := p_object_version_number;
247   --
248   -- Convert constant values to their corresponding boolean value
249   --
250   l_validate :=
251     hr_api.constant_to_boolean
252       (p_constant_value => p_validate);
253   --
254   -- Register Surrogate ID or user key values
255   --
256   --
257   -- Call API
258   --
259   irc_asg_status_api.update_irc_asg_status
260     (p_validate                     => l_validate
261     ,p_status_change_reason         => p_status_change_reason
262     ,p_status_change_date           => p_status_change_date
263     ,p_assignment_status_id         => p_assignment_status_id
264     ,p_object_version_number        => p_object_version_number
265     ,p_status_change_comments       => p_status_change_comments
266     );
267   --
268   -- Convert API warning boolean parameter values to specific
269   -- messages and add them to Multiple Message List
270   --
271   --
272   -- Convert API non-warning boolean parameter values
273   --
274   --
275   -- Derive the API return status value based on whether
276   -- messages of any type exist in the Multiple Message List.
277   -- Also disable Multiple Message Detection.
278   --
279   p_return_status := hr_multi_message.get_return_status_disable;
280   hr_utility.set_location(' Leaving:' || l_proc,20);
281   --
282 exception
283   when hr_multi_message.error_message_exist then
284     --
285     -- Catch the Multiple Message List exception which
286     -- indicates API processing has been aborted because
287     --  at least one error message exists in the list.
288     --
289     rollback to update_irc_asg_status_swi;
290     --
291     -- Reset IN OUT paramters and set OUT parameters
292     --
293     p_object_version_number        := l_object_version_number;
294     p_return_status := hr_multi_message.get_return_status_disable;
295     hr_utility.set_location(' Leaving:' || l_proc,30);
296   when others then
297     --
298     -- When Multiple Message Detection is enabled catch
299     -- any Application specific or other unexpected
300     -- exceptions.  Adding appropriate details to the
301     -- Multiple Message List.  Otherwise re-raise
302     -- the error.
303     --
304     rollback to update_irc_asg_status_swi;
305     if hr_multi_message.unexpected_error_add(l_proc) then
306        hr_utility.set_location(' Leaving:' || l_proc, 40);
307        raise;
308     end if;
309     --
310     -- Reset IN OUT parameters and set OUT parameters
311     --
312     p_object_version_number        := l_object_version_number;
313     p_return_status := hr_multi_message.get_return_status_disable;
314     hr_utility.set_location(' Leaving: ' || l_proc, 50);
315 end update_irc_asg_status;
316 end irc_asg_status_swi;