DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_DE_VLDJOBFTR_API

Source


1 Package Body PQH_DE_VLDJOBFTR_API as
2 /* $Header: pqftrapi.pkb 115.1 2002/11/27 23:43:34 rpasapul noship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := 'PQH_DE_VLDJOBTR_API.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |--------------------------< Insert_Vldtn_JobFTRS >------------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure Insert_Vldtn_JobFtr
13   (p_validate                      in  boolean  default false
14   ,p_effective_date                in  date
15   ,p_business_group_id             in  number
16   ,P_WRKPLC_VLDTN_OPR_JOB_ID       In  Number
17   ,P_JOB_FEATURE_Code              In  Varchar2
18   ,P_Wrkplc_Vldtn_Opr_job_Type     In  Varchar2
19   ,P_WRKPLC_VLDTN_JOBFTR_ID        out nocopy Number
20   ,p_object_version_number         out nocopy number) is
21   --
22   -- Declare cursors and local variables
23   --
24 
25   l_proc  varchar2(72)       := g_package||'Insert_Vldtn_Jobftr';
26   l_object_Version_Number    PQH_DE_WRKPLC_VLDTN_JOBFTRS.OBJECT_VERSION_NUMBER%TYPE;
27   L_Effective_Date           Date;
28   l_Wrkplc_vldtn_JOBFTR_id   PQH_DE_WRKPLC_VLDTN_JOBFTRS.WRKPLC_VLDTN_JOBFTR_ID%TYPE;
29 
30 begin
31   hr_utility.set_location('Entering:'|| l_proc, 10);
32   --
33   -- Issue a savepoint
34   --
35   savepoint Insert_Vldtn_JobFtr;
36   --
37   -- Truncate the time portion from all IN date parameters
38   --
39      l_effective_date := Trunc(p_effective_Date);
40   --
41   -- Call Before Process User Hook
42   --
43   begin
44    PQH_DE_VLDJOBFTR_BK1.Insert_Vldtn_JobFtr_b
45    (p_effective_date             => L_Effective_Date
46    ,p_business_group_id          => p_Business_Group_Id
47    ,P_WRKPLC_VLDTN_OPR_JOB_ID    => P_Wrkplc_Vldtn_Opr_Job_Id
48    ,P_JOB_FEATURE_CODE           => P_Job_Feature_Code
49    ,P_Wrkplc_Vldtn_Opr_job_Type  => P_Wrkplc_Vldtn_Opr_Job_Type);
50 
51 
52   exception
53     when hr_api.cannot_find_prog_unit then
54       hr_api.cannot_find_prog_unit_error
55         (p_module_name => 'Insert_Vldtn_JobFtr'
56         ,p_hook_type   => 'BP'
57         );
58   end;
59   --
60   -- Validation in addition to Row Handlers
61   --
62   --
63   -- Process Logic
64      pqh_Ftr_ins.ins
65      (P_EFFECTIVE_DATE               => l_Effective_date
66      ,P_WRKPLC_VLDTN_OPR_JOB_ID      => p_Wrkplc_Vldtn_OPR_JOB_Id
67      ,P_JOB_FEATURE_CODE             => P_JOB_FEATURE_CODE
68      ,P_BUSINESS_GROUP_ID            => P_BUSINESS_GROUP_ID
69      ,P_Wrkplc_Vldtn_Opr_job_Type    => P_Wrkplc_Vldtn_Opr_Job_Type
70      ,P_WRKPLC_VLDTN_JOBFTR_ID       => l_WRKPLC_VLDTN_JOBFTR_ID
71      ,P_OBJECT_VERSION_NUMBER        => l_OBJECT_VERSION_NUMBER);
72 
73   --
74   -- Call After Process User Hook
75   --
76   begin
77      PQH_DE_VLDJOBFTR_BK1.Insert_Vldtn_JobFtr_a
78      (p_effective_date               => l_Effective_Date
79      ,p_business_group_id            => p_Business_group_Id
80      ,p_WRKPLC_VLDTN_OPR_JOB_ID      => p_WRKPLC_VLDTN_OPR_JOB_ID
81      ,p_Job_Feature_Code             => p_Job_feature_Code
82      ,P_Wrkplc_Vldtn_Opr_job_Type    => P_Wrkplc_Vldtn_Opr_Job_Type
83      ,P_WRKPLC_VLDTN_JOBFTR_ID       => l_WRKPLC_VLDTN_JOBFTR_ID
84      ,p_object_version_number        => l_object_version_number);
85 
86   exception
87     when hr_api.cannot_find_prog_unit then
88       hr_api.cannot_find_prog_unit_error
89         (p_module_name => 'Insert_Vldtn_Jobftr'
90         ,p_hook_type   => 'AP'
91         );
92   end;
93   --
94   -- When in validation only mode raise the Validate_Enabled exception
95   --
96   if p_validate then
97     raise hr_api.validate_enabled;
98   end if;
99   --
100   -- Set all output arguments
101   --
102   p_wrkplc_vldtn_Jobftr_id := l_Wrkplc_vldtn_Jobftr_id;
103   p_object_version_number  := l_object_version_number;
104 
105   --
106   hr_utility.set_location(' Leaving:'||l_proc, 70);
107 exception
108   when hr_api.validate_enabled then
109     --
110     -- As the Validate_Enabled exception has been raised
111     -- we must rollback to the savepoint
112     --
113     rollback to Insert_Vldtn_jobftr;
114     --
115     -- Only set output warning arguments
116     -- (Any key or derived arguments must be set to null
117     -- when validation only mode is being used.)
118     --
119     p_wrkplc_vldtn_Jobftr_id := null;
120     p_object_version_number  := null;
121     hr_utility.set_location(' Leaving:'||l_proc, 80);
122 
123   when others then
124     p_wrkplc_vldtn_Jobftr_id := null;
125     p_object_version_number  := null;
126     --
127     -- A validation or unexpected error has occured
128     --
129     rollback to Insert_Vldtn_Jobftr;
130     hr_utility.set_location(' Leaving:'||l_proc, 90);
131     raise;
132 end Insert_Vldtn_Jobftr;
133 
134 --
135 -- ----------------------------------------------------------------------------
136 -- |--------------------------< Update_Vldtn_Jobftr >--------------------------|
137 -- ----------------------------------------------------------------------------
138 
139 procedure Update_Vldtn_Jobftr
140   (p_validate                      in  boolean  default false
141   ,p_effective_date                in  date
142   ,p_business_group_id             in  number   Default hr_api.g_Number
143   ,P_WRKPLC_VLDTN_OPR_JOB_ID       In  Number   Default hr_api.g_Number
144   ,p_JOB_FEATURE_CODE              In  Varchar2 Default hr_api.g_Varchar2
145   ,P_Wrkplc_Vldtn_Opr_job_Type     In  Varchar2 Default hr_api.g_Varchar2
146   ,P_WRKPLC_VLDTN_JOBFTR_ID        In  Number
147   ,p_object_version_number         In  out nocopy number) Is
148 
149   l_proc  varchar2(72)    := g_package||'Update_Vldtn_Jobftr';
150   l_object_Version_Number PQH_DE_WRKPLC_VLDTN_Jobftrs.OBJECT_VERSION_NUMBER%TYPE := P_Object_version_Number;
151   L_Effective_Date        Date;
152 
153 Begin
154   hr_utility.set_location('Entering:'|| l_proc, 10);
155   --
156   -- Issue a savepoint
157   --
158   savepoint Update_Vldtn_JObFtr;
159   --
160   -- Truncate the time portion from all IN date parameters
161   --
162      l_effective_date := Trunc(p_effective_Date);
163   --
164   -- Call Before Process User Hook
165   --
166   begin
167 
168    PQH_DE_VLDJOBftr_BK2.Update_Vldtn_Jobftr_b
169   (p_effective_date                => l_Effective_Date
170   ,p_business_group_id             => p_business_group_id
171   ,p_WRKPLC_VLDTN_OPR_JOB_ID       => p_Wrkplc_Vldtn_OPR_JOB_Id
172   ,P_Job_Feature_Code              => P_Job_Feature_Code
173   ,P_Wrkplc_Vldtn_Opr_job_Type     => P_Wrkplc_Vldtn_Opr_Job_Type
174   ,P_WRKPLC_VLDTN_JOBFTR_ID        => P_WRKPLC_VLDTN_JOBFTR_ID
175   ,p_object_version_number         => l_object_version_number);
176 
177  exception
178     when hr_api.cannot_find_prog_unit then
179       hr_api.cannot_find_prog_unit_error
180         (p_module_name => 'Update_Vldtn_Jobftr'
181         ,p_hook_type   => 'BP'
182         );
183   end;
184 
185   pqh_ftr_upd.upd
186   (P_EFFECTIVE_DATE       	  => l_Effective_Date
187   ,P_WRKPLC_VLDTN_JOBFTR_ID       => P_WRKPLC_VLDTN_JOBFTR_ID
188   ,P_OBJECT_VERSION_NUMBER        => l_OBJECT_VERSION_NUMBER
189   ,P_WRKPLC_VLDTN_OPR_JOB_ID      => P_WRKPLC_VLDTN_OPR_JOB_ID
190   ,P_JOB_FEATURE_CODE             => P_JOB_FEATURE_CODE
191   ,P_BUSINESS_GROUP_ID            => P_BUSINESS_GROUP_ID
192   ,P_Wrkplc_Vldtn_Opr_job_Type    => P_Wrkplc_Vldtn_Opr_Job_Type);
193 
194 --
195 --
196   -- Call After Process User Hook
197   --
198   begin
199 
200    PQH_DE_VLDJOBFTR_BK2.Update_Vldtn_JOBFTR_a
201   (p_effective_date                => l_Effective_Date
202   ,p_business_group_id             => p_business_group_id
203   ,p_WRKPLC_VLDTN_OPR_JOB_ID       => p_Wrkplc_Vldtn_OPR_JOB_Id
204   ,P_JOB_FEATURE_CODE              => P_JOB_FEATURE_CODE
205   ,P_Wrkplc_Vldtn_Opr_job_Type     => P_Wrkplc_Vldtn_Opr_Job_Type
206   ,P_WRKPLC_VLDTN_JOBFTR_ID        => P_WRKPLC_VLDTN_JOBFTR_ID
207   ,p_object_version_number         => l_object_version_number);
208 
209   exception
210     when hr_api.cannot_find_prog_unit then
211       hr_api.cannot_find_prog_unit_error
212         (p_module_name => 'Update_Vldtn_Jobftr'
213         ,p_hook_type   => 'AP'
214         );
215   end;
216   --
217   -- When in validation only mode raise the Validate_Enabled exception
218   --
219   if p_validate then
220     raise hr_api.validate_enabled;
221   end if;
222   --
223   -- Set all output arguments
224   --
225 
226   p_object_version_number  := l_object_version_number;
227 
228   --
229   hr_utility.set_location(' Leaving:'||l_proc, 70);
230 exception
231   when hr_api.validate_enabled then
232     --
233     -- As the Validate_Enabled exception has been raised
234     -- we must rollback to the savepoint
235     --
236     rollback to Update_Vldtn_Jobftr;
237     --
238     -- Only set output warning arguments
239     -- (Any key or derived arguments must be set to null
240     -- when validation only mode is being used.)
241     --
242     hr_utility.set_location(' Leaving:'||l_proc, 80);
243 
244   when others then
245 p_object_version_number :=   l_object_version_number;
246     --
247     -- A validation or unexpected error has occured
248     --
249     rollback to Update_Vldtn_Jobftr;
250     hr_utility.set_location(' Leaving:'||l_proc, 90);
251     raise;
252 end Update_Vldtn_Jobftr;
253 
254 --
255 -- ----------------------------------------------------------------------------
256 -- |-------------------< delete_Vldtn_Jobftr>------------------------------|
257 -- ----------------------------------------------------------------------------
258 procedure delete_Vldtn_Jobftr
259   (p_validate                      in     boolean  default false
260   ,p_WRKPLC_VLDTN_JOBFTR_ID        In     Number
261   ,p_object_version_number         In     number) Is   --
262 
263   -- Declare cursors and local variables
264   --
265   l_proc           varchar2(72) := g_package||'delete_Vldtn_Jobftr';
266   --
267 begin
268   hr_utility.set_location('Entering:'|| l_proc, 10);
269   --
270   -- Issue a savepoint
271   --
272   savepoint delete_Vldtn_Jobftr;
273   --
274   -- Call Before Process User Hook
275   --
276   begin
277   PQH_DE_VLDJOBFTR_BK3.Delete_Vldtn_JobFTR_b
278   (p_WRKPLC_VLDTN_JOBFTR_ID        =>   p_WRKPLC_VLDTN_JOBFTR_ID
279   ,p_object_version_number         =>   p_object_version_number);
280   exception
281     when hr_api.cannot_find_prog_unit then
282       hr_api.cannot_find_prog_unit_error
283         (p_module_name => 'delete_Vldtn_Jobftr'
284         ,p_hook_type   => 'BP');
285   end;
286   --
287   -- Process Logic
288   --
289   pqh_ftr_del.del
290     (p_WRKPLC_VLDTN_JOBFTR_ID       =>  p_WRKPLC_VLDTN_JOBFTR_ID
291     ,p_object_version_number        =>  p_object_version_number);
292   --
293   -- Call After Process User Hook
294   --
295   begin
296 
297    PQH_DE_VLDJOBFTR_BK3.Delete_Vldtn_Jobftr_a
298   (p_WRKPLC_VLDTN_JOBFTR_ID         => p_WRKPLC_VLDTN_JOBFTR_ID
299   ,p_object_version_number          => p_object_version_number);
300 
301   exception
302     when hr_api.cannot_find_prog_unit then
303       hr_api.cannot_find_prog_unit_error
304         (p_module_name => 'delete_Vldtn_Jobftr'
305         ,p_hook_type   => 'AP');
306   end;
307   --
308   -- When in validation only mode raise the Validate_Enabled exception
309   --
310   if p_validate then
311     raise hr_api.validate_enabled;
312   end if;
313   --
314   -- Set all output arguments
315   --
316   hr_utility.set_location(' Leaving:'||l_proc, 70);
317 exception
318   when hr_api.validate_enabled then
319     --
320     -- As the Validate_Enabled exception has been raised
321     -- we must rollback to the savepoint
322     --
323     rollback to delete_Vldtn_Jobftr;
324     --
325     -- Only set output warning arguments
326     -- (Any key or derived arguments must be set to null
327     -- when validation only mode is being used.)
328     --
329     hr_utility.set_location(' Leaving:'||l_proc, 80);
330   when others then
331     --
332     -- A validation or unexpected error has occured
333     --
334     rollback to delete_Vldtn_Jobftr;
335     hr_utility.set_location(' Leaving:'||l_proc, 90);
336     raise;
337 end delete_Vldtn_Jobftr;
338 
339 end PQH_DE_VLDJOBftr_API;