DBA Data[Home] [Help]

PACKAGE BODY: APPS.JTF_ASSIGN_CUHK

Source


1 PACKAGE BODY JTF_ASSIGN_CUHK AS
2 /* $Header: jtfamwfb.pls 120.2 2005/10/21 03:59:02 sbarat ship $ */
3 
4 
5 -- ********************************************************************************
6 
7 -- Start of Comments
8 
9 --     	Package Name	: JTF_ASSIGN_CUHK
10 --	Purpose		: Joint Task Force Core Foundation Assignment Manager
11 --                        API for Workflow execution.
12 --	Procedures	: (See below for specification)
13 --	Notes		: This package is publicly available for use
14 --	History		: 01/04/00 ** VVUYYURU ** Vijay Vuyyuru ** created
15 --                        21/10/05 Added NOCOPY by SBARAT to fix GSCC error
16 --
17 
18 -- End of Comments
19 
20 -- *******************************************************************************
21 
22 -- Start of comments
23 
24 --	API name 	: OK_TO_LAUNCH_WORKFLOW
25 --	Type		:
26 --	Function	: Determines if it is OK to launch the workflow.
27 --	Pre-reqs	: None
28 
29 --	Parameters	:
30 
31 --	IN		: p_api_version   	IN 	NUMBER	Required
32 --			  p_init_msg_list 	IN 	VARCHAR2 Optional
33 --					      	DEFAULT = FND_API.G_FALSE
34 --                        p_commit              IN      VARCHAR2 optional
35 --					      	DEFAULT = FND_API.G_FALSE
36 
37 --     OUT		: x_return_status        OUT     VARCHAR2(1)
38 --			  x_msg_count            OUT     NUMBER
39 --			  x_msg_data             OUT     VARCHAR2(2000)
40 
41 
42 --	Version		: Current version	 1.0
43 --			  Initial version 	 1.0
44 --
45 --	Notes		:
46 --
47 
48 -- End of comments
49 
50 -- *********************************************************************************
51 
52 
53   FUNCTION OK_TO_LAUNCH_WORKFLOW
54     (   p_api_version                         IN  NUMBER,
55         p_init_msg_list                       IN  VARCHAR2 DEFAULT FND_API.G_FALSE,
56         x_return_status                       OUT NOCOPY VARCHAR2,
57         x_msg_count                           OUT NOCOPY NUMBER,
58         x_msg_data                            OUT NOCOPY VARCHAR2
59     ) RETURN BOOLEAN IS
60 
61     l_api_name                                VARCHAR2(30)  := 'OK_TO_LAUNCH_WORKFLOW';
62     l_api_version                             NUMBER        := 1.0;
63 
64   BEGIN
65 
66     SAVEPOINT jtf_assign_wf;
67 
68 
69     /* Standard call to check for call compatibility */
70 
71     IF NOT fnd_api.compatible_api_call (l_api_version,
72                                         p_api_version,
73                                         l_api_name,
74                                         g_pkg_name) THEN
75       RAISE fnd_api.g_exc_unexpected_error;
76     END IF;
77 
78 
79     /* Initialize message list if p_init_msg_list is set to TRUE */
80 
81     IF fnd_api.to_boolean (p_init_msg_list) THEN
82       fnd_msg_pub.initialize;
83     END IF;
84 
85 
86 
87 
88     /* Standard call to get message count and
89        the message information */
90 
91     FND_MSG_PUB.Count_And_Get
92     (
93       p_count => x_msg_count,
94       p_data  => x_msg_data
95     );
96 
97 
98     x_return_status := fnd_api.g_ret_sts_success;
99 
100 
101     RETURN (TRUE);
102 
103 
104   EXCEPTION
105     WHEN FND_API.G_EXC_ERROR THEN
106       ROLLBACK TO jtf_assign_wf;
107       x_return_status := FND_API.G_RET_STS_ERROR ;
108       FND_MSG_PUB.Count_And_Get
109       (
110         p_count => x_msg_count,
111         p_data  => x_msg_data
112       );
113     RETURN (FALSE);
114 
115     WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
116       ROLLBACK TO jtf_assign_wf;
117       x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
118       FND_MSG_PUB.Count_And_Get
119       (
120         p_count => x_msg_count,
121         p_data  => x_msg_data
122       );
123     RETURN (FALSE);
124 
125     WHEN OTHERS THEN
126       ROLLBACK TO jtf_assign_wf;
127       x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
128       IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )THEN
129         FND_MSG_PUB.Add_Exc_Msg
130         (
131           G_PKG_NAME,
132           l_api_name
133         );
134       END IF;
135 
136       FND_MSG_PUB.Count_And_Get
137       (
138         p_count => x_msg_count,
139         p_data  => x_msg_data
140        );
141     RETURN (FALSE);
142 
143   END OK_TO_LAUNCH_WORKFLOW;
144 
145 
146 END JTF_ASSIGN_CUHK;
147