DBA Data[Home] [Help]

PACKAGE BODY: APPS.JTF_TASK_DATES_PUB

Source


1 PACKAGE BODY jtf_task_dates_pub AS
2 /* $Header: jtfptkdb.pls 115.20 2002/12/06 01:21:45 sachoudh ship $ */
3     g_pkg_name    VARCHAR2(30) := 'CREATE_DATES_PUB';
4 
5     PROCEDURE create_task_dates (
6         p_api_version             IN       NUMBER,
7         p_init_msg_list           IN       VARCHAR2 DEFAULT fnd_api.g_false,
8         p_commit                  IN       VARCHAR2 DEFAULT fnd_api.g_false,
9         p_task_number             IN       VARCHAR2 DEFAULT NULL,
10         p_task_id                 IN       VARCHAR2 DEFAULT NULL,
11         p_date_type_id            IN       VARCHAR2 DEFAULT NULL,
12         p_date_type_name          IN       VARCHAR2 DEFAULT NULL,
13         p_date_value              IN       DATE,
14         x_return_status           OUT NOCOPY      VARCHAR2,
15         x_msg_count               OUT NOCOPY      NUMBER,
16         x_msg_data                OUT NOCOPY      VARCHAR2,
17         x_task_date_id            OUT NOCOPY      NUMBER,
18         p_attribute1              IN       VARCHAR2 DEFAULT null ,
19         p_attribute2              IN       VARCHAR2 DEFAULT null ,
20         p_attribute3              IN       VARCHAR2 DEFAULT null ,
21         p_attribute4              IN       VARCHAR2 DEFAULT null ,
22         p_attribute5              IN       VARCHAR2 DEFAULT null ,
23         p_attribute6              IN       VARCHAR2 DEFAULT null ,
24         p_attribute7              IN       VARCHAR2 DEFAULT null ,
25         p_attribute8              IN       VARCHAR2 DEFAULT null ,
26         p_attribute9              IN       VARCHAR2 DEFAULT null ,
27         p_attribute10             IN       VARCHAR2 DEFAULT null ,
28         p_attribute11             IN       VARCHAR2 DEFAULT null ,
29         p_attribute12             IN       VARCHAR2 DEFAULT null ,
30         p_attribute13             IN       VARCHAR2 DEFAULT null ,
31         p_attribute14             IN       VARCHAR2 DEFAULT null ,
32         p_attribute15             IN       VARCHAR2 DEFAULT null ,
33         p_attribute_category      IN       VARCHAR2 DEFAULT null
34     )
35     IS
36         l_api_version    CONSTANT NUMBER                                  := 1.0;
37         l_api_name       CONSTANT VARCHAR2(30)                            := 'CREATE_TASK_DATES';
38         l_task_id                 jtf_tasks_b.task_id%TYPE                := p_task_id;
39         l_task_number             jtf_tasks_b.task_number%TYPE            := p_task_number;
40         l_date_type_id            jtf_task_date_types_b.date_type_id%TYPE := p_date_type_id;
41         l_date_type_name          jtf_task_date_types_tl.date_type%TYPE   := p_date_type_name;
42         l_task_date_id            jtf_task_dates.task_date_id%TYPE;
43         l_rowid                   ROWID;
44 
45         CURSOR c_jtf_task_dates (
46             l_rowid                   IN       ROWID
47         )
48         IS
49             SELECT 1
50               FROM jtf_task_dates
51              WHERE ROWID = l_rowid;
52 
53         x                         CHAR;
54     BEGIN
55         SAVEPOINT create_task_dates_pub;
56 
57         x_return_status := fnd_api.g_ret_sts_success;
58 
59         IF NOT fnd_api.compatible_api_call (l_api_version, p_api_version, l_api_name, g_pkg_name)
60         THEN
61             RAISE fnd_api.g_exc_unexpected_error;
62         END IF;
63 
64         IF fnd_api.to_boolean (p_init_msg_list)
65         THEN
66             fnd_msg_pub.initialize;
67         END IF;
68 
69         jtf_task_utl.validate_task (
70             x_return_status => x_return_status,
71             p_task_id => l_task_id,
72             p_task_number => l_task_number,
73             x_task_id => l_task_id
74         );
75 
76         IF NOT (x_return_status = fnd_api.g_ret_sts_success)
77         THEN
78             x_return_status := fnd_api.g_ret_sts_unexp_error;
79             RAISE fnd_api.g_exc_unexpected_error;
80         END IF;
81 
82         IF l_task_id IS NULL
83         THEN
84             fnd_message.set_name ('JTF', 'JTF_TASK_MISSING_TASK');
85             fnd_msg_pub.add;
86             x_return_status := fnd_api.g_ret_sts_unexp_error;
87             RAISE fnd_api.g_exc_unexpected_error;
88         END IF;
89 
90         jtf_task_utl.validate_date_types (
91             p_date_type_id => l_date_type_id,
92             p_date_type => l_date_type_name,
93             x_return_status => x_return_status,
94             x_date_type_id => l_date_type_id
95         );
96 
97         IF (x_return_status = fnd_api.g_ret_sts_unexp_error)
98         THEN
99             fnd_message.set_name ('JTF', 'JTF_TASK_INVALID_DATE_TYPE_ID');
100             fnd_message.set_token('P_DATE_TYPE_ID' , p_date_type_id );
101             fnd_msg_pub.add;
102             RAISE fnd_api.g_exc_unexpected_error;
103         END IF;
104 
105         IF l_date_type_id IS NULL
106         THEN
107             fnd_message.set_name ('JTF', 'JTF_TASK_MISSING_DATE_TYPE_ID');
108             fnd_msg_pub.add;
109             RAISE fnd_api.g_exc_unexpected_error;
110         END IF;
111 
112         IF p_date_value IS NULL
113         THEN
114             fnd_message.set_name ('JTF', 'JTF_TASK_MISSING_DATES');
115             fnd_msg_pub.add;
116             RAISE fnd_api.g_exc_unexpected_error;
117         END IF;
118 
119         jtf_task_dates_pvt.create_task_dates (
120             p_api_version => 1.0,
121             p_init_msg_list => fnd_api.g_false,
122             p_commit => fnd_api.g_false,
123             p_task_id => l_task_id,
124             p_date_type_id => l_date_type_id,
125             p_date_value => p_date_value,
126             x_return_status => x_return_status,
127             x_msg_count => x_msg_count,
128             x_msg_data => x_msg_data,
129             x_task_date_id => x_task_date_id,
130             p_attribute1 => p_attribute1 ,
131             p_attribute2 => p_attribute2 ,
132             p_attribute3 => p_attribute3 ,
133             p_attribute4 => p_attribute4 ,
134             p_attribute5 => p_attribute5 ,
135             p_attribute6 => p_attribute6 ,
136             p_attribute7 => p_attribute7 ,
137             p_attribute8 => p_attribute8 ,
138             p_attribute9 => p_attribute9 ,
139             p_attribute10 => p_attribute10 ,
140             p_attribute11 => p_attribute11 ,
141             p_attribute12 => p_attribute12 ,
142             p_attribute13 => p_attribute13 ,
143             p_attribute14 => p_attribute14 ,
144             p_attribute15 => p_attribute15,
145             p_attribute_category => p_attribute_category
146         );
147 
148         IF fnd_api.to_boolean (p_commit)
149         THEN
150             COMMIT WORK;
151         END IF;
152 
153         fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
154 
155     EXCEPTION
156         WHEN fnd_api.g_exc_unexpected_error
157         THEN
158             ROLLBACK TO create_task_dates_pub ;
159             x_return_status := fnd_api.g_ret_sts_unexp_error;
160             fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
161         WHEN OTHERS
162         THEN
163             ROLLBACK TO create_task_dates_pub ;
164             fnd_message.set_name ('JTF', 'JTF_TASK_UNKNOWN_ERROR');
165             fnd_message.set_token ('P_TEXT', SQLCODE || SQLERRM);
166             x_return_status := fnd_api.g_ret_sts_unexp_error;
167             fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
168     END;
169 
170    PROCEDURE lock_task_dates (
171       p_api_version       IN       NUMBER,
172       p_init_msg_list     IN       VARCHAR2 DEFAULT fnd_api.g_false,
173       p_commit            IN       VARCHAR2 DEFAULT fnd_api.g_false,
174       p_task_date_id      IN       NUMBER,
175       p_object_version_number IN   NUMBER,
176       x_return_status     OUT NOCOPY      VARCHAR2,
177       x_msg_data          OUT NOCOPY      VARCHAR2,
178       x_msg_count         OUT NOCOPY      NUMBER
179    ) is
180         l_api_version    CONSTANT NUMBER                                 := 1.0;
181         l_api_name       CONSTANT VARCHAR2(30)                           := 'LOCK_TASK_DATES';
182 
183         Resource_Locked exception ;
184 
185         PRAGMA EXCEPTION_INIT ( Resource_Locked , - 54 ) ;
186 
187    begin
188         SAVEPOINT lock_task_dates_pub;
189 
190         x_return_status := fnd_api.g_ret_sts_success;
191 
192         IF NOT fnd_api.compatible_api_call (l_api_version, p_api_version, l_api_name, g_pkg_name)
193         THEN
194             RAISE fnd_api.g_exc_unexpected_error;
195         END IF;
196 
197         IF fnd_api.to_boolean (p_init_msg_list)
198         THEN
199             fnd_msg_pub.initialize;
200         END IF;
201 
202         x_return_status := fnd_api.g_ret_sts_success;
203 
204         jtf_task_dates_pkg.lock_row(
205             x_task_date_id => p_task_date_id ,
206             x_object_version_number => p_object_version_number  );
207 
208 
209         fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
210 
211     EXCEPTION
212        WHEN Resource_Locked then
213             ROLLBACK TO lock_task_dates_pub;
214             fnd_message.set_name ('JTF', 'JTF_TASK_RESOURCE_LOCKED');
215             fnd_message.set_token ('P_LOCKED_RESOURCE', 'Contacts');
216             x_return_status := fnd_api.g_ret_sts_unexp_error;
217             fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
218 
219         WHEN fnd_api.g_exc_unexpected_error
220         THEN
221             ROLLBACK TO lock_task_dates_pub;
222             x_return_status := fnd_api.g_ret_sts_unexp_error;
223             fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
224         WHEN OTHERS
225         THEN
226             ROLLBACK TO lock_task_dates_pub;
227             fnd_message.set_name ('JTF', 'JTF_TASK_UNKNOWN_ERROR');
228             fnd_message.set_token ('P_TEXT', SQLCODE || SQLERRM);
229             x_return_status := fnd_api.g_ret_sts_unexp_error;
230             fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
231     END;
232 
233     PROCEDURE update_task_dates (
234         p_api_version             IN       NUMBER,
235         p_init_msg_list           IN       VARCHAR2 DEFAULT fnd_api.g_false,
236         p_commit                  IN       VARCHAR2 DEFAULT fnd_api.g_false,
237       p_object_version_number   IN     OUT NOCOPY NUMBER ,
238         p_task_date_id            IN       NUMBER,
239         p_date_type_name          IN       VARCHAR2 DEFAULT fnd_api.g_miss_char,
240         p_date_type_id            IN       NUMBER DEFAULT fnd_api.g_miss_num,
241         p_date_value              IN       DATE DEFAULT fnd_api.g_miss_date,
242         x_return_status           OUT NOCOPY      VARCHAR2,
243         x_msg_count               OUT NOCOPY      NUMBER,
244         x_msg_data                OUT NOCOPY      VARCHAR2,
245         p_attribute1              IN       VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
246         p_attribute2              IN       VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
247         p_attribute3              IN       VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
248         p_attribute4              IN       VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
249         p_attribute5              IN       VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
250         p_attribute6              IN       VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
251         p_attribute7              IN       VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
252         p_attribute8              IN       VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
253         p_attribute9              IN       VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
254         p_attribute10             IN       VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
255         p_attribute11             IN       VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
256         p_attribute12             IN       VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
257         p_attribute13             IN       VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
258         p_attribute14             IN       VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
259         p_attribute15             IN       VARCHAR2 DEFAULT jtf_task_utl.g_miss_char,
260         p_attribute_category      IN       VARCHAR2 DEFAULT jtf_task_utl.g_miss_char
261     )
262     IS
263         l_api_version    CONSTANT NUMBER                                  := 1.0;
264         l_api_name       CONSTANT VARCHAR2(30)                            := 'UPDATE_TASK_DATES';
265         l_task_id                 jtf_tasks_b.task_id%TYPE                ;
266         l_date_type_id            jtf_task_date_types_b.date_type_id%TYPE := p_date_type_id;
267         l_date_type_name          jtf_task_date_types_tl.date_type%TYPE   := p_date_type_name;
268         l_date_value              jtf_task_dates.date_value%TYPE          := p_date_value;
269         l_task_date_id            jtf_task_dates.task_date_id%TYPE        := p_task_date_id;
270 
271         CURSOR c_update_task_dates
272         IS
273             SELECT task_id,
274                    DECODE (p_date_type_id, fnd_api.g_miss_num, date_type_id, p_date_type_id) date_type_id,
275                    DECODE (p_date_value, fnd_api.g_miss_date, date_value, p_date_value) date_value,
276 decode( p_attribute1 , fnd_api.g_miss_char , attribute1 , p_attribute1 )  attribute1  ,
277 decode( p_attribute2 , fnd_api.g_miss_char , attribute2 , p_attribute2 )  attribute2  ,
278 decode( p_attribute3 , fnd_api.g_miss_char , attribute3 , p_attribute3 )  attribute3  ,
279 decode( p_attribute4 , fnd_api.g_miss_char , attribute4 , p_attribute4 )  attribute4  ,
280 decode( p_attribute5 , fnd_api.g_miss_char , attribute5 , p_attribute5 )  attribute5  ,
281 decode( p_attribute6 , fnd_api.g_miss_char , attribute6 , p_attribute6 )  attribute6  ,
282 decode( p_attribute7 , fnd_api.g_miss_char , attribute7 , p_attribute7 )  attribute7  ,
283 decode( p_attribute8 , fnd_api.g_miss_char , attribute8 , p_attribute8 )  attribute8  ,
284 decode( p_attribute9 , fnd_api.g_miss_char , attribute9 , p_attribute9 )  attribute9  ,
285 decode( p_attribute10 , fnd_api.g_miss_char , attribute10 , p_attribute10 )  attribute10  ,
286 decode( p_attribute11 , fnd_api.g_miss_char , attribute11 , p_attribute11 )  attribute11  ,
287 decode( p_attribute12 , fnd_api.g_miss_char , attribute12 , p_attribute12 )  attribute12  ,
288 decode( p_attribute13 , fnd_api.g_miss_char , attribute13 , p_attribute13 )  attribute13  ,
289 decode( p_attribute14 , fnd_api.g_miss_char , attribute14 , p_attribute14 )  attribute14  ,
290 decode( p_attribute15 , fnd_api.g_miss_char , attribute15 , p_attribute15 )  attribute15 ,
291 decode( p_attribute_category,fnd_api.g_miss_char,attribute_category,p_attribute_category) attribute_category
292               FROM jtf_task_dates
293              WHERE task_date_id = p_task_date_id;
294 
295         task_dates                c_update_task_dates%ROWTYPE;
296     BEGIN
297 
298         SAVEPOINT update_task_dates_pub;
299 
300         IF NOT fnd_api.compatible_api_call (l_api_version, p_api_version, l_api_name, g_pkg_name)
301         THEN
302             RAISE fnd_api.g_exc_unexpected_error;
303         END IF;
304 
305         IF fnd_api.to_boolean (p_init_msg_list)
306         THEN
307             fnd_msg_pub.initialize;
308         END IF;
309 
310 
311         x_return_status := fnd_api.g_ret_sts_success;
312 
313         OPEN c_update_task_dates;
314         FETCH c_update_task_dates INTO task_dates;
315 
316         IF c_update_task_dates%NOTFOUND
317         THEN
318             fnd_message.set_name ('JTF', 'JTF_TASK_INVALID_DATE');
319             fnd_message.set_token('P_TASK_DATE_ID',P_TASK_DATE_ID);
320             fnd_msg_pub.add;
321             x_return_status := fnd_api.g_ret_sts_unexp_error;
322             RAISE fnd_api.g_exc_unexpected_error;
323         END IF;
324 
325         CLOSE c_update_task_dates;
326 
327 
328         -------
329         -------  Validate the Task Date type
330         -------
331         IF (  p_date_type_id <> fnd_api.g_miss_num
332            OR p_date_type_name <> fnd_api.g_miss_char)
333         THEN
334             SELECT DECODE (p_date_type_id, fnd_api.g_miss_num, NULL, p_date_type_id)
335               INTO l_date_type_id
336               FROM dual;
337             SELECT DECODE (p_date_type_name, fnd_api.g_miss_char, NULL, p_date_type_name)
338               INTO l_date_type_name
339               FROM dual;
340 
341             jtf_task_utl.validate_date_types (
342                 p_date_type_id => l_date_type_id,
343                 p_date_type => l_date_type_name,
344                 x_return_status => x_return_status,
345                 x_date_type_id => l_date_type_id
346             );
347 
348             IF NOT (x_return_status = fnd_api.g_ret_sts_success)
349             THEN
350                 x_return_status := fnd_api.g_ret_sts_unexp_error;
351                 RAISE fnd_api.g_exc_unexpected_error;
352             END IF;
353 
354             IF l_date_type_id IS NULL
355             THEN
356                 x_return_status := fnd_api.g_ret_sts_unexp_error;
357                 fnd_message.set_name ('JTF', 'JTF_TASK_MISSING_DATE_TYPE_ID');
358                 fnd_msg_pub.add;
359                 RAISE fnd_api.g_exc_unexpected_error;
360             END IF;
361         ELSE
362             l_date_type_id := task_dates.date_type_id;
363         END IF;
364 
365 
366         -------
367         -------  validate the date value
368         -------
369         l_date_value := task_dates.date_value;
370 
371         IF l_date_value IS NULL
372         THEN
373             x_return_status := fnd_api.g_ret_sts_unexp_error;
374             fnd_message.set_name ('JTF', 'JTF_TASK_MISSING_DATES');
375             fnd_msg_pub.add;
376             RAISE fnd_api.g_exc_unexpected_error;
377         END IF;
378 
379         l_task_id := task_dates.task_id ;
380 
381 
382         jtf_task_dates_pub.lock_task_dates
383         ( P_API_VERSION                 =>	1.0 ,
384          P_INIT_MSG_LIST                =>	fnd_api.g_false ,
385          P_COMMIT                       =>	fnd_api.g_false ,
386          P_TASK_date_ID              =>	l_task_date_id ,
387          P_OBJECT_VERSION_NUMBER        =>	p_object_version_number,
388          X_RETURN_STATUS                =>	x_return_status ,
389          X_MSG_DATA                     =>	x_msg_data ,
390          X_MSG_COUNT                    =>	x_msg_count ) ;
391 
392         IF NOT (x_return_status = fnd_api.g_ret_sts_success)
393         THEN
394             x_return_status := fnd_api.g_ret_sts_unexp_error;
395             RAISE fnd_api.g_exc_unexpected_error;
396         END IF;
397 
398         jtf_task_dates_pvt.update_task_dates (
399             p_api_version => 1.0,
400             p_init_msg_list => fnd_api.g_false,
401             p_commit => fnd_api.g_false,
402             p_object_version_number => p_object_version_number ,
403             p_task_date_id => l_task_date_id,
404             p_date_type_id => l_date_type_id,
405             p_date_value => l_date_value,
406             x_return_status => x_return_status,
407             x_msg_count => x_msg_count,
408             x_msg_data => x_msg_data,
409             p_attribute1 => task_dates.attribute1 ,
410             p_attribute2 => task_dates.attribute2 ,
411             p_attribute3 => task_dates.attribute3 ,
412             p_attribute4 => task_dates.attribute4 ,
413             p_attribute5 => task_dates.attribute5 ,
414             p_attribute6 => task_dates.attribute6 ,
415             p_attribute7 => task_dates.attribute7 ,
416             p_attribute8 => task_dates.attribute8 ,
417             p_attribute9 => task_dates.attribute9 ,
418             p_attribute10 => task_dates.attribute10 ,
419             p_attribute11 => task_dates.attribute11 ,
420             p_attribute12 => task_dates.attribute12 ,
421             p_attribute13 => task_dates.attribute13 ,
422             p_attribute14 => task_dates.attribute14 ,
423             p_attribute15 => task_dates.attribute15 ,
424             p_attribute_category => task_dates.attribute_category
425         );
426 
427         IF NOT (x_return_status = fnd_api.g_ret_sts_success)
428         THEN
429             x_return_status := fnd_api.g_ret_sts_unexp_error;
430             RAISE fnd_api.g_exc_unexpected_error;
431         END IF;
432 
433         IF fnd_api.to_boolean (p_commit)
434         THEN
435             COMMIT WORK;
436         END IF;
437 
438         fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
439     EXCEPTION
440         WHEN fnd_api.g_exc_unexpected_error
441         THEN
442             rollback to update_task_dates_pub;
443             x_return_status := fnd_api.g_ret_sts_unexp_error;
444             fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
445         WHEN OTHERS
446         THEN
447             rollback to update_task_dates_pub;
448             fnd_message.set_name ('JTF', 'JTF_TASK_UNKNOWN_ERROR');
449             fnd_message.set_token ('P_TEXT', SQLCODE || SQLERRM);
450             x_return_status := fnd_api.g_ret_sts_unexp_error;
451             fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
452     END;
453 
454     PROCEDURE delete_task_dates (
455         p_api_version             IN       NUMBER,
456         p_init_msg_list           IN       VARCHAR2 DEFAULT fnd_api.g_false,
457         p_commit                  IN       VARCHAR2 DEFAULT fnd_api.g_false,
458       p_object_version_number   IN     NUMBER ,
459         p_task_date_id            IN       NUMBER DEFAULT NULL,
460         x_return_status           OUT NOCOPY      VARCHAR2,
461         x_msg_data                OUT NOCOPY      VARCHAR2,
462         x_msg_count               OUT NOCOPY      NUMBER
463     )
464     IS
465         l_api_version    CONSTANT NUMBER       := 1.0;
466         l_api_name       CONSTANT VARCHAR2(30) := 'DELETE_TASK_date';
467     BEGIN
468         SAVEPOINT delete_task_date_pub;
469 
470         x_return_status := fnd_api.g_ret_sts_success;
471 
472         IF NOT fnd_api.compatible_api_call (l_api_version, p_api_version, l_api_name, g_pkg_name)
473         THEN
474             RAISE fnd_api.g_exc_unexpected_error;
475         END IF;
476 
477         IF fnd_api.to_boolean (p_init_msg_list)
478         THEN
479             fnd_msg_pub.initialize;
480         END IF;
481 
482         jtf_task_dates_pub.lock_task_dates
483         ( P_API_VERSION                 =>	1.0 ,
484          P_INIT_MSG_LIST                =>	fnd_api.g_false ,
485          P_COMMIT                       =>	fnd_api.g_false ,
486          P_TASK_date_ID              =>	    p_task_date_id ,
487          P_OBJECT_VERSION_NUMBER        =>	p_object_version_number,
488          X_RETURN_STATUS                =>	x_return_status ,
489          X_MSG_DATA                     =>	x_msg_data ,
490          X_MSG_COUNT                    =>	x_msg_count ) ;
491 
492         IF NOT (x_return_status = fnd_api.g_ret_sts_success)
493         THEN
494             x_return_status := fnd_api.g_ret_sts_unexp_error;
495             RAISE fnd_api.g_exc_unexpected_error;
496         END IF;
497 
498         jtf_task_dates_pvt.delete_task_dates (
499             p_api_version => 1.0,
500             p_init_msg_list => fnd_api.g_false,
501             p_commit => fnd_api.g_false,
502             p_object_version_number => p_object_version_number,
503             p_task_date_id => p_task_date_id,
504             x_return_status => x_return_status,
505             x_msg_data => x_msg_data,
506             x_msg_count => x_msg_count
507         );
508 
509         IF NOT (x_return_status = fnd_api.g_ret_sts_success)
510         THEN
511             RAISE fnd_api.g_exc_unexpected_error;
512         END IF;
513 
514         IF fnd_api.to_boolean (p_commit)
515         THEN
516             COMMIT WORK;
517         END IF;
518 
519         fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
520     EXCEPTION
521         WHEN fnd_api.g_exc_unexpected_error
522         THEN
523             ROLLBACK TO delete_task_date_pub;
524             x_return_status := fnd_api.g_ret_sts_unexp_error;
525             fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
526         WHEN OTHERS
527         THEN
528             ROLLBACK TO delete_task_date_pub;
529             fnd_message.set_name ('JTF', 'JTF_TASK_UNKNOWN_ERROR');
530             fnd_message.set_token ('P_TEXT', SQLCODE || SQLERRM);
531             x_return_status := fnd_api.g_ret_sts_unexp_error;
532             fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
533     END;   -- Delete Task Dates
534 END;