DBA Data[Home] [Help]

PACKAGE: APPS.AMW_CONSTRAINT_PVT

Source


1 PACKAGE AMW_CONSTRAINT_PVT AS
2 /* $Header: amwvcsts.pls 120.9.12010000.1 2008/07/28 08:35:47 appldev ship $ */
3 
4 -- ===============================================================
5 -- Package name
6 --          AMW_CONSTRAINT_PVT
7 -- Purpose
8 --
9 -- History
10 -- 		  	10/27/2003    tsho     Creates
11 --          05/05/2004    tsho     add Get_Functions and related getters
12 --          05/13/2005    tsho     introduce Cocurrent Program, Incomapatible Sets, Revalidation, (Role, GLOBAL Grant/USER Grant) in AMW.E
13 --          12/01/2005    tsho     add Purge_Violation_Before_Date (for bug 4673154)
14 -- ===============================================================
15 
16 -- FND_API global constant
17 G_FALSE    		  		   CONSTANT VARCHAR2(1) := FND_API.G_FALSE;
18 G_TRUE 					   CONSTANT VARCHAR2(1) := FND_API.G_TRUE;
19 G_VALID_LEVEL_FULL 		   CONSTANT NUMBER 		:= FND_API.G_VALID_LEVEL_FULL;
20 G_RET_STS_SUCCESS 		   CONSTANT VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
21 G_RET_STS_ERROR			   CONSTANT VARCHAR2(1) := FND_API.G_RET_STS_ERROR;
22 G_RET_STS_UNEXP_ERROR 	   CONSTANT VARCHAR2(1) := FND_API.G_RET_STS_UNEXP_ERROR;
23 
24 -- FND_GLOBAL
25 G_USER_ID         	 				NUMBER 		:= FND_GLOBAL.USER_ID;
26 G_PARTY_ID         	 				NUMBER 		:= NULL;
27 G_LOGIN_ID        	 				NUMBER 		:= FND_GLOBAL.CONC_LOGIN_ID;
28 G_SECURITY_GROUP_ID                 NUMBER      := FND_GLOBAL.SECURITY_GROUP_ID;
29 
30 -- AMW table/view name
31 G_AMW_USER                 CONSTANT VARCHAR2(240) := FND_PROFILE.VALUE('AMW_USER');
32 G_AMW_USER_RESP_GROUPS     CONSTANT VARCHAR2(240) := FND_PROFILE.VALUE('AMW_USER_RESP_GROUPS');
33 G_AMW_RESPONSIBILITY       CONSTANT VARCHAR2(240) := FND_PROFILE.VALUE('AMW_RESPONSIBILITY');
34 G_AMW_RESP_FUNCTIONS       CONSTANT VARCHAR2(240) := FND_PROFILE.VALUE('AMW_RESP_FUNCTIONS');
35 G_AMW_MENUS                CONSTANT VARCHAR2(240) := FND_PROFILE.VALUE('AMW_MENUS');
36 G_AMW_MENU_ENTRIES         CONSTANT VARCHAR2(240) := FND_PROFILE.VALUE('AMW_MENU_ENTRIES');
37 G_AMW_FORM_FUNCTIONS_VL    CONSTANT VARCHAR2(240) := FND_PROFILE.VALUE('AMW_FORM_FUNCTIONS_VL');
38 G_AMW_COMPILED_MENU_FUNCTIONS    CONSTANT VARCHAR2(240) := FND_PROFILE.VALUE('AMW_COMPILED_MENU_FUNCTIONS');
39 G_AMW_GRANTS               CONSTANT VARCHAR2(240) := FND_PROFILE.VALUE('AMW_GRANTS');
40 G_AMW_USER_ROLES           CONSTANT VARCHAR2(240) := FND_PROFILE.VALUE('AMW_USER_ROLES');
41 G_AMW_USER_ROLE_ASSIGNMENTS     CONSTANT VARCHAR2(240) := FND_PROFILE.VALUE('AMW_USER_ROLE_ASSIGNMENTS');
42 G_AMW_REQUEST_GROUP_UNITS  CONSTANT VARCHAR2(240) := FND_PROFILE.VALUE('AMW_REQUEST_GROUP_UNITS');
43 G_AMW_CONCURRENT_PROGRAMS_VL    CONSTANT VARCHAR2(240) := FND_PROFILE.VALUE('AMW_CONCURRENT_PROGRAMS_VL');
44 
45 
46 -- AMW constraint
47 G_OBJ_TYPE				   CONSTANT	VARCHAR2(80)	:= 'Constraint';
48 
49 
50 -- AMW Users :store AWM Employees having corresponding user_id in g_amw_user
51 TYPE UserIdList IS TABLE OF NUMBER;
52 G_USER_ID_LIST UserIdList   := NULL;
53 
54 
55 -- ===============================================================
56 -- Function name
57 --          Get_Party_Id
58 --
59 -- Purpose
60 --          get the party_id by specified user_id
61 --
62 -- Params
63 --          p_user_id   := specified user_id
64 --
65 -- ===============================================================
66 Function Get_Party_Id (
67     p_user_id   IN  NUMBER
68 )
69 Return  NUMBER;
70 
71 
72 -- ===============================================================
73 -- Procedure name
74 --          Populate_User_Id_List
75 --
76 -- Purpose
77 --          populate the global user id list
78 --
79 -- ===============================================================
80 Procedure Populate_User_Id_List;
81 
82 
83 
84 -- ===============================================================
85 -- Procedure name
86 --          Check_Violation
87 --
88 -- Purpose
89 --          to check violations for constraint
90 --
91 -- Params
92 --          p_check_all_constraint_flag := 'Y' or 'N' (default to 'N')
93 --          p_constraint_set
94 --          p_constraint_rev_id1
95 --          p_constraint_rev_id2
96 --          p_constraint_rev_id3
97 --          p_constraint_rev_id4
98 --
99 -- Notes
100 --          If 'Y' is passed-in as p_check_all_constraint_flag,
101 --          will run violation check for
102 --          every valid constraint
103 --          (valid means the current time is between constraint's START_DATE and END_DATE)
104 --          and ignore the passed-in p_constraint_rev_id.
105 --
106 --
107 --          If 'N' is passed-in as p_check_all_constraint_flag,
108 --          then check the passed-in p_constraint_rev_id
109 --          currently only support up to four specified constraints
110 --          p_constraint_rev_id1....p_constraint_rev_id4
111 --
112 --          12.21.2004 tsho: fix for performance bug 4036679
113 -- ===============================================================
114 PROCEDURE Check_Violation(
115     errbuf                       OUT  NOCOPY VARCHAR2,
116     retcode                      OUT  NOCOPY VARCHAR2,
117     p_check_all_constraint_flag  IN   VARCHAR2      := 'N',
118     p_constraint_set             IN   VARCHAR2      := NULL,
119     p_constraint_rev_id1         IN   NUMBER        := NULL,
120     p_constraint_rev_id2         IN   NUMBER        := NULL,
121     p_constraint_rev_id3         IN   NUMBER        := NULL,
122     p_constraint_rev_id4         IN   NUMBER        := NULL
123     );
124 
125 
126 -- ===============================================================
127 -- Function name
128 --          Get_Resps_By_Appl
129 --
130 -- Purpose
131 --          get the responsibility by specified applicaiton_id,
132 -- Params
133 --          p_appl_id   := specified application_id
134 --
135 -- ===============================================================
136 Procedure Get_Resps_By_Appl (
137     p_appl_id               IN  NUMBER,
138     x_resp_list             OUT NOCOPY VARCHAR2,
139     x_menu_list             OUT NOCOPY VARCHAR2,
140     x_return_status         OUT NOCOPY VARCHAR2,
141     x_msg_count             OUT NOCOPY NUMBER,
142     x_msg_data              OUT NOCOPY VARCHAR2
143 );
144 
145 
146 -- ===============================================================
147 -- Function name
148 --          Get_Functions_By_Appl
149 -- Purpose
150 --          get the available functions by specified applicaiton_id,
151 -- Params
152 --          p_appl_id   := specified application_id
153 --
154 -- ===============================================================
155 Function Get_Functions_By_Appl (
156     p_appl_id   IN  NUMBER
157 )
158 Return  VARCHAR2;
159 
160 
161 -- ===============================================================
162 -- Function name
163 --          Get_Functions_By_Resp
164 --
165 -- Purpose
166 --          get the available functions by specified resp_id,
167 -- Params
168 --          p_appl_id   := specified application_id
169 --          p_resp_id   := specified responsibility_id
170 --          p_menu_id   := specified menu_id
171 -- Notes
172 --          this Function is modified from PROCESS_MENU_TREE_DOWN_MN,
173 --          Instead of checking specific function_id, check all the
174 --          available functions under specific responsibility_id
175 --
176 -- ===============================================================
177 Function Get_Functions_By_Resp (
178     p_appl_id   IN NUMBER,
179     p_resp_id   IN NUMBER,
180     p_menu_id   IN NUMBER
181 )
182 Return  VARCHAR2;
183 
184 
185 -- ===============================================================
186 -- Procedure name
187 --          Revalidate_Violation
188 -- Purpose
189 --          to revalidate existing violators of specified violation report
190 --
191 -- Params
192 --          p_violation_id
193 --
194 -- Notes
195 --          this only checks violations for existing violators (against this constraint),
196 --          don't consider if any other users violate this constraint or not.
197 -- History
198 --          05.20.2005 tsho: create for AMW.E
199 -- ===============================================================
200 PROCEDURE Revalidate_Violation(
201     errbuf                       OUT  NOCOPY VARCHAR2,
202     retcode                      OUT  NOCOPY VARCHAR2,
203     p_violation_id               IN   NUMBER            := NULL
204     );
205 
206 
207 -- ===============================================================
208 -- Procedure name
209 --          Purge_Violation_Before_Date
210 -- Purpose
211 --          to clear violation history before the specified date
212 -- Params
213 --          p_delopt
214 --          p_date
215 -- Notes
216 --          p_delopt can have one of the two values
217 --              ALLCSTVIO - All Constraint Violations
218 --              INVALCSTVIO - Invalid Constraint Violations
219 --          p_date will have passed-in date
220 --
221 --          With "ALL Constraint Violations", we will delete all the constraint
222 --          violations created before the specified date.
223 --          With "Invalid Constraint violations", we will delete all the invalid
224 --          constraint violations created before the specified date. deleted.
225 --
226 -- History
227 --          12.01.2005 tsho     create (related to customer requirement: bug 4673154)
228 --          12.14.2006 psomanat Added delete statements for amw_violation_resp and amw_violat_resp_entries
229 --          03.14.2007 psomanat Added parameter p_delopt
230 -- ===============================================================
231 PROCEDURE Purge_Violation_Before_Date (
232     errbuf                       OUT  NOCOPY VARCHAR2,
233     retcode                      OUT  NOCOPY VARCHAR2,
234     p_delopt                     IN   VARCHAR2 := NULL,
235     p_date                       IN   VARCHAR2 := NULL
236     );
237 
238 
239 -- ===============================================================
240 -- Procedure name
241 --     Check_Violation_By_Name
242 --
243 -- Purpose
244 --     This Concurrent Program Executable checks the constraint
245 --     violation for Constraint Name Starting with p_constraint_name%.
246 --
247 -- Params
248 --     p_constraint_name  : Constraint Name Starting With
249 --
250 --
251 -- Notes
252 --     18.05.2006 psomanat: created
253 -- ===============================================================
254 PROCEDURE Check_Violation_By_Name(
255     errbuf                       OUT  NOCOPY VARCHAR2,
256     retcode                      OUT  NOCOPY VARCHAR2,
257     p_constraint_name            IN   VARCHAR2:= NULL
258 );
259 
260 -- ----------------------------------------------------------------------
261 END AMW_CONSTRAINT_PVT;