DBA Data[Home] [Help]

PACKAGE BODY: APPS.IRC_ASSIGNMENT_DETAILS_SWI

Source


1 Package Body irc_assignment_details_swi As
2 /* $Header: iriadswi.pkb 120.0.12000000.2 2007/03/23 08:12:32 vboggava noship $ */
3 --
4 -- Package variables
5 --
6 g_package  varchar2(33) := 'irc_assignment_details_swi.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |-----------------------< create_assignment_details >----------------------|
10 -- ----------------------------------------------------------------------------
11 PROCEDURE create_assignment_details
12   (p_validate                     in     number    default hr_api.g_false_num
13   ,p_effective_date               in     date
14   ,p_assignment_id                in     number
15   ,p_attempt_id                   in     number    default null
16   ,p_assignment_details_id        in     number
17   ,p_qualified                    in     varchar2  default null
18   ,p_considered                   in     varchar2  default null
19   ,p_details_version                 out nocopy number
20   ,p_effective_start_date            out nocopy date
21   ,p_effective_end_date              out nocopy date
22   ,p_object_version_number           out nocopy number
23   ,p_return_status                   out nocopy varchar2
24   ) is
25   --
26   -- Variables for API Boolean parameters
27   l_validate                      boolean;
28   --
29   -- Variables for IN/OUT parameters
30   --
31   -- Other variables
32   l_assignment_details_id        number;
33   l_proc    varchar2(72) := g_package ||'create_assignment_details';
34 Begin
35   hr_utility.set_location(' Entering:' || l_proc,10);
36   --
37   -- Issue a savepoint
38   --
39   savepoint create_assignment_details_swi;
40   --
41   -- Initialise Multiple Message Detection
42   --
43   hr_multi_message.enable_message_list;
44   --
45   -- Remember IN OUT parameter IN values
46   --
47   --
48   -- Convert constant values to their corresponding boolean value
49   --
50   l_validate :=
51     hr_api.constant_to_boolean
52       (p_constant_value => p_validate);
53   --
54   -- Register Surrogate ID or user key values
55   --
56   irc_iad_ins.set_base_key_value
57     (p_assignment_details_id => p_assignment_details_id
58     );
59   --
60   -- Call API
61   --
62   irc_assignment_details_api.create_assignment_details
63     (p_validate                     => l_validate
64     ,p_effective_date               => p_effective_date
65     ,p_assignment_id                => p_assignment_id
66     ,p_attempt_id                   => p_attempt_id
67     ,p_assignment_details_id        => l_assignment_details_id
68     ,p_qualified                    => p_qualified
69     ,p_considered                   => p_considered
70     ,p_details_version              => p_details_version
71     ,p_effective_start_date         => p_effective_start_date
72     ,p_effective_end_date           => p_effective_end_date
73     ,p_object_version_number        => p_object_version_number
74     );
75   --
76   -- Convert API warning boolean parameter values to specific
77   -- messages and add them to Multiple Message List
78   --
79   --
80   -- Convert API non-warning boolean parameter values
81   --
82   --
83   -- Derive the API return status value based on whether
84   -- messages of any type exist in the Multiple Message List.
85   -- Also disable Multiple Message Detection.
86   --
87   p_return_status := hr_multi_message.get_return_status_disable;
88   hr_utility.set_location(' Leaving:' || l_proc,20);
89   --
90 exception
91   when hr_multi_message.error_message_exist then
92     --
93     -- Catch the Multiple Message List exception which
94     -- indicates API processing has been aborted because
95     -- at least one message exists in the list.
96     --
97     rollback to create_assignment_details_swi;
98     --
99     -- Reset IN OUT parameters and set OUT parameters
100     --
101     p_details_version              := null;
102     p_effective_start_date         := null;
103     p_effective_end_date           := null;
104     p_object_version_number        := null;
105     p_return_status := hr_multi_message.get_return_status_disable;
106     hr_utility.set_location(' Leaving:' || l_proc, 30);
107   when others then
108     --
109     -- When Multiple Message Detection is enabled catch
110     -- any Application specific or other unexpected
111     -- exceptions.  Adding appropriate details to the
112     -- Multiple Message List.  Otherwise re-raise the
113     -- error.
114     --
115     rollback to create_assignment_details_swi;
116     if hr_multi_message.unexpected_error_add(l_proc) then
117        hr_utility.set_location(' Leaving:' || l_proc,40);
118        raise;
119     end if;
120     --
121     -- Reset IN OUT and set OUT parameters
122     --
123     p_details_version              := null;
124     p_effective_start_date         := null;
125     p_effective_end_date           := null;
126     p_object_version_number        := null;
127     p_return_status := hr_multi_message.get_return_status_disable;
128     hr_utility.set_location(' Leaving:' || l_proc,50);
129 end create_assignment_details;
130 -- ----------------------------------------------------------------------------
131 -- |-----------------------< update_assignment_details >----------------------|
132 -- ----------------------------------------------------------------------------
133 PROCEDURE update_assignment_details
134   (p_validate                     in     number    default hr_api.g_false_num
135   ,p_effective_date               in     date
136   ,p_datetrack_update_mode        in     varchar2
137   ,p_assignment_id                in     number    default hr_api.g_number
138   ,p_attempt_id                   in     number    default hr_api.g_number
139   ,p_qualified                    in     varchar2  default null
140   ,p_considered                   in     varchar2  default null
141   ,p_assignment_details_id        in out nocopy number
142   ,p_object_version_number        in out nocopy number
143   ,p_details_version                 out nocopy number
144   ,p_effective_start_date            out nocopy date
145   ,p_effective_end_date              out nocopy date
146   ,p_return_status                   out nocopy varchar2
147   ) is
148   --
149   -- Variables for API Boolean parameters
150   l_validate                      boolean;
151   --
152   -- Variables for IN/OUT parameters
153   l_assignment_details_id         number;
154   l_object_version_number         number;
155   --
156   -- Other variables
157   l_proc    varchar2(72) := g_package ||'update_assignment_details';
158 Begin
159   hr_utility.set_location(' Entering:' || l_proc,10);
160   --
161   -- Issue a savepoint
162   --
163   savepoint update_assignment_details_swi;
164   --
165   -- Initialise Multiple Message Detection
166   --
167   hr_multi_message.enable_message_list;
168   --
169   -- Remember IN OUT parameter IN values
170   --
171   l_assignment_details_id         := p_assignment_details_id;
172   l_object_version_number         := p_object_version_number;
173   --
174   -- Convert constant values to their corresponding boolean value
175   --
176   l_validate :=
177     hr_api.constant_to_boolean
178       (p_constant_value => p_validate);
179   --
180   -- Register Surrogate ID or user key values
181   --
182   --
183   -- Call API
184   --
185   irc_assignment_details_api.update_assignment_details
186     (p_validate                     => l_validate
187     ,p_effective_date               => p_effective_date
188     ,p_datetrack_update_mode        => p_datetrack_update_mode
189     ,p_assignment_id                => p_assignment_id
190     ,p_attempt_id                   => p_attempt_id
191     ,p_qualified                    => p_qualified
192     ,p_considered                   => p_considered
193     ,p_assignment_details_id        => p_assignment_details_id
194     ,p_object_version_number        => p_object_version_number
195     ,p_details_version              => p_details_version
196     ,p_effective_start_date         => p_effective_start_date
197     ,p_effective_end_date           => p_effective_end_date
198     );
199   --
200   -- Convert API warning boolean parameter values to specific
201   -- messages and add them to Multiple Message List
202   --
203   --
204   -- Convert API non-warning boolean parameter values
205   --
206   --
207   -- Derive the API return status value based on whether
208   -- messages of any type exist in the Multiple Message List.
209   -- Also disable Multiple Message Detection.
210   --
211   p_return_status := hr_multi_message.get_return_status_disable;
212   hr_utility.set_location(' Leaving:' || l_proc,20);
213   --
214 exception
215   when hr_multi_message.error_message_exist then
216     --
217     -- Catch the Multiple Message List exception which
218     -- indicates API processing has been aborted because
219     -- at least one message exists in the list.
220     --
221     rollback to update_assignment_details_swi;
222     --
223     -- Reset IN OUT parameters and set OUT parameters
224     --
225     p_assignment_details_id        := l_assignment_details_id;
226     p_object_version_number        := l_object_version_number;
227     p_details_version              := null;
228     p_effective_start_date         := null;
229     p_effective_end_date           := null;
230     p_return_status := hr_multi_message.get_return_status_disable;
231     hr_utility.set_location(' Leaving:' || l_proc, 30);
232   when others then
233     --
234     -- When Multiple Message Detection is enabled catch
235     -- any Application specific or other unexpected
236     -- exceptions.  Adding appropriate details to the
237     -- Multiple Message List.  Otherwise re-raise the
238     -- error.
239     --
240     rollback to update_assignment_details_swi;
241     if hr_multi_message.unexpected_error_add(l_proc) then
242        hr_utility.set_location(' Leaving:' || l_proc,40);
243        raise;
244     end if;
245     --
246     -- Reset IN OUT and set OUT parameters
247     --
248     p_assignment_details_id        := l_assignment_details_id;
249     p_object_version_number        := l_object_version_number;
250     p_details_version              := null;
251     p_effective_start_date         := null;
252     p_effective_end_date           := null;
253     p_return_status := hr_multi_message.get_return_status_disable;
254     hr_utility.set_location(' Leaving:' || l_proc,50);
255 end update_assignment_details;
256 end irc_assignment_details_swi;