DBA Data[Home] [Help]

PACKAGE BODY: APPS.PV_GE_PARTY_NOTIF_PVT

Source


1 PACKAGE BODY PV_Ge_Party_Notif_PVT as
2 /* $Header: pvxvgpnb.pls 120.1 2005/08/26 10:20:03 appldev ship $ */
3 -- ===============================================================
4 -- Start of Comments
5 -- Package name
6 --          PV_Ge_Party_Notif_PVT
7 -- Purpose
8 --
9 -- History
10 --
11 -- NOTE
12 --
13 -- This Api is generated with Latest version of
14 -- Rosetta, where g_miss indicates NULL and
15 -- NULL indicates missing value. Rosetta Version 1.55
16 -- End of Comments
17 -- ===============================================================
18 
19 
20 G_PKG_NAME CONSTANT VARCHAR2(30):= 'PV_Ge_Party_Notif_PVT';
21 G_FILE_NAME CONSTANT VARCHAR2(12) := 'pvxvgpnb.pls';
22 
23 -- G_USER_ID         NUMBER := FND_GLOBAL.USER_ID;
24 -- G_LOGIN_ID        NUMBER := FND_GLOBAL.CONC_LOGIN_ID;
25 --
26 -- Foreward Procedure Declarations
27 --
28 
29 PROCEDURE Default_Pgp_Notif_Items (
30    p_pgp_notif_rec IN  pgp_notif_rec_type ,
31    x_pgp_notif_rec OUT NOCOPY pgp_notif_rec_type
32 ) ;
33 
34 
35 
36 -- Hint: Primary key needs to be returned.
37 --   ==============================================================================
38 --    Start of Comments
39 --   ==============================================================================
40 --   API Name
41 --           Create_Ge_Party_Notif
42 --   Type
43 --           Private
44 --   Pre-Req
45 --
46 --   Parameters
47 --
48 --   IN
49 --       p_api_version_number      IN   NUMBER     Required
50 --       p_init_msg_list           IN   VARCHAR2   Optional  Default = FND_API_G_FALSE
51 --       p_commit                  IN   VARCHAR2   Optional  Default = FND_API.G_FALSE
52 --       p_validation_level        IN   NUMBER     Optional  Default = FND_API.G_VALID_LEVEL_FULL
53 --       p_pgp_notif_rec            IN   pgp_notif_rec_type  Required
54 --
55 --   OUT
56 --       x_return_status           OUT  VARCHAR2
57 --       x_msg_count               OUT  NUMBER
58 --       x_msg_data                OUT  VARCHAR2
59 --   Version : Current version 1.0
60 --   Note: This automatic generated procedure definition, it includes standard IN/OUT parameters
61 --         and basic operation, developer must manually add parameters and business logic as necessary.
62 --
63 --   History
64 --
65 --   NOTE
66 --
67 --   End of Comments
68 --   ==============================================================================
69 
70 PV_DEBUG_HIGH_ON CONSTANT boolean := FND_MSG_PUB.CHECK_MSG_LEVEL(FND_MSG_PUB.G_MSG_LVL_DEBUG_HIGH);
71 PV_DEBUG_LOW_ON CONSTANT boolean := FND_MSG_PUB.CHECK_MSG_LEVEL(FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW);
72 PV_DEBUG_MEDIUM_ON CONSTANT boolean := FND_MSG_PUB.CHECK_MSG_LEVEL(FND_MSG_PUB.G_MSG_LVL_DEBUG_MEDIUM);
73 
74 PROCEDURE Create_Ge_Party_Notif(
75     p_api_version_number         IN   NUMBER,
76     p_init_msg_list              IN   VARCHAR2     := FND_API.G_FALSE,
77     p_commit                     IN   VARCHAR2     := FND_API.G_FALSE,
78     p_validation_level           IN   NUMBER       := FND_API.G_VALID_LEVEL_FULL,
79 
80     x_return_status              OUT NOCOPY  VARCHAR2,
81     x_msg_count                  OUT NOCOPY  NUMBER,
82     x_msg_data                   OUT NOCOPY  VARCHAR2,
83 
84     p_pgp_notif_rec              IN   pgp_notif_rec_type  := g_miss_pgp_notif_rec,
85     x_party_notification_id              OUT NOCOPY  NUMBER
86      )
87 
88  IS
89 L_API_NAME                  CONSTANT VARCHAR2(30) := 'Create_Ge_Party_Notif';
90 L_API_VERSION_NUMBER        CONSTANT NUMBER   := 1.0;
91    l_return_status_full        VARCHAR2(1);
92    l_object_version_number     NUMBER := 1;
93    l_org_id                    NUMBER := FND_API.G_MISS_NUM;
94    l_party_notification_id              NUMBER;
95    l_dummy                     NUMBER;
96    CURSOR c_id IS
97       SELECT pv_ge_party_notifications_s.NEXTVAL
98       FROM dual;
99 
100    CURSOR c_id_exists (l_id IN NUMBER) IS
101       SELECT 1
102       FROM PV_GE_PARTY_NOTIFICATIONS
103       WHERE party_notification_id = l_id;
104 BEGIN
105       -- Standard Start of API savepoint
106       SAVEPOINT create_ge_party_notif_pvt;
107 
108       -- Standard call to check for call compatibility.
109       IF NOT FND_API.Compatible_API_Call ( l_api_version_number,
110                                            p_api_version_number,
111                                            l_api_name,
112                                            G_PKG_NAME)
113       THEN
114           RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
115       END IF;
116 
117 
118       -- Initialize message list if p_init_msg_list is set to TRUE.
119       IF FND_API.to_Boolean( p_init_msg_list )
120       THEN
121          FND_MSG_PUB.initialize;
122       END IF;
123 
124 
125 
126       -- Debug Message
127       IF (PV_DEBUG_HIGH_ON) THEN
128 
129       PVX_UTILITY_PVT.debug_message('Private API: ' || l_api_name || 'start');
130       END IF;
131 
132 
133 
134       -- Initialize API return status to SUCCESS
135       x_return_status := FND_API.G_RET_STS_SUCCESS;
136 
137       -- =========================================================================
138       -- Validate Environment
139       -- =========================================================================
140 
141       IF FND_GLOBAL.USER_ID IS NULL
142       THEN
143          PVX_UTILITY_PVT.Error_Message(p_message_name => 'USER_PROFILE_MISSING');
144           RAISE FND_API.G_EXC_ERROR;
145       END IF;
146 
147 
148 
149       IF ( P_validation_level >= FND_API.G_VALID_LEVEL_FULL)
150       THEN
151           -- Debug message
152           IF (PV_DEBUG_HIGH_ON) THEN
153 
154           PVX_UTILITY_PVT.debug_message('Private API: Validate_Ge_Party_Notif');
155           END IF;
156 
157           -- Invoke validation procedures
158           Validate_ge_party_notif(
159             p_api_version_number     => 1.0,
160             p_init_msg_list    => FND_API.G_FALSE,
161             p_validation_level => p_validation_level,
162             p_validation_mode => JTF_PLSQL_API.g_create,
163             p_pgp_notif_rec  =>  p_pgp_notif_rec,
164             x_return_status    => x_return_status,
165             x_msg_count        => x_msg_count,
166             x_msg_data         => x_msg_data);
167       END IF;
168 
169       IF x_return_status<>FND_API.G_RET_STS_SUCCESS THEN
170           RAISE FND_API.G_EXC_ERROR;
171       END IF;
172 
173    -- Local variable initialization
174 
175    IF p_pgp_notif_rec.party_notification_id IS NULL OR p_pgp_notif_rec.party_notification_id = FND_API.g_miss_num THEN
176       LOOP
177          l_dummy := NULL;
178          OPEN c_id;
179          FETCH c_id INTO l_party_notification_id;
180          CLOSE c_id;
181 
182          OPEN c_id_exists(l_party_notification_id);
183          FETCH c_id_exists INTO l_dummy;
184          CLOSE c_id_exists;
185          EXIT WHEN l_dummy IS NULL;
186       END LOOP;
187    ELSE
188          l_party_notification_id := p_pgp_notif_rec.party_notification_id;
189    END IF;
190 
191       -- Debug Message
192       IF (PV_DEBUG_HIGH_ON) THEN
193 
194       PVX_UTILITY_PVT.debug_message( 'Private API: Calling create table handler');
195       END IF;
196 
197       -- Invoke table handler(Pv_Ge_Party_Notif_Pkg.Insert_Row)
198       Pv_Ge_Party_Notif_Pkg.Insert_Row(
199           px_party_notification_id  => l_party_notification_id,
200           p_notification_id  => p_pgp_notif_rec.notification_id,
201           px_object_version_number  => l_object_version_number,
202           p_partner_id  => p_pgp_notif_rec.partner_id,
203           p_recipient_user_id  => p_pgp_notif_rec.recipient_user_id,
204           p_notif_for_entity_id  => p_pgp_notif_rec.notif_for_entity_id,
205           p_arc_notif_for_entity_code  => p_pgp_notif_rec.arc_notif_for_entity_code,
206           p_notif_type_code  => p_pgp_notif_rec.notif_type_code,
207           p_created_by  => FND_GLOBAL.USER_ID,
208           p_creation_date  => SYSDATE,
209           p_last_updated_by  => FND_GLOBAL.USER_ID,
210           p_last_update_date  => SYSDATE,
211           p_last_update_login  => FND_GLOBAL.conc_login_id
212 );
213 
214           x_party_notification_id := l_party_notification_id;
215       IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
216           RAISE FND_API.G_EXC_ERROR;
217       END IF;
218 --
219 -- End of API body
220 --
221 
222       -- Standard check for p_commit
223       IF FND_API.to_Boolean( p_commit )
224       THEN
225          COMMIT WORK;
226       END IF;
227 
228 
229       -- Debug Message
230       IF (PV_DEBUG_HIGH_ON) THEN
231 
232       PVX_UTILITY_PVT.debug_message('Private API: ' || l_api_name || 'end');
233       END IF;
234 
235 
236       -- Standard call to get message count and if count is 1, get message info.
237       FND_MSG_PUB.Count_And_Get
238         (p_count          =>   x_msg_count,
239          p_data           =>   x_msg_data
240       );
241 EXCEPTION
242 
243    WHEN PVX_UTILITY_PVT.resource_locked THEN
244      x_return_status := FND_API.g_ret_sts_error;
245          PVX_UTILITY_PVT.Error_Message(p_message_name => 'PV_API_RESOURCE_LOCKED');
246 
247    WHEN FND_API.G_EXC_ERROR THEN
248      ROLLBACK TO CREATE_Ge_Party_Notif_PVT;
249      x_return_status := FND_API.G_RET_STS_ERROR;
250      -- Standard call to get message count and if count=1, get the message
251      FND_MSG_PUB.Count_And_Get (
252             p_encoded => FND_API.G_FALSE,
253             p_count   => x_msg_count,
254             p_data    => x_msg_data
255      );
256 
257    WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
258      ROLLBACK TO CREATE_Ge_Party_Notif_PVT;
259      x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
260      -- Standard call to get message count and if count=1, get the message
261      FND_MSG_PUB.Count_And_Get (
262             p_encoded => FND_API.G_FALSE,
263             p_count => x_msg_count,
264             p_data  => x_msg_data
265      );
266 
267    WHEN OTHERS THEN
268      ROLLBACK TO CREATE_Ge_Party_Notif_PVT;
269      x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
270      IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
271      THEN
272         FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
273      END IF;
274      -- Standard call to get message count and if count=1, get the message
275      FND_MSG_PUB.Count_And_Get (
276             p_encoded => FND_API.G_FALSE,
277             p_count => x_msg_count,
278             p_data  => x_msg_data
279      );
280 End Create_Ge_Party_Notif;
281 
282 
283 --   ==============================================================================
284 --    Start of Comments
285 --   ==============================================================================
286 --   API Name
287 --           Update_Ge_Party_Notif
288 --   Type
289 --           Private
290 --   Pre-Req
291 --
292 --   Parameters
293 --
294 --   IN
295 --       p_api_version_number      IN   NUMBER     Required
296 --       p_init_msg_list           IN   VARCHAR2   Optional  Default = FND_API_G_FALSE
297 --       p_commit                  IN   VARCHAR2   Optional  Default = FND_API.G_FALSE
298 --       p_validation_level        IN   NUMBER     Optional  Default = FND_API.G_VALID_LEVEL_FULL
299 --       p_pgp_notif_rec            IN   pgp_notif_rec_type  Required
300 --
301 --   OUT
302 --       x_return_status           OUT  VARCHAR2
303 --       x_msg_count               OUT  NUMBER
304 --       x_msg_data                OUT  VARCHAR2
305 --   Version : Current version 1.0
306 --   Note: This automatic generated procedure definition, it includes standard IN/OUT parameters
307 --         and basic operation, developer must manually add parameters and business logic as necessary.
308 --
309 --   History
310 --
311 --   NOTE
312 --
313 --   End of Comments
314 --   ==============================================================================
315 
316 PROCEDURE Update_Ge_Party_Notif(
317     p_api_version_number         IN   NUMBER,
318     p_init_msg_list              IN   VARCHAR2     := FND_API.G_FALSE,
319     p_commit                     IN   VARCHAR2     := FND_API.G_FALSE,
320     p_validation_level           IN  NUMBER       := FND_API.G_VALID_LEVEL_FULL,
321 
322     x_return_status              OUT NOCOPY  VARCHAR2,
323     x_msg_count                  OUT NOCOPY  NUMBER,
324     x_msg_data                   OUT NOCOPY  VARCHAR2,
325 
326     p_pgp_notif_rec               IN    pgp_notif_rec_type
327     )
328 
329  IS
330 
331 
332 CURSOR c_get_ge_party_notif(party_notification_id NUMBER) IS
333     SELECT *
334     FROM  PV_GE_PARTY_NOTIFICATIONS
335     WHERE  party_notification_id = p_pgp_notif_rec.party_notification_id;
336     -- Hint: Developer need to provide Where clause
337 
338 
339 L_API_NAME                  CONSTANT VARCHAR2(30) := 'Update_Ge_Party_Notif';
340 L_API_VERSION_NUMBER        CONSTANT NUMBER   := 1.0;
341 -- Local Variables
342 l_object_version_number     NUMBER;
343 l_party_notification_id    NUMBER;
344 l_ref_pgp_notif_rec  c_get_Ge_Party_Notif%ROWTYPE ;
345 l_tar_pgp_notif_rec  pgp_notif_rec_type := P_pgp_notif_rec;
346 l_rowid  ROWID;
347 
348  BEGIN
349       -- Standard Start of API savepoint
350       SAVEPOINT update_ge_party_notif_pvt;
351 
352       -- Standard call to check for call compatibility.
353       IF NOT FND_API.Compatible_API_Call ( l_api_version_number,
354                                            p_api_version_number,
355                                            l_api_name,
356                                            G_PKG_NAME)
357       THEN
358           RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
359       END IF;
360 
361 
362       -- Initialize message list if p_init_msg_list is set to TRUE.
363       IF FND_API.to_Boolean( p_init_msg_list )
364       THEN
365          FND_MSG_PUB.initialize;
366       END IF;
367 
368 
369 
370       -- Debug Message
371       IF (PV_DEBUG_HIGH_ON) THEN
372 
373       PVX_UTILITY_PVT.debug_message('Private API: ' || l_api_name || 'start');
374       END IF;
375 
376 
377 
378       -- Initialize API return status to SUCCESS
379       x_return_status := FND_API.G_RET_STS_SUCCESS;
380 
381       -- Debug Message
382       IF (PV_DEBUG_HIGH_ON) THEN
383 
384       PVX_UTILITY_PVT.debug_message('Private API: - Open Cursor to Select');
385       END IF;
386 
387       OPEN c_get_Ge_Party_Notif( l_tar_pgp_notif_rec.party_notification_id);
388 
389       FETCH c_get_Ge_Party_Notif INTO l_ref_pgp_notif_rec  ;
390 
391        If ( c_get_Ge_Party_Notif%NOTFOUND) THEN
392   PVX_UTILITY_PVT.Error_Message(p_message_name => 'API_MISSING_UPDATE_TARGET',
393    p_token_name   => 'INFO',
394  p_token_value  => 'Ge_Party_Notif') ;
395            RAISE FND_API.G_EXC_ERROR;
396        END IF;
397        -- Debug Message
398        IF (PV_DEBUG_HIGH_ON) THEN
399 
400        PVX_UTILITY_PVT.debug_message('Private API: - Close Cursor');
401        END IF;
402        CLOSE     c_get_Ge_Party_Notif;
403 
404 
405       If (l_tar_pgp_notif_rec.object_version_number is NULL or
406           l_tar_pgp_notif_rec.object_version_number = FND_API.G_MISS_NUM ) Then
407   PVX_UTILITY_PVT.Error_Message(p_message_name => 'API_VERSION_MISSING',
408    p_token_name   => 'COLUMN',
409  p_token_value  => 'Last_Update_Date') ;
410           raise FND_API.G_EXC_ERROR;
411       End if;
412       -- Check Whether record has been changed by someone else
413       If (l_tar_pgp_notif_rec.object_version_number <> l_ref_pgp_notif_rec.object_version_number) Then
414   PVX_UTILITY_PVT.Error_Message(p_message_name => 'API_RECORD_CHANGED',
415    p_token_name   => 'INFO',
416  p_token_value  => 'Ge_Party_Notif') ;
417           raise FND_API.G_EXC_ERROR;
418       End if;
419 
420 
421       IF ( P_validation_level >= FND_API.G_VALID_LEVEL_FULL)
422       THEN
423           -- Debug message
424           IF (PV_DEBUG_HIGH_ON) THEN
425 
426           PVX_UTILITY_PVT.debug_message('Private API: Validate_Ge_Party_Notif');
427           END IF;
428 
429           -- Invoke validation procedures
430           Validate_ge_party_notif(
431             p_api_version_number     => 1.0,
432             p_init_msg_list    => FND_API.G_FALSE,
433             p_validation_level => p_validation_level,
434             p_validation_mode => JTF_PLSQL_API.g_update,
435             p_pgp_notif_rec  =>  p_pgp_notif_rec,
436             x_return_status    => x_return_status,
437             x_msg_count        => x_msg_count,
438             x_msg_data         => x_msg_data);
439       END IF;
440 
441       IF x_return_status<>FND_API.G_RET_STS_SUCCESS THEN
442           RAISE FND_API.G_EXC_ERROR;
443       END IF;
444 
445 
446       -- Debug Message
447       IF (PV_DEBUG_HIGH_ON) THEN
448 
449       PVX_UTILITY_PVT.debug_message('Private API: Calling update table handler');
450       END IF;
451 
452       -- Invoke table handler(Pv_Ge_Party_Notif_Pkg.Update_Row)
453       Pv_Ge_Party_Notif_Pkg.Update_Row(
454           p_party_notification_id  => p_pgp_notif_rec.party_notification_id,
455           p_notification_id  => p_pgp_notif_rec.notification_id,
456           p_object_version_number  => p_pgp_notif_rec.object_version_number,
457           p_partner_id  => p_pgp_notif_rec.partner_id,
458           p_recipient_user_id  => p_pgp_notif_rec.recipient_user_id,
459           p_notif_for_entity_id  => p_pgp_notif_rec.notif_for_entity_id,
460           p_arc_notif_for_entity_code  => p_pgp_notif_rec.arc_notif_for_entity_code,
461           p_notif_type_code  => p_pgp_notif_rec.notif_type_code,
462           p_last_updated_by  => FND_GLOBAL.USER_ID,
463           p_last_update_date  => SYSDATE,
464           p_last_update_login  => FND_GLOBAL.conc_login_id
465 );
466       --
467       -- End of API body.
468       --
469 
470       -- Standard check for p_commit
471       IF FND_API.to_Boolean( p_commit )
472       THEN
473          COMMIT WORK;
474       END IF;
475 
476 
477       -- Debug Message
478       IF (PV_DEBUG_HIGH_ON) THEN
479 
480       PVX_UTILITY_PVT.debug_message('Private API: ' || l_api_name || 'end');
481       END IF;
482 
483 
484       -- Standard call to get message count and if count is 1, get message info.
485       FND_MSG_PUB.Count_And_Get
486         (p_count          =>   x_msg_count,
487          p_data           =>   x_msg_data
488       );
489 EXCEPTION
490 
491    WHEN PVX_UTILITY_PVT.resource_locked THEN
492      x_return_status := FND_API.g_ret_sts_error;
493          PVX_UTILITY_PVT.Error_Message(p_message_name => 'PV_API_RESOURCE_LOCKED');
494 
495    WHEN FND_API.G_EXC_ERROR THEN
496      ROLLBACK TO UPDATE_Ge_Party_Notif_PVT;
497      x_return_status := FND_API.G_RET_STS_ERROR;
498      -- Standard call to get message count and if count=1, get the message
499      FND_MSG_PUB.Count_And_Get (
500             p_encoded => FND_API.G_FALSE,
501             p_count   => x_msg_count,
502             p_data    => x_msg_data
503      );
504 
505    WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
506      ROLLBACK TO UPDATE_Ge_Party_Notif_PVT;
507      x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
508      -- Standard call to get message count and if count=1, get the message
509      FND_MSG_PUB.Count_And_Get (
510             p_encoded => FND_API.G_FALSE,
511             p_count => x_msg_count,
512             p_data  => x_msg_data
513      );
514 
515    WHEN OTHERS THEN
516      ROLLBACK TO UPDATE_Ge_Party_Notif_PVT;
517      x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
518      IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
519      THEN
520         FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
521      END IF;
522      -- Standard call to get message count and if count=1, get the message
523      FND_MSG_PUB.Count_And_Get (
524             p_encoded => FND_API.G_FALSE,
525             p_count => x_msg_count,
526             p_data  => x_msg_data
527      );
528 End Update_Ge_Party_Notif;
529 
530 
531 --   ==============================================================================
532 --    Start of Comments
533 --   ==============================================================================
534 --   API Name
535 --           Delete_Ge_Party_Notif
536 --   Type
537 --           Private
538 --   Pre-Req
539 --
540 --   Parameters
541 --
542 --   IN
543 --       p_api_version_number      IN   NUMBER     Required
544 --       p_init_msg_list           IN   VARCHAR2   Optional  Default = FND_API_G_FALSE
545 --       p_commit                  IN   VARCHAR2   Optional  Default = FND_API.G_FALSE
546 --       p_validation_level        IN   NUMBER     Optional  Default = FND_API.G_VALID_LEVEL_FULL
547 --       p_party_notification_id                IN   NUMBER
548 --       p_object_version_number   IN   NUMBER     Optional  Default = NULL
549 --
550 --   OUT
551 --       x_return_status           OUT  VARCHAR2
552 --       x_msg_count               OUT  NUMBER
553 --       x_msg_data                OUT  VARCHAR2
554 --   Version : Current version 1.0
555 --   Note: This automatic generated procedure definition, it includes standard IN/OUT parameters
556 --         and basic operation, developer must manually add parameters and business logic as necessary.
557 --
558 --   History
559 --
560 --   NOTE
561 --
562 --   End of Comments
563 --   ==============================================================================
564 
565 PROCEDURE Delete_Ge_Party_Notif(
566     p_api_version_number         IN   NUMBER,
567     p_init_msg_list              IN   VARCHAR2     := FND_API.G_FALSE,
568     p_commit                     IN   VARCHAR2     := FND_API.G_FALSE,
569     p_validation_level           IN   NUMBER       := FND_API.G_VALID_LEVEL_FULL,
570     x_return_status              OUT NOCOPY  VARCHAR2,
571     x_msg_count                  OUT NOCOPY  NUMBER,
572     x_msg_data                   OUT NOCOPY  VARCHAR2,
573     p_party_notification_id                   IN  NUMBER,
574     p_object_version_number      IN   NUMBER
575     )
576 
577  IS
578 L_API_NAME                  CONSTANT VARCHAR2(30) := 'Delete_Ge_Party_Notif';
579 L_API_VERSION_NUMBER        CONSTANT NUMBER   := 1.0;
580 l_object_version_number     NUMBER;
581 
582  BEGIN
583       -- Standard Start of API savepoint
584       SAVEPOINT delete_ge_party_notif_pvt;
585 
586       -- Standard call to check for call compatibility.
587       IF NOT FND_API.Compatible_API_Call ( l_api_version_number,
588                                            p_api_version_number,
589                                            l_api_name,
590                                            G_PKG_NAME)
591       THEN
592           RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
593       END IF;
594 
595 
596       -- Initialize message list if p_init_msg_list is set to TRUE.
597       IF FND_API.to_Boolean( p_init_msg_list )
598       THEN
599          FND_MSG_PUB.initialize;
600       END IF;
601 
602 
603 
604       -- Debug Message
605       IF (PV_DEBUG_HIGH_ON) THEN
606 
607       PVX_UTILITY_PVT.debug_message('Private API: ' || l_api_name || 'start');
608       END IF;
609 
610 
611 
612       -- Initialize API return status to SUCCESS
613       x_return_status := FND_API.G_RET_STS_SUCCESS;
614 
615       --
616       -- Api body
617       --
618       -- Debug Message
619       IF (PV_DEBUG_HIGH_ON) THEN
620 
621       PVX_UTILITY_PVT.debug_message( 'Private API: Calling delete table handler');
622       END IF;
623 
624       -- Invoke table handler(Pv_Ge_Party_Notif_Pkg.Delete_Row)
625       Pv_Ge_Party_Notif_Pkg.Delete_Row(
626           p_party_notification_id  => p_party_notification_id,
627           p_object_version_number => p_object_version_number     );
628       --
629       -- End of API body
630       --
631 
632       -- Standard check for p_commit
633       IF FND_API.to_Boolean( p_commit )
634       THEN
635          COMMIT WORK;
636       END IF;
637 
638 
639       -- Debug Message
640       IF (PV_DEBUG_HIGH_ON) THEN
641 
642       PVX_UTILITY_PVT.debug_message('Private API: ' || l_api_name || 'end');
643       END IF;
644 
645 
646       -- Standard call to get message count and if count is 1, get message info.
647       FND_MSG_PUB.Count_And_Get
648         (p_count          =>   x_msg_count,
649          p_data           =>   x_msg_data
650       );
651 EXCEPTION
652 
653    WHEN PVX_UTILITY_PVT.resource_locked THEN
654      x_return_status := FND_API.g_ret_sts_error;
655          PVX_UTILITY_PVT.Error_Message(p_message_name => 'PV_API_RESOURCE_LOCKED');
656 
657    WHEN FND_API.G_EXC_ERROR THEN
658      ROLLBACK TO DELETE_Ge_Party_Notif_PVT;
659      x_return_status := FND_API.G_RET_STS_ERROR;
660      -- Standard call to get message count and if count=1, get the message
661      FND_MSG_PUB.Count_And_Get (
662             p_encoded => FND_API.G_FALSE,
663             p_count   => x_msg_count,
664             p_data    => x_msg_data
665      );
666 
667    WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
668      ROLLBACK TO DELETE_Ge_Party_Notif_PVT;
669      x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
670      -- Standard call to get message count and if count=1, get the message
671      FND_MSG_PUB.Count_And_Get (
672             p_encoded => FND_API.G_FALSE,
673             p_count => x_msg_count,
674             p_data  => x_msg_data
675      );
676 
677    WHEN OTHERS THEN
678      ROLLBACK TO DELETE_Ge_Party_Notif_PVT;
679      x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
680      IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
681      THEN
682         FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
683      END IF;
684      -- Standard call to get message count and if count=1, get the message
685      FND_MSG_PUB.Count_And_Get (
686             p_encoded => FND_API.G_FALSE,
687             p_count => x_msg_count,
688             p_data  => x_msg_data
689      );
690 End Delete_Ge_Party_Notif;
691 
692 
693 
694 -- Hint: Primary key needs to be returned.
695 --   ==============================================================================
696 --    Start of Comments
697 --   ==============================================================================
698 --   API Name
699 --           Lock_Ge_Party_Notif
700 --   Type
701 --           Private
702 --   Pre-Req
703 --
704 --   Parameters
705 --
706 --   IN
707 --       p_api_version_number      IN   NUMBER     Required
708 --       p_init_msg_list           IN   VARCHAR2   Optional  Default = FND_API_G_FALSE
709 --       p_commit                  IN   VARCHAR2   Optional  Default = FND_API.G_FALSE
710 --       p_validation_level        IN   NUMBER     Optional  Default = FND_API.G_VALID_LEVEL_FULL
711 --       p_pgp_notif_rec            IN   pgp_notif_rec_type  Required
712 --
713 --   OUT
714 --       x_return_status           OUT  VARCHAR2
715 --       x_msg_count               OUT  NUMBER
716 --       x_msg_data                OUT  VARCHAR2
717 --   Version : Current version 1.0
718 --   Note: This automatic generated procedure definition, it includes standard IN/OUT parameters
719 --         and basic operation, developer must manually add parameters and business logic as necessary.
720 --
721 --   History
722 --
723 --   NOTE
724 --
725 --   End of Comments
726 --   ==============================================================================
727 
728 PROCEDURE Lock_Ge_Party_Notif(
729     p_api_version_number         IN   NUMBER,
730     p_init_msg_list              IN   VARCHAR2     := FND_API.G_FALSE,
731 
732     x_return_status              OUT NOCOPY  VARCHAR2,
733     x_msg_count                  OUT NOCOPY  NUMBER,
734     x_msg_data                   OUT NOCOPY  VARCHAR2,
735 
736     p_party_notification_id                   IN  NUMBER,
737     p_object_version             IN  NUMBER
738     )
739 
740  IS
741 L_API_NAME                  CONSTANT VARCHAR2(30) := 'Lock_Ge_Party_Notif';
742 L_API_VERSION_NUMBER        CONSTANT NUMBER   := 1.0;
743 L_FULL_NAME                 CONSTANT VARCHAR2(60) := g_pkg_name ||'.'|| l_api_name;
744 l_party_notification_id                  NUMBER;
745 
746 BEGIN
747 
748       -- Debug Message
749       IF (PV_DEBUG_HIGH_ON) THEN
750 
751       PVX_UTILITY_PVT.debug_message('Private API: ' || l_api_name || 'start');
752       END IF;
753 
754 
755       -- Initialize message list if p_init_msg_list is set to TRUE.
756       IF FND_API.to_Boolean( p_init_msg_list )
757       THEN
758          FND_MSG_PUB.initialize;
759       END IF;
760 
761 
762 
763       -- Standard call to check for call compatibility.
764       IF NOT FND_API.Compatible_API_Call ( l_api_version_number,
765                                            p_api_version_number,
766                                            l_api_name,
767                                            G_PKG_NAME)
768       THEN
769           RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
770       END IF;
771 
772 
773 
774       -- Initialize API return status to SUCCESS
775       x_return_status := FND_API.G_RET_STS_SUCCESS;
776 
777 
778 ------------------------ lock -------------------------
779 Pv_Ge_Party_Notif_Pkg.Lock_Row(l_party_notification_id,p_object_version);
780 
781 
782  -------------------- finish --------------------------
783   FND_MSG_PUB.count_and_get(
784     p_encoded => FND_API.g_false,
785     p_count   => x_msg_count,
786     p_data    => x_msg_data);
787   IF (PV_DEBUG_HIGH_ON) THEN
788 
789   PVX_UTILITY_PVT.debug_message(l_full_name ||': end');
790   END IF;
791 EXCEPTION
792 
793    WHEN PVX_UTILITY_PVT.resource_locked THEN
794      x_return_status := FND_API.g_ret_sts_error;
795          PVX_UTILITY_PVT.Error_Message(p_message_name => 'PV_API_RESOURCE_LOCKED');
796 
797    WHEN FND_API.G_EXC_ERROR THEN
798      ROLLBACK TO LOCK_Ge_Party_Notif_PVT;
799      x_return_status := FND_API.G_RET_STS_ERROR;
800      -- Standard call to get message count and if count=1, get the message
801      FND_MSG_PUB.Count_And_Get (
802             p_encoded => FND_API.G_FALSE,
803             p_count   => x_msg_count,
804             p_data    => x_msg_data
805      );
806 
807    WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
808      ROLLBACK TO LOCK_Ge_Party_Notif_PVT;
809      x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
810      -- Standard call to get message count and if count=1, get the message
811      FND_MSG_PUB.Count_And_Get (
812             p_encoded => FND_API.G_FALSE,
813             p_count => x_msg_count,
814             p_data  => x_msg_data
815      );
816 
817    WHEN OTHERS THEN
818      ROLLBACK TO LOCK_Ge_Party_Notif_PVT;
819      x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
820      IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
821      THEN
822         FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
823      END IF;
824      -- Standard call to get message count and if count=1, get the message
825      FND_MSG_PUB.Count_And_Get (
826             p_encoded => FND_API.G_FALSE,
827             p_count => x_msg_count,
828             p_data  => x_msg_data
829      );
830 End Lock_Ge_Party_Notif;
831 
832 
833 
834 
835 PROCEDURE check_Pgp_Notif_Uk_Items(
836     p_pgp_notif_rec               IN   pgp_notif_rec_type,
837     p_validation_mode            IN  VARCHAR2 := JTF_PLSQL_API.g_create,
838     x_return_status              OUT NOCOPY VARCHAR2)
839 IS
840 l_valid_flag  VARCHAR2(1);
841 
842 BEGIN
843       x_return_status := FND_API.g_ret_sts_success;
844       IF p_validation_mode = JTF_PLSQL_API.g_create
845       AND p_pgp_notif_rec.party_notification_id IS NOT NULL
846       THEN
847          l_valid_flag := PVX_UTILITY_PVT.check_uniqueness(
848          'pv_ge_party_notifications',
849          'party_notification_id = ''' || p_pgp_notif_rec.party_notification_id ||''''
850          );
851       END IF;
852 
853       IF l_valid_flag = FND_API.g_false THEN
854          PVX_UTILITY_PVT.Error_Message(p_message_name => 'PV_party_notification_id_DUPLICATE');
855          x_return_status := FND_API.g_ret_sts_error;
856       END IF;
857 
858 END check_Pgp_Notif_Uk_Items;
859 
860 
861 
862 PROCEDURE check_Pgp_Notif_Req_Items(
863     p_pgp_notif_rec               IN  pgp_notif_rec_type,
864     p_validation_mode IN VARCHAR2 := JTF_PLSQL_API.g_create,
865     x_return_status	         OUT NOCOPY VARCHAR2
866 )
867 IS
868 BEGIN
869    x_return_status := FND_API.g_ret_sts_success;
870 
871    IF p_validation_mode = JTF_PLSQL_API.g_create THEN
872 
873 /*
874       IF p_pgp_notif_rec.party_notification_id = FND_API.G_MISS_NUM OR p_pgp_notif_rec.party_notification_id IS NULL THEN
875                PVX_UTILITY_PVT.Error_Message('AMS_API_MISSING_FIELD', 'MISS_FIELD', 'PARTY_NOTIFICATION_ID' );
876                x_return_status := FND_API.g_ret_sts_error;
877       END IF;
878 */
879 
880       IF p_pgp_notif_rec.notification_id = FND_API.G_MISS_NUM OR p_pgp_notif_rec.notification_id IS NULL THEN
881                PVX_UTILITY_PVT.Error_Message('AMS_API_MISSING_FIELD', 'MISS_FIELD', 'NOTIFICATION_ID' );
882                x_return_status := FND_API.g_ret_sts_error;
883       END IF;
884 
885 /*
886       IF p_pgp_notif_rec.object_version_number = FND_API.G_MISS_NUM OR p_pgp_notif_rec.object_version_number IS NULL THEN
887                PVX_UTILITY_PVT.Error_Message('AMS_API_MISSING_FIELD', 'MISS_FIELD', 'OBJECT_VERSION_NUMBER' );
888                x_return_status := FND_API.g_ret_sts_error;
889       END IF;
890 */
891 
892       IF p_pgp_notif_rec.recipient_user_id = FND_API.G_MISS_NUM OR p_pgp_notif_rec.recipient_user_id IS NULL THEN
893                PVX_UTILITY_PVT.Error_Message('AMS_API_MISSING_FIELD', 'MISS_FIELD', 'RECIPIENT_USER_ID' );
894                x_return_status := FND_API.g_ret_sts_error;
895       END IF;
896 
897 
898       IF p_pgp_notif_rec.notif_for_entity_id = FND_API.G_MISS_NUM OR p_pgp_notif_rec.notif_for_entity_id IS NULL THEN
899                PVX_UTILITY_PVT.Error_Message('AMS_API_MISSING_FIELD', 'MISS_FIELD', 'NOTIF_FOR_ENTITY_ID' );
900                x_return_status := FND_API.g_ret_sts_error;
901       END IF;
902 
903 
904    ELSE
905 
906 
907       IF p_pgp_notif_rec.party_notification_id = FND_API.G_MISS_NUM THEN
908                PVX_UTILITY_PVT.Error_Message('AMS_API_MISSING_FIELD', 'MISS_FIELD', 'PARTY_NOTIFICATION_ID' );
909                x_return_status := FND_API.g_ret_sts_error;
910       END IF;
911 
912 
913       IF p_pgp_notif_rec.notification_id = FND_API.G_MISS_NUM THEN
914                PVX_UTILITY_PVT.Error_Message('AMS_API_MISSING_FIELD', 'MISS_FIELD', 'NOTIFICATION_ID' );
915                x_return_status := FND_API.g_ret_sts_error;
916       END IF;
917 
918 
919       IF p_pgp_notif_rec.object_version_number = FND_API.G_MISS_NUM THEN
920                PVX_UTILITY_PVT.Error_Message('AMS_API_MISSING_FIELD', 'MISS_FIELD', 'OBJECT_VERSION_NUMBER' );
921                x_return_status := FND_API.g_ret_sts_error;
922       END IF;
923 
924 
925       IF p_pgp_notif_rec.recipient_user_id = FND_API.G_MISS_NUM THEN
926                PVX_UTILITY_PVT.Error_Message('AMS_API_MISSING_FIELD', 'MISS_FIELD', 'RECIPIENT_USER_ID' );
927                x_return_status := FND_API.g_ret_sts_error;
928       END IF;
929 
930 
931       IF p_pgp_notif_rec.notif_for_entity_id = FND_API.G_MISS_NUM THEN
932                PVX_UTILITY_PVT.Error_Message('AMS_API_MISSING_FIELD', 'MISS_FIELD', 'NOTIF_FOR_ENTITY_ID' );
933                x_return_status := FND_API.g_ret_sts_error;
934       END IF;
935    END IF;
936 
937 END check_Pgp_Notif_Req_Items;
938 
939 
940 
941 PROCEDURE check_Pgp_Notif_Fk_Items(
942     p_pgp_notif_rec IN pgp_notif_rec_type,
943     x_return_status OUT NOCOPY VARCHAR2
944 )
945 IS
946 BEGIN
947    x_return_status := FND_API.g_ret_sts_success;
948 
949    -- Enter custom code here
950 
951 END check_Pgp_Notif_Fk_Items;
952 
953 
954 
955 PROCEDURE check_Pgp_Notif_Lookup_Items(
956     p_pgp_notif_rec IN pgp_notif_rec_type,
957     x_return_status OUT NOCOPY VARCHAR2
958 )
959 IS
960 BEGIN
961    x_return_status := FND_API.g_ret_sts_success;
962 
963    -- Enter custom code here
964 
965 END check_Pgp_Notif_Lookup_Items;
966 
967 
968 
969 PROCEDURE Check_Pgp_Notif_Items (
970     P_pgp_notif_rec     IN    pgp_notif_rec_type,
971     p_validation_mode  IN    VARCHAR2,
972     x_return_status    OUT NOCOPY   VARCHAR2
973     )
974 IS
975    l_return_status   VARCHAR2(1);
976 BEGIN
977 
978     l_return_status := FND_API.g_ret_sts_success;
979    -- Check Items Uniqueness API calls
980 
981    check_Pgp_notif_Uk_Items(
982       p_pgp_notif_rec => p_pgp_notif_rec,
983       p_validation_mode => p_validation_mode,
984       x_return_status => x_return_status);
985    IF x_return_status <> FND_API.g_ret_sts_success THEN
986       l_return_status := FND_API.g_ret_sts_error;
987    END IF;
988 
989    -- Check Items Required/NOT NULL API calls
990 
991    check_pgp_notif_req_items(
992       p_pgp_notif_rec => p_pgp_notif_rec,
993       p_validation_mode => p_validation_mode,
994       x_return_status => x_return_status);
995    IF x_return_status <> FND_API.g_ret_sts_success THEN
996       l_return_status := FND_API.g_ret_sts_error;
997    END IF;
998    -- Check Items Foreign Keys API calls
999 
1000    check_pgp_notif_FK_items(
1001       p_pgp_notif_rec => p_pgp_notif_rec,
1002       x_return_status => x_return_status);
1003    IF x_return_status <> FND_API.g_ret_sts_success THEN
1004       l_return_status := FND_API.g_ret_sts_error;
1005    END IF;
1006    -- Check Items Lookups
1007 
1008    check_pgp_notif_Lookup_items(
1009       p_pgp_notif_rec => p_pgp_notif_rec,
1010       x_return_status => x_return_status);
1011    IF x_return_status <> FND_API.g_ret_sts_success THEN
1012       l_return_status := FND_API.g_ret_sts_error;
1013    END IF;
1014 
1015    x_return_status := l_return_status;
1016 
1017 END Check_pgp_notif_Items;
1018 
1019 
1020 
1021 
1022 
1023 PROCEDURE Complete_Pgp_Notif_Rec (
1024    p_pgp_notif_rec IN pgp_notif_rec_type,
1025    x_complete_rec OUT NOCOPY pgp_notif_rec_type)
1026 IS
1027    l_return_status  VARCHAR2(1);
1028 
1029    CURSOR c_complete IS
1030       SELECT *
1031       FROM pv_ge_party_notifications
1032       WHERE party_notification_id = p_pgp_notif_rec.party_notification_id;
1033    l_pgp_notif_rec c_complete%ROWTYPE;
1034 BEGIN
1035    x_complete_rec := p_pgp_notif_rec;
1036 
1037 
1038    OPEN c_complete;
1039    FETCH c_complete INTO l_pgp_notif_rec;
1040    CLOSE c_complete;
1041 
1042    -- party_notification_id
1043    IF p_pgp_notif_rec.party_notification_id IS NULL THEN
1044       x_complete_rec.party_notification_id := l_pgp_notif_rec.party_notification_id;
1045    END IF;
1046 
1047    -- notification_id
1048    IF p_pgp_notif_rec.notification_id IS NULL THEN
1049       x_complete_rec.notification_id := l_pgp_notif_rec.notification_id;
1050    END IF;
1051 
1052    -- object_version_number
1053    IF p_pgp_notif_rec.object_version_number IS NULL THEN
1054       x_complete_rec.object_version_number := l_pgp_notif_rec.object_version_number;
1055    END IF;
1056 
1057    -- partner_id
1058    IF p_pgp_notif_rec.partner_id IS NULL THEN
1059       x_complete_rec.partner_id := l_pgp_notif_rec.partner_id;
1060    END IF;
1061 
1062    -- recipient_user_id
1063    IF p_pgp_notif_rec.recipient_user_id IS NULL THEN
1064       x_complete_rec.recipient_user_id := l_pgp_notif_rec.recipient_user_id;
1065    END IF;
1066 
1067    -- notif_for_entity_id
1068    IF p_pgp_notif_rec.notif_for_entity_id IS NULL THEN
1069       x_complete_rec.notif_for_entity_id := l_pgp_notif_rec.notif_for_entity_id;
1070    END IF;
1071 
1072    -- arc_notif_for_entity_code
1073    IF p_pgp_notif_rec.arc_notif_for_entity_code IS NULL THEN
1074       x_complete_rec.arc_notif_for_entity_code := l_pgp_notif_rec.arc_notif_for_entity_code;
1075    END IF;
1076 
1077    -- notif_type_code
1078    IF p_pgp_notif_rec.notif_type_code IS NULL THEN
1079       x_complete_rec.notif_type_code := l_pgp_notif_rec.notif_type_code;
1080    END IF;
1081 
1082    -- created_by
1083    IF p_pgp_notif_rec.created_by IS NULL THEN
1084       x_complete_rec.created_by := l_pgp_notif_rec.created_by;
1085    END IF;
1086 
1087    -- creation_date
1088    IF p_pgp_notif_rec.creation_date IS NULL THEN
1089       x_complete_rec.creation_date := l_pgp_notif_rec.creation_date;
1090    END IF;
1091 
1092    -- last_updated_by
1093    IF p_pgp_notif_rec.last_updated_by IS NULL THEN
1094       x_complete_rec.last_updated_by := l_pgp_notif_rec.last_updated_by;
1095    END IF;
1096 
1097    -- last_update_date
1098    IF p_pgp_notif_rec.last_update_date IS NULL THEN
1099       x_complete_rec.last_update_date := l_pgp_notif_rec.last_update_date;
1100    END IF;
1101 
1102    -- last_update_login
1103    IF p_pgp_notif_rec.last_update_login IS NULL THEN
1104       x_complete_rec.last_update_login := l_pgp_notif_rec.last_update_login;
1105    END IF;
1106    -- Note: Developers need to modify the procedure
1107    -- to handle any business specific requirements.
1108 END Complete_Pgp_Notif_Rec;
1109 
1110 
1111 
1112 
1113 PROCEDURE Default_Pgp_Notif_Items ( p_pgp_notif_rec IN pgp_notif_rec_type ,
1114                                 x_pgp_notif_rec OUT NOCOPY pgp_notif_rec_type )
1115 IS
1116    l_pgp_notif_rec pgp_notif_rec_type := p_pgp_notif_rec;
1117 BEGIN
1118    -- Developers should put their code to default the record type
1119    -- e.g. IF p_campaign_rec.status_code IS NULL
1120    --      OR p_campaign_rec.status_code = FND_API.G_MISS_CHAR THEN
1121    --         l_campaign_rec.status_code := 'NEW' ;
1122    --      END IF ;
1123    --
1124    NULL ;
1125 END;
1126 
1127 
1128 
1129 
1130 PROCEDURE Validate_Ge_Party_Notif(
1131     p_api_version_number         IN   NUMBER,
1132     p_init_msg_list              IN   VARCHAR2     := FND_API.G_FALSE,
1133     p_validation_level           IN   NUMBER := FND_API.G_VALID_LEVEL_FULL,
1134     p_pgp_notif_rec               IN   pgp_notif_rec_type,
1135     p_validation_mode            IN    VARCHAR2,
1136     x_return_status              OUT NOCOPY  VARCHAR2,
1137     x_msg_count                  OUT NOCOPY  NUMBER,
1138     x_msg_data                   OUT NOCOPY  VARCHAR2
1139     )
1140  IS
1141 L_API_NAME                  CONSTANT VARCHAR2(30) := 'Validate_Ge_Party_Notif';
1142 L_API_VERSION_NUMBER        CONSTANT NUMBER   := 1.0;
1143 l_object_version_number     NUMBER;
1144 l_pgp_notif_rec         pgp_notif_rec_type;
1145 l_pgp_notif_rec_out     pgp_notif_rec_type;
1146 
1147  BEGIN
1148       -- Standard Start of API savepoint
1149       SAVEPOINT validate_ge_party_notif_;
1150 
1151       -- Standard call to check for call compatibility.
1152       IF NOT FND_API.Compatible_API_Call ( l_api_version_number,
1153                                            p_api_version_number,
1154                                            l_api_name,
1155                                            G_PKG_NAME)
1156       THEN
1157           RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1158       END IF;
1159 
1160 
1161       -- Initialize message list if p_init_msg_list is set to TRUE.
1162       IF FND_API.to_Boolean( p_init_msg_list )
1163       THEN
1164          FND_MSG_PUB.initialize;
1165       END IF;
1166 
1167 
1168       IF p_validation_level >= JTF_PLSQL_API.g_valid_level_item THEN
1169               Check_pgp_notif_Items(
1170                  p_pgp_notif_rec        => p_pgp_notif_rec,
1171                  p_validation_mode   => p_validation_mode,
1172                  x_return_status     => x_return_status
1173               );
1174 
1175               IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1176                   RAISE FND_API.G_EXC_ERROR;
1177               ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1178                   RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1179               END IF;
1180       END IF;
1181 
1182       IF p_validation_mode = JTF_PLSQL_API.g_create THEN
1183          Default_Pgp_Notif_Items (p_pgp_notif_rec => p_pgp_notif_rec ,
1184                                 x_pgp_notif_rec => l_pgp_notif_rec) ;
1185       END IF ;
1186 
1187 
1188       Complete_pgp_notif_Rec(
1189          p_pgp_notif_rec        => l_pgp_notif_rec,
1190          x_complete_rec         => l_pgp_notif_rec_out
1191       );
1192 
1193       l_pgp_notif_rec := l_pgp_notif_rec_out;
1194 
1195       IF p_validation_level >= JTF_PLSQL_API.g_valid_level_item THEN
1196          Validate_pgp_notif_Rec(
1197            p_api_version_number     => 1.0,
1198            p_init_msg_list          => FND_API.G_FALSE,
1199            x_return_status          => x_return_status,
1200            x_msg_count              => x_msg_count,
1201            x_msg_data               => x_msg_data,
1202            p_pgp_notif_rec           =>    l_pgp_notif_rec);
1203 
1204               IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1205                  RAISE FND_API.G_EXC_ERROR;
1206               ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1207                  RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1208               END IF;
1209       END IF;
1210 
1211 
1212       -- Debug Message
1213       IF (PV_DEBUG_HIGH_ON) THEN
1214 
1215       PVX_UTILITY_PVT.debug_message('Private API: ' || l_api_name || 'start');
1216       END IF;
1217 
1218 
1219 
1220       -- Initialize API return status to SUCCESS
1221       x_return_status := FND_API.G_RET_STS_SUCCESS;
1222 
1223 
1224       -- Debug Message
1225       IF (PV_DEBUG_HIGH_ON) THEN
1226 
1227       PVX_UTILITY_PVT.debug_message('Private API: ' || l_api_name || 'end');
1228       END IF;
1229 
1230 
1231       -- Standard call to get message count and if count is 1, get message info.
1232       FND_MSG_PUB.Count_And_Get
1233         (p_count          =>   x_msg_count,
1234          p_data           =>   x_msg_data
1235       );
1236 EXCEPTION
1237 
1238    WHEN PVX_UTILITY_PVT.resource_locked THEN
1239      x_return_status := FND_API.g_ret_sts_error;
1240          PVX_UTILITY_PVT.Error_Message(p_message_name => 'PV_API_RESOURCE_LOCKED');
1241 
1242    WHEN FND_API.G_EXC_ERROR THEN
1243      ROLLBACK TO VALIDATE_Ge_Party_Notif_;
1244      x_return_status := FND_API.G_RET_STS_ERROR;
1245      -- Standard call to get message count and if count=1, get the message
1246      FND_MSG_PUB.Count_And_Get (
1247             p_encoded => FND_API.G_FALSE,
1248             p_count   => x_msg_count,
1249             p_data    => x_msg_data
1250      );
1251 
1252    WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1253      ROLLBACK TO VALIDATE_Ge_Party_Notif_;
1254      x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1255      -- Standard call to get message count and if count=1, get the message
1256      FND_MSG_PUB.Count_And_Get (
1257             p_encoded => FND_API.G_FALSE,
1258             p_count => x_msg_count,
1259             p_data  => x_msg_data
1260      );
1261 
1262    WHEN OTHERS THEN
1263      ROLLBACK TO VALIDATE_Ge_Party_Notif_;
1264      x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1265      IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1266      THEN
1267         FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1268      END IF;
1269      -- Standard call to get message count and if count=1, get the message
1270      FND_MSG_PUB.Count_And_Get (
1271             p_encoded => FND_API.G_FALSE,
1272             p_count => x_msg_count,
1273             p_data  => x_msg_data
1274      );
1275 End Validate_Ge_Party_Notif;
1276 
1277 
1278 PROCEDURE Validate_Pgp_Notif_Rec (
1279     p_api_version_number         IN   NUMBER,
1280     p_init_msg_list              IN   VARCHAR2     := FND_API.G_FALSE,
1281     x_return_status              OUT NOCOPY  VARCHAR2,
1282     x_msg_count                  OUT NOCOPY  NUMBER,
1283     x_msg_data                   OUT NOCOPY  VARCHAR2,
1284     p_pgp_notif_rec               IN    pgp_notif_rec_type
1285     )
1286 IS
1287 BEGIN
1288       -- Initialize message list if p_init_msg_list is set to TRUE.
1289       IF FND_API.to_Boolean( p_init_msg_list )
1290       THEN
1291          FND_MSG_PUB.initialize;
1292       END IF;
1293 
1294 
1295 
1296       -- Initialize API return status to SUCCESS
1297       x_return_status := FND_API.G_RET_STS_SUCCESS;
1298 
1299       -- Hint: Validate data
1300       -- If data not valid
1301       -- THEN
1302       -- x_return_status := FND_API.G_RET_STS_ERROR;
1303 
1304       -- Debug Message
1305       IF (PV_DEBUG_HIGH_ON) THEN
1306 
1307       PVX_UTILITY_PVT.debug_message('Private API: Validate_dm_model_rec');
1308       END IF;
1309       -- Standard call to get message count and if count is 1, get message info.
1310       FND_MSG_PUB.Count_And_Get
1311         (p_count          =>   x_msg_count,
1312          p_data           =>   x_msg_data
1313       );
1314 END Validate_pgp_notif_Rec;
1315 
1316 END PV_Ge_Party_Notif_PVT;