DBA Data[Home] [Help]

PACKAGE: APPS.CS_WORKFLOW_PUB

Source


1 PACKAGE CS_Workflow_PUB AS
2 /* $Header: cspwfs.pls 120.0 2005/10/26 18:02:07 aneemuch noship $ */
3 
4 -- --------------------------------------------------------------------------------
5 -- Start of comments
6 --  API Name    : Launch_Servereq_Workflow
7 --  Type        : Public
8 --  Description : Launch a Workflow process for the given service request.
9 --  Pre-reqs    : Profile option Service:Workflow Administrator must be set before
10 --                  calling this procedure.
11 --                p_wf_process_name must be a valid Workflow process based on the
12 --                  Service Request item type.
13 --  Parameters  :
14 --     p_api_version              IN NUMBER     Required
15 --     p_init_msg_list            IN VARCHAR2   Optional  Default = FND_API.G_FALSE
16 --     p_commit                   IN VARCHAR2   Optional  Default = FND_API.G_FALSE
17 --     p_return_status           OUT VARCHAR2   Required  Length  = 1
18 --     p_msg_count               OUT NUMBER     Required
19 --     p_msg_data                OUT VARCHAR2   Required  Length  = 2000
20 --     p_request_number           IN VARCHAR2   Required
21 --     p_initiator_user_id        IN NUMBER     Optional  Default NULL
22 --     p_initiator_resp_id        IN NUMBER     Optional  Default NULL
23 --     p_initiator_resp_appl_id   IN NUMBER     Optional  Default NULL
24 --     p_itemkey                 OUT VARCHAR2   Required  Length  = 240
25 --     p_nowait                   IN VARCHAR2   Optional  Default = FND_API.G_FALSE
26 --
27 --  Version     : Initial Version     1.0
28 --
29 --  Notes       : This procedure will try to lock the service request record because
30 --                  it needs to update the workflow_process_id column.  The NOWAIT
31 --                  option can be specified by setting the p_nowait parameter.
32 --
33 --                If there is an active Workflow process for this service request,
34 --                  this procedure will return an error.  Currently, only one active
35 --                  workflow process is allowed for each service request.
36 --
37 -- End of comments
38 -- --------------------------------------------------------------------------------
39 
40   PROCEDURE Launch_Servereq_Workflow (
41                 p_api_version             IN NUMBER,
42                 p_init_msg_list           IN VARCHAR2  DEFAULT FND_API.G_FALSE,
43                 p_commit                  IN VARCHAR2  DEFAULT FND_API.G_FALSE,
44                 p_return_status          OUT NOCOPY VARCHAR2,
45                 p_msg_count              OUT NOCOPY NUMBER,
46                 p_msg_data               OUT NOCOPY VARCHAR2,
47                 p_request_number          IN VARCHAR2,
48                 p_initiator_user_id       IN NUMBER    DEFAULT NULL,
49                 p_initiator_resp_id       IN NUMBER    DEFAULT NULL,
50                 p_initiator_resp_appl_id  IN NUMBER    DEFAULT NULL,
51                 p_itemkey                OUT NOCOPY VARCHAR2,
52                 p_nowait                  IN VARCHAR2  DEFAULT FND_API.G_FALSE );
53 
54 
55 -- --------------------------------------------------------------------------------
56 -- Start of comments
57 --  API Name    : Cancel_Servereq_Workflow
58 --  Type        : Public
59 --  Description : Abort an active Workflow process for the given service
60 --                request and send a notification to the current owner of the
61 --                request.
62 --  Pre-reqs    :
63 --  Parameters  :
64 --     p_api_version              IN NUMBER     Required
65 --     p_init_msg_list            IN VARCHAR2   Optional  Default = FND_API.G_FALSE
66 --     p_commit                   IN VARCHAR2   Optional  Default = FND_API.G_FALSE
67 --     p_return_status           OUT VARCHAR2   Required  Length  = 1
68 --     p_msg_count               OUT NUMBER     Required
69 --     p_msg_data                OUT VARCHAR2   Required  Length  = 2000
70 --     p_request_number           IN VARCHAR2   Required
71 --     p_wf_process_id            IN NUMBER     Required
72 --     p_user_id                  IN NUMBER     Required
73 --
74 --  Version     : Initial Version     1.0
75 --
76 --  Notes       :
77 --
78 -- End of comments
79 -- --------------------------------------------------------------------------------
80 
81   PROCEDURE Cancel_Servereq_Workflow (
82                 p_api_version             IN NUMBER,
83                 p_init_msg_list           IN VARCHAR2  DEFAULT FND_API.G_FALSE,
84                 p_commit                  IN VARCHAR2  DEFAULT FND_API.G_FALSE,
85                 p_return_status          OUT NOCOPY VARCHAR2,
86                 p_msg_count              OUT NOCOPY NUMBER,
87                 p_msg_data               OUT NOCOPY VARCHAR2,
88                 p_request_number          IN VARCHAR2,
89                 p_wf_process_id           IN NUMBER,
90                 p_user_id                 IN NUMBER );
91 
92 
93 -- --------------------------------------------------------------------------------
94 -- Start of comments
95 --  API Name	: Decode_Servereq_Itemkey
96 --  Type	: Public
97 --  Description	: Given an encoded Service Request itemkey, this procedure
98 --  		  will return the components of the key - service request
99 --	 	  number, and workflow process ID.
100 --  Pre-reqs	: None
101 --  Parameters	:
102 --     p_api_version		  IN NUMBER	Required
103 --     p_init_msg_list		  IN VARCHAR2	Optional  Default = FND_API.G_FALSE
104 --     p_return_status		 OUT VARCHAR2   Required  Length  = 1
105 --     p_msg_count		 OUT NUMBER     Required
106 --     p_msg_data		 OUT VARCHAR2   Required  Length  = 2000
107 --     p_itemkey		  IN VARCHAR2   Requried
108 --     p_request_number		 OUT VARCHAR2   Required  Length  = 64
109 --     p_wf_process_id		 OUT NUMBER	Required
110 --
111 --  Version	: Initial Version	1.0
112 --
113 --  Notes:	:
114 --
115 -- End of comments
116 -- --------------------------------------------------------------------------------
117 
118   PROCEDURE Decode_Servereq_Itemkey(
119 		p_api_version		  IN NUMBER,
120 		p_init_msg_list		  IN VARCHAR2  DEFAULT FND_API.G_FALSE,
121 		p_return_status		 OUT NOCOPY VARCHAR2,
122 		p_msg_count		 OUT NOCOPY NUMBER,
123 		p_msg_data		 OUT NOCOPY VARCHAR2,
124 		p_itemkey		  IN VARCHAR2,
125 		p_request_number	 OUT NOCOPY VARCHAR2,
126 		p_wf_process_id		 OUT NOCOPY NUMBER );
127 
128 
129 -- --------------------------------------------------------------------------------
130 -- Start of comments
131 --  API Name	: Encode_Servereq_Itemkey
132 --  Type	: Public
133 --  Description	: Given a service request number and a Workflow process
134 --		  ID, this procedure will construct the corresponding
135 --		  itemkey for the Service Request item type.
136 --  Pre-reqs	: None
137 --  Parameters	:
138 --     p_api_version		  IN NUMBER	Required
139 --     p_init_msg_list		  IN VARCHAR2	Optional  Default = FND_API.G_FALSE
140 --     p_return_status		 OUT VARCHAR2   Required  Length  = 1
141 --     p_msg_count		 OUT NUMBER     Required
142 --     p_msg_data		 OUT VARCHAR2   Required  Length  = 2000
143 --     p_request_number		  IN VARCHAR2   Required
144 --     p_wf_process_id		  IN NUMBER	Required
145 --     p_itemkey		 OUT VARCHAR2   Requried  Length  = 240
146 --
147 --  Version	: Initial Version	1.0
148 --
149 --  Notes:	: Either p_request_number or p_wf_process_id must be non-NULL.
150 --
151 -- End of comments
152 -- --------------------------------------------------------------------------------
153 
154   PROCEDURE Encode_Servereq_Itemkey(
155 		p_api_version		  IN NUMBER,
156 		p_init_msg_list		  IN VARCHAR2  DEFAULT FND_API.G_FALSE,
157 		p_return_status		 OUT NOCOPY VARCHAR2,
158 		p_msg_count		 OUT NOCOPY NUMBER,
159 		p_msg_data		 OUT NOCOPY VARCHAR2,
160 		p_request_number	  IN VARCHAR2,
161 		p_wf_process_id		  IN NUMBER,
162 		p_itemkey		 OUT NOCOPY VARCHAR2 );
163 
164 
165 
166 -- --------------------------------------------------------------------------------
167 -- Start of comments
168 --  API Name	: Get_Employee_Role
169 --  Type	: Public
170 --  Description	: Get the Workflow role name of the given employee
171 --  Pre-reqs	: None
172 --  Parameters	:
173 --     p_api_version		  IN NUMBER	Required
174 --     p_init_msg_list		  IN VARCHAR2	Optional  Default = FND_API.G_FALSE
175 --     p_return_status		 OUT VARCHAR2   Required  Length  = 1
176 --     p_msg_count		 OUT NUMBER     Required
177 --     p_msg_data		 OUT VARCHAR2   Required  Length  = 2000
178 --     p_employee_id		  IN NUMBER	Optional  Default = NULL
179 --     p_emp_last_name		  IN VARCHAR2   Optional  Default = NULL
180 --     p_emp_first_name		  IN VARCHAR2   Optional  Default = NULL
181 --     p_role_name		 OUT VARCHAR2	Required  Length  = 100
182 --     p_role_display_name	 OUT VARCHAR2	Required  Length  = 240
183 --
184 --  Version	: Initial Version	1.0
185 --
186 --  Notes:	: Either employee ID or first/last name must be non-null.
187 --
188 --		  If both ID and name are passed in, the ID will be used.  If the
189 --                name is used and it does NOT uniquely identify an employee, an
190 --                error will be returned.
191 --
192 --		  If the employee is not defined in the Workflow directory
193 --		  views, the return values p_role_name and p_role_display_name
194 --		  will be NULL; however, the return status will still be
195 --                SUCCESS.
196 --
197 --		  If the employee is mapped to more than one Workflow role,
198 --		  then the first one fetched will be returned
199 --
200 -- End of comments
201 -- --------------------------------------------------------------------------------
202 
203   PROCEDURE Get_Employee_Role (
204 		p_api_version		  IN NUMBER,
205 		p_init_msg_list		  IN VARCHAR2  DEFAULT FND_API.G_FALSE,
206 		p_return_status		 OUT NOCOPY VARCHAR2,
207 		p_msg_count		 OUT NOCOPY NUMBER,
208 		p_msg_data		 OUT NOCOPY VARCHAR2,
209 		p_employee_id  		  IN NUMBER    DEFAULT NULL,
210 		p_emp_last_name		  IN VARCHAR2  DEFAULT NULL,
211 		p_emp_first_name	  IN VARCHAR2  DEFAULT NULL,
212 		p_role_name		 OUT NOCOPY VARCHAR2,
213 		p_role_display_name	 OUT NOCOPY VARCHAR2 );
214 
215 
216 -- --------------------------------------------------------------------------------
217 -- Start of comments
218 --  API Name	: Get_Emp_Supervisor
219 --  Type	: Public
220 --  Description	: Get the supervisor information of the given employee.
221 --		  Returns the employee ID, Workflow role name, and
222 --		  Workflow display name of the supervisor.
223 --  Pre-reqs	: None
224 --  Parameters	:
225 --     p_api_version		  IN NUMBER	Required
226 --     p_init_msg_list		  IN VARCHAR2	Optional  Default = FND_API.G_FALSE
227 --     p_return_status		 OUT VARCHAR2   Required  Length  = 1
228 --     p_msg_count		 OUT NUMBER     Required
229 --     p_msg_data		 OUT VARCHAR2   Required  Length  = 2000
230 --     p_employee_id		  IN NUMBER	Optional  Default = NULL
231 --     p_emp_last_name		  IN VARCHAR2	Optional  Default = NULL
232 --     p_emp_first_name		  IN VARCHAR2   Optional  Default = NULL
233 --     p_supervisor_emp_id	 OUT NUMBER	Required
234 --     p_supervisor_role	 OUT VARCHAR2	Required  Length  = 100
235 --     p_supervisor_name	 OUT VARCHAR2   Required  Length  = 240
236 --
237 --  Version	: Initial Version	1.0
238 --
239 --  Notes:	: Either employee ID or first/last name must be non-null.
240 --
241 --		  If both ID and name are passed in, the ID will be used.  If the
242 --                name is used and it does NOT uniquely identify an employee, an
243 --                error will be returned.
244 --
245 --		  If the employee does not have a supervisor, the output
246 --		  variables for the supervisor information will be set to NULL;
247 --                however, the return status of the procedure will still be set
248 --                to SUCCESS.
249 --
250 -- End of comments
251 -- --------------------------------------------------------------------------------
252 
253   PROCEDURE Get_Emp_Supervisor(
254 		p_api_version		  IN NUMBER,
255 		p_init_msg_list		  IN VARCHAR2  DEFAULT FND_API.G_FALSE,
256 		p_return_status		 OUT NOCOPY VARCHAR2,
257 		p_msg_count		 OUT NOCOPY NUMBER,
258 		p_msg_data		 OUT NOCOPY VARCHAR2,
259 		p_employee_id		  IN NUMBER    DEFAULT NULL,
260 		p_emp_last_name		  IN VARCHAR2  DEFAULT NULL,
261 		p_emp_first_name	  IN VARCHAR2  DEFAULT NULL,
262 		p_supervisor_emp_id 	 OUT NOCOPY NUMBER,
263 		p_supervisor_role	 OUT NOCOPY VARCHAR2,
264 		p_supervisor_name 	 OUT NOCOPY VARCHAR2 );
265 
266 
267 -- --------------------------------------------------------------------------------
268 -- Start of comments
269 --  API Name	: Get_Emp_Fnd_User_ID
270 --  Type	: Public
271 --  Description	: Get the FND user ID of the given employee
272 --  Pre-reqs	: None
273 --  Parameters	:
274 --     p_api_version		  IN NUMBER	Required
275 --     p_init_msg_list		  IN VARCHAR2	Optional  Default = FND_API.G_FALSE
276 --     p_return_status		 OUT VARCHAR2   Required  Length  = 1
277 --     p_msg_count		 OUT NUMBER     Required
278 --     p_msg_data		 OUT VARCHAR2   Required  Length  = 2000
279 --     p_employee_id		  IN NUMBER	Optional  Default = NULL
280 --     p_emp_last_name		  IN VARCHAR2	Optional  Default = NULL
281 --     p_emp_first_name		  IN VARCHAR2   Optional  Default = NULL
282 --     p_fnd_user_id		 OUT NUMBER	Required
283 --
284 --  Version	: Initial Version	1.0
285 --
286 --  Notes:	: Either employee ID or first/last name must be non-null.
287 --
288 --		  If both ID and name are passed in, the ID will be used.  If the
289 --                name is used and it does NOT uniquely identify an employee, an
290 --                error will be returned.
291 --
292 --		  If the employee maps to more than one FND user, then the
293 --		  first one fetched will be returned.
294 --
295 --		  If the given employee is not a FND user, then NULL will be
296 --		  returned; however, the return status will still be set to
297 --                SUCCESS.
298 --
299 -- End of comments
300 -- --------------------------------------------------------------------------------
301 
302   PROCEDURE Get_Emp_Fnd_User_ID(
303 		p_api_version		  IN NUMBER,
304 		p_init_msg_list		  IN VARCHAR2  DEFAULT FND_API.G_FALSE,
305 		p_return_status		 OUT NOCOPY VARCHAR2,
306 		p_msg_count		 OUT NOCOPY NUMBER,
307 		p_msg_data		 OUT NOCOPY VARCHAR2,
308 		p_employee_id	 	  IN NUMBER    DEFAULT NULL,
309 		p_emp_last_name		  IN VARCHAR2  DEFAULT NULL,
310 		p_emp_first_name	  IN VARCHAR2  DEFAULT NULL,
311 		p_fnd_user_id 		 OUT NOCOPY NUMBER );
312 
313 
314 -------------------------------------------------------------------------------
315 -- Start of comments
316 --  API Name	: Launch_Action_Workflow
317 --  Type	: Public
318 --  Function	: Launch a Workflow process for the given service request
319 --		  action.
320 --  Pre-reqs    : Profile option Service:Workflow Administrator must be set
321 --		  before calling this procedure.
322 --                The type of the given service request action must be
323 --		  associated with a valid Workflow process based on the
324 --		  Service Request Action item type.
325 --  Parameters	:
326 --  IN		:	p_api_version		IN NUMBER	Required
327 --			p_init_msg_list		IN VARCHAR2	Optional
328 --				Default = FND_API.G_FALSE
329 --			p_commit		IN VARCHAR2	Optional
330 --				Default = FND_API.G_FALSE
331 --			p_request_id		IN NUMBER	Required
332 --			p_action_number		IN NUMBER	Required
333 --			p_initiator_user_id	IN NUMBER	Optional
334 --				Default = NULL
335 --			p_initiator_resp_id	IN NUMBER	Optional
336 --				Default = NULL
337 --			p_initiator_resp_appl_id IN NUMBER	Optional
338 --				Default = NULL
339 --			p_launched_by_dispatch	IN VARCHAR2	Optional
340 --				Default = FND_API.G_FALSE
341 --			p_nowait		IN VARCHAR2	Optional
342 --				Default = FND_API.G_FALSE
343 --
344 --  OUT		:	p_return_status		OUT	VARCHAR2(1)
345 --			p_msg_count		OUT	NUMBER
346 --			p_msg_data		OUT	VARCHAR2(2000)
347 --			p_itemkey		OUT	VARCHAR2(240)
348 --
349 --  Version	: Initial Version	1.0
350 --
351 --  Notes	: This procedure will try to lock the service request action
352 --		  record because it needs to update the workflow_process_id
356 --		  If there is an active Workflow process for this service
353 --		  column. The NOWAIT option can be specified by setting the
354 --		  p_nowait parameter.
355 --
357 --		  request action, this procedure will return an error.
358 --		  Currently, only one active workflow process is allowed for
359 --		  each service request action.
360 --
361 -- End of comments
362 -------------------------------------------------------------------------------
363 
364 /*PROCEDURE Launch_Action_Workflow
365 ( p_api_version			IN	NUMBER,
366   p_init_msg_list		IN	VARCHAR2 := FND_API.G_FALSE,
367   p_commit			IN	VARCHAR2 := FND_API.G_FALSE,
368   p_return_status		OUT	VARCHAR2,
369   p_msg_count			OUT	NUMBER,
370   p_msg_data			OUT	VARCHAR2,
371   p_request_id			IN	NUMBER,
372   p_action_number		IN	NUMBER,
373   p_initiator_user_id		IN	NUMBER   := NULL,
374   p_initiator_resp_id		IN	NUMBER   := NULL,
375   p_initiator_resp_appl_id	IN	NUMBER   := NULL,
376   p_launched_by_dispatch	IN	VARCHAR2 := FND_API.G_FALSE,
377   p_nowait			IN	VARCHAR2 := FND_API.G_FALSE,
378   p_itemkey			OUT	VARCHAR2
379 );*/
380 
381 
382 -------------------------------------------------------------------------------
383 -- Start of comments
384 --  API Name	: Cancel_Action_Workflow
385 --  Type	: Public
386 --  Function	: Abort an active Workflow process for the given service
387 --		  request action and send a notification to the current
388 --		  assignee of the request action. If a dispatch notification
389 --		  was sent to the dispatcher, also send an abort notification.
390 --  Pre-reqs	: None.
391 --  Parameters	:
392 --  IN		:	p_api_version		IN NUMBER	Required
393 --			p_init_msg_list		IN VARCHAR2	Optional
394 --				Default = FND_API.G_FALSE
395 --			p_commit		IN VARCHAR2	Optional
396 --				Default = FND_API.G_FALSE
397 --			p_request_id		IN NUMBER	Required
398 --			p_action_number		IN NUMBER	Required
399 --			p_wf_process_id		IN NUMBER	Required
400 --			p_abort_user_id		IN NUMBER	Required
401 --
402 --  OUT		:	p_return_status		OUT	VARCHAR2(1)
403 --			p_msg_count		OUT	NUMBER
404 --			p_msg_data		OUT	VARCHAR2(2000)
405 --			p_launched_by_dispatch	OUT	VARCHAR2(1)
406 --
407 --  Version	: Initial Version	1.0
408 --
409 --  Notes	:
410 --
411 -- End of comments
412 -------------------------------------------------------------------------------
413 
414 PROCEDURE Cancel_Action_Workflow
415 ( p_api_version			IN	NUMBER,
416   p_init_msg_list		IN	VARCHAR2 := FND_API.G_FALSE,
417   p_commit			IN	VARCHAR2 := FND_API.G_FALSE,
418   p_return_status		OUT	NOCOPY VARCHAR2,
419   p_msg_count			OUT	NOCOPY NUMBER,
420   p_msg_data			OUT	NOCOPY VARCHAR2,
421   p_request_id			IN	NUMBER,
422   p_action_number		IN	NUMBER,
423   p_wf_process_id		IN	NUMBER,
424   p_abort_user_id		IN	NUMBER,
425   p_launched_by_dispatch	OUT	NOCOPY VARCHAR2
426 );
427 
428 
429 -------------------------------------------------------------------------------
430 -- Start of comments
431 --  API Name	: Decode_Action_Itemkey
432 --  Type	: Public
433 --  Description	: Given an encoded Service Request Action itemkey, this
434 --		  procedure will return the components of the key - service
435 --		  request id, action number, and workflow process ID.
436 --  Pre-reqs	: None
437 --  Parameters	:
438 --  IN		:	p_api_version		IN NUMBER	Required
439 --			p_init_msg_list		IN VARCHAR2	Optional
440 --				Default = FND_API.G_FALSE
441 --			p_itemkey		IN VARCHAR2	Requried
442 --
443 --  OUT		:	p_return_status		OUT	VARCHAR2(1)
444 --			p_msg_count		OUT	NUMBER
445 --			p_msg_data		OUT	VARCHAR2(2000)
446 --			p_request_id		OUT	NUMBER
447 --			p_action_number		OUT	NUMBER
448 --			p_wf_process_id		OUT	NUMBER
449 --
450 --  Version	: Initial Version	1.0
451 --
452 --  Notes	:
453 --
454 -- End of comments
455 -------------------------------------------------------------------------------
456 
457 PROCEDURE Decode_Action_Itemkey
458 ( p_api_version		IN	NUMBER,
459   p_init_msg_list	IN	VARCHAR2 := FND_API.G_FALSE,
460   p_return_status	OUT	NOCOPY VARCHAR2,
461   p_msg_count		OUT	NOCOPY NUMBER,
462   p_msg_data		OUT	NOCOPY VARCHAR2,
463   p_itemkey		IN	VARCHAR2,
464   p_request_id		OUT	NOCOPY NUMBER,
465   p_action_number	OUT	NOCOPY NUMBER,
466   p_wf_process_id	OUT	NOCOPY NUMBER
467 );
468 
469 END CS_Workflow_PUB;