DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_FDL_SHD

Source


1 Package Body per_fdl_shd as
2 /* $Header: pefdlrhi.pkb 120.0.12020000.1 2013/02/27 12:35:26 shpatro noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  per_fdl_shd.';  -- Global package name
9 
10 --
11 -- ----------------------------------------------------------------------------
12 -- |------------------------< return_api_dml_status >-------------------------|
13 -- ----------------------------------------------------------------------------
14 Function return_api_dml_status Return Boolean Is
15 --
16 Begin
17   --
18   Return (nvl(g_api_dml, false));
19   --
20 End return_api_dml_status;
21 
22 --
23 -- ----------------------------------------------------------------------------
24 -- |---------------------------< constraint_error >---------------------------|
25 -- ----------------------------------------------------------------------------
26 Procedure constraint_error
27   (p_constraint_name in all_constraints.constraint_name%TYPE
28   ) Is
29 --
30   l_proc        varchar2(72) := g_package||'constraint_error';
31 --
32 Begin
33   --
34   If (p_constraint_name = 'PER_FND_DOC_LINKS_PK') Then
35     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
36     fnd_message.set_token('PROCEDURE', l_proc);
37     fnd_message.set_token('STEP','5');
38     fnd_message.raise_error;
39 
40   Else
41     fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
42     fnd_message.set_token('PROCEDURE', l_proc);
43     fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
44     fnd_message.raise_error;
45   End If;
46   --
47 End constraint_error;
48 
49 --
50 -- ----------------------------------------------------------------------------
51 -- |-----------------------------< api_updating >-----------------------------|
52 -- ----------------------------------------------------------------------------
53 Function api_updating
54   (p_fnd_doc_link_id                      in     number
55   ,p_object_version_number                in     number
56   )
57   Return Boolean Is
58   --
59   --
60   -- Cursor selects the 'current' row from the HR Schema
61   --
62   Cursor C_Sel1 is
63     select
64        fnd_doc_link_id
65       ,entity_name
66       ,sub_entity_name
67       ,entity_doc_id
68       ,fnd_doc_id
69       ,person_id
70       ,assignment_id
71       ,application_id
72       ,doc_upload_date
73       ,transaction_type
74       ,transaction_status
75       ,status
76       ,fdl_information_category
77       ,fdl_information1
78       ,fdl_information2
79       ,fdl_information3
80       ,fdl_information4
81       ,fdl_information5
82       ,fdl_information6
83       ,fdl_information7
84       ,fdl_information8
85       ,fdl_information9
86       ,fdl_information10
87       ,object_version_number
88     from        per_fnd_doc_links
89     where       fnd_doc_link_id = p_fnd_doc_link_id;
90   --
91   l_fct_ret     boolean;
92   --
93 Begin
94   --
95   If (p_fnd_doc_link_id is null and
96       p_object_version_number is null
97      ) Then
98     --
99     -- One of the primary key arguments is null therefore we must
100     -- set the returning function value to false
101     --
102     l_fct_ret := false;
103   Else
104     If (p_fnd_doc_link_id
105         = per_fdl_shd.g_old_rec.fnd_doc_link_id and
106         p_object_version_number
107         = per_fdl_shd.g_old_rec.object_version_number
108        ) Then
109       --
110       -- The g_old_rec is current therefore we must
111       -- set the returning function to true
112       --
113       l_fct_ret := true;
114     Else
115       --
116       -- Select the current row into g_old_rec
117       --
118       Open C_Sel1;
119       Fetch C_Sel1 Into per_fdl_shd.g_old_rec;
120       If C_Sel1%notfound Then
121         Close C_Sel1;
122         --
123         -- The primary key is invalid therefore we must error
124         --
125         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
126         fnd_message.raise_error;
127       End If;
128       Close C_Sel1;
129       If (p_object_version_number
130           <> per_fdl_shd.g_old_rec.object_version_number) Then
131         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
132         fnd_message.raise_error;
133       End If;
134       l_fct_ret := true;
135     End If;
136   End If;
137   Return (l_fct_ret);
138 --
139 End api_updating;
140 
141 --
142 -- ----------------------------------------------------------------------------
143 -- |---------------------------------< lck >----------------------------------|
144 -- ----------------------------------------------------------------------------
145 Procedure lck
146   (p_fnd_doc_link_id                      in     number
147   ,p_object_version_number                in     number
148   ) is
149 --
150 -- Cursor selects the 'current' row from the HR Schema
151 --
152   Cursor C_Sel1 is
153     select
154        fnd_doc_link_id
155       ,entity_name
156       ,sub_entity_name
157       ,entity_doc_id
158       ,fnd_doc_id
159       ,person_id
160       ,assignment_id
161       ,application_id
162       ,doc_upload_date
163       ,transaction_type
164       ,transaction_status
165       ,status
166       ,fdl_information_category
167       ,fdl_information1
168       ,fdl_information2
169       ,fdl_information3
170       ,fdl_information4
171       ,fdl_information5
172       ,fdl_information6
173       ,fdl_information7
174       ,fdl_information8
175       ,fdl_information9
176       ,fdl_information10
177       ,object_version_number
178     from        per_fnd_doc_links
179 
180     where       fnd_doc_link_id = p_fnd_doc_link_id
181 
182     for update nowait;
183 --
184   l_proc        varchar2(72) := g_package||'lck';
185 --
186 Begin
187   hr_utility.set_location('Entering:'||l_proc, 5);
188   --
189   hr_api.mandatory_arg_error
190     (p_api_name           => l_proc
191     ,p_argument           => 'FND_DOC_LINK_ID'
192     ,p_argument_value     => p_fnd_doc_link_id
193     );
194   hr_utility.set_location(l_proc,6);
195   hr_api.mandatory_arg_error
196     (p_api_name           => l_proc
197     ,p_argument           => 'OBJECT_VERSION_NUMBER'
198     ,p_argument_value     => p_object_version_number
199     );
200 
201   --
202   Open  C_Sel1;
203   Fetch C_Sel1 Into per_fdl_shd.g_old_rec;
204   If C_Sel1%notfound then
205     Close C_Sel1;
206     --
207     -- The primary key is invalid therefore we must error
208     --
209     fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
210     fnd_message.raise_error;
211   End If;
212   Close C_Sel1;
213   If (p_object_version_number
214       <> per_fdl_shd.g_old_rec.object_version_number) Then
215         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
216         fnd_message.raise_error;
217   End If;
218   --
219   hr_utility.set_location(' Leaving:'||l_proc, 10);
220   --
221   -- We need to trap the ORA LOCK exception
222   --
223 Exception
224   When HR_Api.Object_Locked then
225     --
226     -- The object is locked therefore we need to supply a meaningful
227     -- error message.
228     --
229     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
230     fnd_message.set_token('TABLE_NAME', 'per_fnd_doc_links');
231     fnd_message.raise_error;
232 End lck;
233 
234 --
235 -- ----------------------------------------------------------------------------
236 -- |-----------------------------< convert_args >-----------------------------|
237 -- ----------------------------------------------------------------------------
238 Function convert_args
239   (p_fnd_doc_link_id                in number
240   ,p_entity_name                    in varchar2
241   ,p_sub_entity_name                in varchar2
242   ,p_entity_doc_id                  in number
243   ,p_fnd_doc_id                     in number
244   ,p_person_id                      in number
245   ,p_assignment_id                  in number
246   ,p_application_id                 in number
247   ,p_doc_upload_date                in date
248   ,p_transaction_type               in varchar2
249   ,p_transaction_status             in varchar2
250   ,p_status                         in varchar2
251   ,p_fdl_information_category       in varchar2
252   ,p_fdl_information1               in varchar2
253   ,p_fdl_information2               in varchar2
254   ,p_fdl_information3               in varchar2
255   ,p_fdl_information4               in varchar2
256   ,p_fdl_information5               in varchar2
257   ,p_fdl_information6               in varchar2
258   ,p_fdl_information7               in varchar2
259   ,p_fdl_information8               in varchar2
260   ,p_fdl_information9               in varchar2
261   ,p_fdl_information10              in varchar2
262   ,p_object_version_number          in number
263   )
264   Return g_rec_type is
265 --
266   l_rec   g_rec_type;
267 --
268 Begin
269   --
270   -- Convert arguments into local l_rec structure.
271   --
272   l_rec.fnd_doc_link_id                  := p_fnd_doc_link_id;
273   l_rec.entity_name                      := p_entity_name;
274   l_rec.sub_entity_name                  := p_sub_entity_name;
275   l_rec.entity_doc_id                    := p_entity_doc_id;
276   l_rec.fnd_doc_id                       := p_fnd_doc_id;
277   l_rec.person_id                        := p_person_id;
278   l_rec.assignment_id                    := p_assignment_id;
279   l_rec.application_id                   := p_application_id;
280   l_rec.doc_upload_date                  := p_doc_upload_date;
281   l_rec.transaction_type                 := p_transaction_type;
282   l_rec.transaction_status               := p_transaction_status;
283   l_rec.status                           := p_status;
284   l_rec.fdl_information_category         := p_fdl_information_category;
285   l_rec.fdl_information1                 := p_fdl_information1;
286   l_rec.fdl_information2                 := p_fdl_information2;
287   l_rec.fdl_information3                 := p_fdl_information3;
288   l_rec.fdl_information4                 := p_fdl_information4;
289   l_rec.fdl_information5                 := p_fdl_information5;
290   l_rec.fdl_information6                 := p_fdl_information6;
291   l_rec.fdl_information7                 := p_fdl_information7;
292   l_rec.fdl_information8                 := p_fdl_information8;
293   l_rec.fdl_information9                 := p_fdl_information9;
294   l_rec.fdl_information10                := p_fdl_information10;
295   l_rec.object_version_number            := p_object_version_number;
296   --
297   -- Return the plsql record structure.
298   --
299   Return(l_rec);
300 --
301 End convert_args;
302 
303 --
304 end per_fdl_shd;