DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_RULE_ATTRIBUTES_API

Source


1 Package Body PQH_RULE_ATTRIBUTES_API as
2 /* $Header: pqrlaapi.pkb 115.0 2003/01/26 01:52:15 rpasapul noship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := 'PQH_RULE_ATTRIBUTES_API.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |--------------------------< Insert_Rule_Attribute >------------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure Insert_Rule_Attribute
13   (p_rule_set_id                    in     number
14   ,p_attribute_code                 in     varchar2 default null
15   ,p_operation_code                 in     varchar2 default null
16   ,p_attribute_value                in     varchar2 default null
17   ,p_rule_attribute_id                 out nocopy number
18   ,p_object_version_number             out nocopy number) is
19   --
20   -- Declare cursors and local variables
21   --
22 
23   l_proc  varchar2(72)       := g_package||'Insert_Rule_Attribute';
24   l_object_Version_Number    PQH_RULE_ATTRIBUTES.OBJECT_VERSION_NUMBER%TYPE;
25   L_Effective_Date           Date;
26   l_rule_attribute_id		PQH_RULE_ATTRIBUTES.RULE_ATTRIBUTE_ID%TYPE;
27 
28 
29 begin
30   hr_utility.set_location('Entering:'|| l_proc, 10);
31   --
32   -- Issue a savepoint
33   --
34   savepoint Insert_Rule_Attribute;
35 
36   --
37   -- Call Before Process User Hook
38   --
39   begin
40    PQH_RULE_ATTRIBUTES_BK1.Insert_Rule_Attribute_b
41    (p_rule_set_id                   => p_rule_set_id
42   ,p_attribute_code                 => p_attribute_code
43   ,p_operation_code                 => p_operation_code
44   ,p_attribute_value                => p_attribute_value
45   ,p_rule_attribute_id              => p_rule_attribute_id
46   ,p_object_version_number          => p_object_version_number
47    );
48 
49 
50   exception
51     when hr_api.cannot_find_prog_unit then
52       hr_api.cannot_find_prog_unit_error
53         (p_module_name => 'PQH_RULE_ATTRIBUTES_API.Insert_Rule_Attribute'
54         ,p_hook_type   => 'BP'
55         );
56   end;
57   --
58   -- Validation in addition to Row Handlers
59   --
60   --
61   -- Process Logic
62      pqh_rla_ins.ins
63      (p_rule_set_id                   => p_rule_set_id
64   ,p_attribute_code                 => p_attribute_code
65   ,p_operation_code                 => p_operation_code
66   ,p_attribute_value                => p_attribute_value
67   ,p_rule_attribute_id              => l_rule_attribute_id
68   ,p_object_version_number          => l_object_version_number
69      );
70 
71   --
72   -- Call After Process User Hook
73   --
74   begin
75      PQH_RULE_ATTRIBUTES_BK1.Insert_Rule_Attribute_a
76      (p_rule_set_id                   => p_rule_set_id
77   ,p_attribute_code                 => p_attribute_code
78   ,p_operation_code                 => p_operation_code
79   ,p_attribute_value                => p_attribute_value
80   ,p_rule_attribute_id              => p_rule_attribute_id
81   ,p_object_version_number          => p_object_version_number);
82 
83   exception
84     when hr_api.cannot_find_prog_unit then
85       hr_api.cannot_find_prog_unit_error
86         (p_module_name => 'PQH_RULE_ATTRIBUTES_API.Insert_Rule_Attribute'
87         ,p_hook_type   => 'AP'
88         );
89   end;
90   --
91   -- When in validation only mode raise the Validate_Enabled exception
92   --
93 -- Removed p_validate from the generated code to facilitate
94 -- writing wrappers to selfservice easily.
95 --
96 --  if p_validate then
97 --    raise hr_api.validate_enabled;
98 --  end if;
99   --
100   -- Set all output arguments
101   --
102      p_rule_attribute_id := l_rule_attribute_id;
103      p_object_version_number := l_object_version_number;
104 
105 
106   --
107   hr_utility.set_location(' Leaving:'||l_proc, 70);
108 exception
109   when hr_api.validate_enabled then
110     --
111     -- As the Validate_Enabled exception has been raised
112     -- we must rollback to the savepoint
113     --
114     rollback to Insert_Rule_Attribute;
115     --
116     -- Only set output warning arguments
117     -- (Any key or derived arguments must be set to null
118     -- when validation only mode is being used.)
119     --
120     hr_utility.set_location(' Leaving:'||l_proc, 80);
121 
122   when others then
123     --
124     -- A validation or unexpected error has occured
125     --
126     rollback to Insert_Rule_Attribute;
127     hr_utility.set_location(' Leaving:'||l_proc, 90);
128     raise;
129 end Insert_Rule_Attribute;
130 
131 --
132 -- ----------------------------------------------------------------------------
133 -- |--------------------------< Update_Rule_Attribute >--------------------------|
134 -- ----------------------------------------------------------------------------
135 
136 procedure Update_Rule_Attribute
137   (p_rule_attribute_id            in     number
138   ,p_object_version_number        in out nocopy number
139   ,p_rule_set_id                  in     number    default hr_api.g_number
140   ,p_attribute_code               in     varchar2  default hr_api.g_varchar2
141   ,p_operation_code               in     varchar2  default hr_api.g_varchar2
142   ,p_attribute_value              in     varchar2  default hr_api.g_varchar2
143 ) Is
144 
145   l_proc  varchar2(72)    := g_package||'Update_Rule_Attribute';
146   l_object_Version_Number PQH_RULE_ATTRIBUTES.OBJECT_VERSION_NUMBER%TYPE := P_Object_version_Number;
147 
148 Begin
149   hr_utility.set_location('Entering:'|| l_proc, 10);
150   --
151   -- Issue a savepoint
152   --
153   savepoint Update_Rule_Attribute;
154   --
155   -- Call Before Process User Hook
156   --
157   begin
158 
159    PQH_RULE_ATTRIBUTES_BK2.Update_Rule_Attribute_b
160   (p_rule_attribute_id            => p_rule_attribute_id
161   ,p_object_version_number        => p_object_version_number
162   ,p_rule_set_id                  => p_rule_set_id
163   ,p_attribute_code               => p_attribute_code
164   ,p_operation_code               => p_operation_code
165   ,p_attribute_value              => p_attribute_value
166   );
167 
168  exception
169     when hr_api.cannot_find_prog_unit then
170       hr_api.cannot_find_prog_unit_error
171         (p_module_name => 'Update_Rule_Attribute'
172         ,p_hook_type   => 'BP'
173         );
174   end;
175 
176   pqh_rla_upd.upd
177   (p_rule_attribute_id            => p_rule_attribute_id
178   ,p_object_version_number        => l_object_version_number
179   ,p_rule_set_id                  => p_rule_set_id
180   ,p_attribute_code               => p_attribute_code
181   ,p_operation_code               => p_operation_code
182   ,p_attribute_value              => p_attribute_value
183 );
184 
185 --
186 --
187   -- Call After Process User Hook
188   --
189   begin
190 
191    PQH_RULE_ATTRIBUTES_BK2.Update_Rule_Attribute_a
192   (p_rule_attribute_id            => p_rule_attribute_id
193   ,p_object_version_number        => p_object_version_number
194   ,p_rule_set_id                  => p_rule_set_id
195   ,p_attribute_code               => p_attribute_code
196   ,p_operation_code               => p_operation_code
197   ,p_attribute_value              => p_attribute_value
198 );
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_Rule_Attribute'
204         ,p_hook_type   => 'AP'
205         );
206   end;
207   --
208   -- When in validation only mode raise the Validate_Enabled exception
209   --
210 --  if p_validate then
211 --    raise hr_api.validate_enabled;
212 --  end if;
213   --
214   -- Set all output arguments
215   --
216 
217   p_object_version_number  := l_object_version_number;
218 
219   --
220   hr_utility.set_location(' Leaving:'||l_proc, 70);
221 exception
222   when hr_api.validate_enabled then
223     --
224     -- As the Validate_Enabled exception has been raised
225     -- we must rollback to the savepoint
226     --
227     rollback to Update_Rule_Attribute;
228     --
229     -- Only set output warning arguments
230     -- (Any key or derived arguments must be set to null
231     -- when validation only mode is being used.)
232     --
233     hr_utility.set_location(' Leaving:'||l_proc, 80);
234 
235   when others then
236     --
237     -- A validation or unexpected error has occured
238     --
239     rollback to Update_Rule_Attribute;
240     hr_utility.set_location(' Leaving:'||l_proc, 90);
241     raise;
242 end Update_Rule_Attribute;
243 
244 --
245 -- ----------------------------------------------------------------------------
246 -- |-------------------< delete_Rule_Attribute>------------------------------|
247 -- ----------------------------------------------------------------------------
248 procedure delete_Rule_Attribute
249   (p_rule_attribute_id                    in     number
250   ,p_object_version_number                in     number
251   ) Is   --
252 
253   -- Declare cursors and local variables
254   --
255   l_proc           varchar2(72) := g_package||'delete_Rule_Attribute';
256   --
257 begin
258   hr_utility.set_location('Entering:'|| l_proc, 10);
259   --
260   -- Issue a savepoint
261   --
262   savepoint delete_Rule_Attribute;
263   --
264   -- Call Before Process User Hook
265   --
266   begin
267   PQH_RULE_ATTRIBUTES_BK3.Delete_Rule_Attribute_b
268   (p_rule_attribute_id                    => p_rule_attribute_id
269   ,p_object_version_number                => p_object_version_number
270   );
271   exception
272     when hr_api.cannot_find_prog_unit then
273       hr_api.cannot_find_prog_unit_error
274         (p_module_name => 'delete_Rule_Attribute'
275         ,p_hook_type   => 'BP');
276   end;
277   --
278   -- Process Logic
279   --
280   pqh_rla_del.del
281     (
282 p_rule_attribute_id                    => p_rule_attribute_id
283   ,p_object_version_number                => p_object_version_number
284     );
285   --
286   -- Call After Process User Hook
287   --
288   begin
289 
290    PQH_RULE_ATTRIBUTES_BK3.Delete_Rule_Attribute_a
291   (
292 p_rule_attribute_id                    => p_rule_attribute_id
293   ,p_object_version_number                => p_object_version_number
294   );
295 
296   exception
297     when hr_api.cannot_find_prog_unit then
298       hr_api.cannot_find_prog_unit_error
299         (p_module_name => 'delete_Rule_Attribute'
300         ,p_hook_type   => 'AP');
301   end;
302   --
303   -- When in validation only mode raise the Validate_Enabled exception
304   --
305 --  if p_validate then
306 --    raise hr_api.validate_enabled;
307 --  end if;
308   --
309   -- Set all output arguments
310   --
311   hr_utility.set_location(' Leaving:'||l_proc, 70);
312 exception
313   when hr_api.validate_enabled then
314     --
315     -- As the Validate_Enabled exception has been raised
316     -- we must rollback to the savepoint
317     --
318     rollback to delete_Rule_Attribute;
319     --
320     -- Only set output warning arguments
321     -- (Any key or derived arguments must be set to null
322     -- when validation only mode is being used.)
323     --
324     hr_utility.set_location(' Leaving:'||l_proc, 80);
325   when others then
326     --
327     -- A validation or unexpected error has occured
328     --
329     rollback to delete_Rule_Attribute;
330     hr_utility.set_location(' Leaving:'||l_proc, 90);
331     raise;
332 end delete_Rule_Attribute;
333 
334 end PQH_RULE_ATTRIBUTES_API;