[Home] [Help]
PACKAGE BODY: APPS.CS_SERVICEREQUEST_CUHK
Source
4 /*****************************************************************************************
1 PACKAGE BODY cs_servicerequest_cuhk AS
2 /* $Header: cscsrb.pls 120.0.12020000.2 2012/12/24 09:05:00 lkullamb ship $ */
3
5 This is the Customer User Hook API.
6 The Customers can add customization procedures here for Pre and Post Processing.
7 ******************************************************************************************/
8 G_PKG_NAME CONSTANT VARCHAR2(30) := 'CS_ServiceRequest_CUHK';
9
10 PROCEDURE Create_ServiceRequest_Pre
11 ( p_api_version IN NUMBER,
12 p_init_msg_list IN VARCHAR2 ,
13 p_commit IN VARCHAR2 ,
14 p_validation_level IN NUMBER ,
15 x_return_status OUT NOCOPY VARCHAR2,
16 x_msg_count OUT NOCOPY NUMBER,
17 x_msg_data OUT NOCOPY VARCHAR2,
18 p_resp_appl_id IN NUMBER ,
19 p_resp_id IN NUMBER ,
20 p_user_id IN NUMBER,
21 p_login_id IN NUMBER ,
22 p_org_id IN NUMBER ,
23 p_request_id IN NUMBER ,
24 p_request_number IN VARCHAR2 ,
25 p_invocation_mode IN VARCHAR2 := 'NORMAL',
26 p_service_request_rec IN CS_ServiceRequest_PVT.service_request_rec_type,
27 p_notes IN CS_ServiceRequest_PVT.notes_table,
28 p_contacts IN CS_ServiceRequest_PVT.contacts_table ,
29 x_request_id OUT NOCOPY NUMBER,
30 x_request_number OUT NOCOPY VARCHAR2,
31 x_interaction_id OUT NOCOPY NUMBER,
32 x_workflow_process_id OUT NOCOPY NUMBER,
33 --15995804. Add price_list_header_id
34 x_price_list_header_id OUT NOCOPY NUMBER
35 ) Is
36 l_return_status VARCHAR2(1) := null;
37 l_api_name VARCHAR2(30) := 'Create_ServiceRequest_Post';
38 l_api_name_full CONSTANT VARCHAR2(61) := G_PKG_NAME||'.'||l_api_name;
39
40 Begin
41
42 Savepoint CS_ServiceRequest_CUHK;
43 x_return_status := fnd_api.g_ret_sts_success;
44 /*
45 -- Call to ISupport Package
46
47 IBU_SR_CUHK.Create_ServiceRequest_Pre(
48 p_api_version => p_api_version,
49 p_init_msg_list => p_init_msg_list,
50 p_commit => p_commit,
51 p_validation_level => fnd_api.g_valid_level_full,
52 x_return_status => l_return_status,
53 x_msg_count => x_msg_count,
54 x_msg_data => x_msg_data,
55 p_resp_appl_id => p_resp_appl_id,
56 p_resp_id => p_resp_id,
57 p_user_id => p_user_id,
58 p_login_id => p_login_id,
59 p_org_id => p_org_id,
60 p_request_id => p_request_id,
61 p_request_number => p_request_number,
62 p_invocation_mode => p_invocation_mode,
63 p_service_request_rec => p_service_request_rec,
64 p_notes => p_notes,
65 p_contacts => p_contacts,
66 x_request_id => x_request_id,
67 x_request_number => x_request_number,
68 x_interaction_id => x_interaction_id,
69 x_workflow_process_id => x_workflow_process_id
70 );
71 IF (l_return_status <> fnd_api.g_ret_sts_success) THEN
72 RAISE FND_API.G_EXC_ERROR;
73 END IF;
74 --------
75
76
80 p_init_msg_list => p_init_msg_list,
77 -- Call to GIT Package
78 CS_GIT_USERHOOK_PKG.GIT_Create_ServiceRequest_Pre (
79 p_api_version => p_api_version,
81 p_commit => p_commit,
82 p_validation_level=> FND_API.G_VALID_LEVEL_FULL,
83 x_return_status => l_return_status,
84 x_msg_count => x_msg_count,
85 x_msg_data => x_msg_data,
86 p_sr_rec => p_service_request_rec,
87 p_incident_number => p_request_number,
88 p_incident_id => p_request_id,
89 p_invocation_mode => p_invocation_mode
90 );
91
92 IF (l_return_status <> fnd_api.g_ret_sts_success) THEN
93 RAISE FND_API.G_EXC_ERROR;
94 END IF;
95 */
96 -- Added null b'coz patch# 2192849 giving errors b'coz of this file.
97 NULL;
98 --------------
99
100 /*CS_OSS_USERHOOK_PKG.OSS_Create_ServiceRequest_Pre(
101 p_api_version => p_api_version,
102 p_init_msg_list => p_init_msg_list,
103 p_commit => p_commit,
104 p_validation_level => FND_API.G_VALID_LEVEL_FULL,
105 x_return_status => l_return_status,
106 x_msg_count => x_msg_count,
107 x_msg_data => x_msg_data,
108 p_service_request_rec => p_service_request_rec
109 );
110
111 IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
112 RAISE FND_API.G_EXC_ERROR;
113 END IF;
114 */
115 -- Standard call to get message count and if count is 1, get message info
116 FND_MSG_PUB.Count_And_Get( p_count => x_msg_count,
117 p_data => x_msg_data );
118
119 EXCEPTION
120 WHEN FND_API.G_EXC_ERROR THEN
121 ROLLBACK TO CS_ServiceRequest_CUHK;
122 x_return_status := FND_API.G_RET_STS_ERROR;
123 FND_MSG_PUB.Count_And_Get
124 ( p_count => x_msg_count,
125 p_data => x_msg_data );
126 WHEN OTHERS THEN
127 ROLLBACK TO CS_ServiceRequest_CUHK;
128 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
129 IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
130 FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
131 END IF;
132 FND_MSG_PUB.Count_And_Get
133 ( p_count => x_msg_count,
134 p_data => x_msg_data
135 );
136 END;
137
138 PROCEDURE Create_ServiceRequest_Post
139 ( p_api_version IN NUMBER,
140 p_init_msg_list IN VARCHAR2 ,
141 p_commit IN VARCHAR2 ,
142 p_validation_level IN NUMBER ,
143 x_return_status OUT NOCOPY VARCHAR2,
144 x_msg_count OUT NOCOPY NUMBER,
145 x_msg_data OUT NOCOPY VARCHAR2,
146 p_resp_appl_id IN NUMBER ,
147 p_resp_id IN NUMBER ,
148 p_user_id IN NUMBER,
149 p_login_id IN NUMBER ,
150 p_org_id IN NUMBER ,
151 p_request_id IN NUMBER ,
152 p_request_number IN VARCHAR2 ,
153 p_invocation_mode IN VARCHAR2 := 'NORMAL',
154 p_service_request_rec IN CS_ServiceRequest_PVT.service_request_rec_type,
155 p_notes IN CS_ServiceRequest_PVT.notes_table,
156 p_contacts IN CS_ServiceRequest_PVT.contacts_table ,
157 x_request_id OUT NOCOPY NUMBER,
158 x_request_number OUT NOCOPY VARCHAR2,
159 x_interaction_id OUT NOCOPY NUMBER,
160 x_workflow_process_id OUT NOCOPY NUMBER
161 ) IS
162 l_return_status VARCHAR2(1) := null;
163 l_api_name VARCHAR2(30) := 'Create_ServiceRequest_Post';
164 l_api_name_full CONSTANT VARCHAR2(61) := G_PKG_NAME||'.'||l_api_name;
165 BEGIN
166
167 Savepoint CS_ServiceRequest_CUHK;
168
169 x_return_status := fnd_api.g_ret_sts_success;
170 /*
171 IBU_SR_CUHK.Create_ServiceRequest_Post(
172 p_api_version => p_api_version,
173 p_init_msg_list => p_init_msg_list,
174 p_commit => p_commit,
175 p_validation_level => fnd_api.g_valid_level_full,
176 x_return_status => l_return_status,
177 x_msg_count => x_msg_count,
178 x_msg_data => x_msg_data,
179 p_resp_appl_id => p_resp_appl_id,
180 p_resp_id => p_resp_id,
181 p_user_id => p_user_id,
182 p_login_id => p_login_id,
183 p_org_id => p_org_id,
184 p_request_id => p_request_id,
185 p_request_number => p_request_number,
186 p_invocation_mode => p_invocation_mode,
187 p_service_request_rec => p_service_request_rec,
188 p_notes => p_notes,
189 p_contacts => p_contacts,
190 x_request_id => x_request_id,
191 x_request_number => x_request_number,
192 x_interaction_id => x_interaction_id,
193 x_workflow_process_id => x_workflow_process_id
194 );
195
196 IF (l_return_status <> fnd_api.g_ret_sts_success) THEN
197 RAISE FND_API.G_EXC_ERROR;
198 END IF;
199
200
201 CS_GIT_USERHOOK_PKG.GIT_Create_ServiceRequest_Post(
205 p_validation_level => FND_API.G_VALID_LEVEL_FULL,
202 p_api_version => p_api_version,
203 p_init_msg_list => p_init_msg_list,
204 p_commit => p_commit,
206 x_return_status => l_return_status,
207 x_msg_count => x_msg_count,
208 x_msg_data => x_msg_data,
209 p_sr_rec => p_service_request_rec,
210 p_incident_number => p_request_number,
211 p_incident_id => p_request_id,
212 p_invocation_mode => p_invocation_mode
213 );
214
215 If (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
216 RAISE FND_API.G_EXC_ERROR;
217 END IF;
218 */
219 NULL;
220
221 -- Standard call to get message count and if count is 1, get message info
222 FND_MSG_PUB.Count_And_Get( p_count => x_msg_count,
223 p_data => x_msg_data );
224 EXCEPTION
225 WHEN FND_API.G_EXC_ERROR THEN
226 ROLLBACK TO CS_ServiceRequest_CUHK;
227 x_return_status := FND_API.G_RET_STS_ERROR;
228 FND_MSG_PUB.Count_And_Get
229 ( p_count => x_msg_count,
230 p_data => x_msg_data );
231 WHEN OTHERS THEN
232 ROLLBACK TO CS_ServiceRequest_CUHK;
233 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
234 IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
235 FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
236 END IF;
237 FND_MSG_PUB.Count_And_Get
238 ( p_count => x_msg_count,
239 p_data => x_msg_data
240 );
241 END;
242
243
244 /* Customer Procedure for pre processing in case of
245 update service request */
246
247 /*
248 PROCEDURE Update_ServiceRequest_Pre
249 ( p_request_id IN NUMBER,
250 p_service_request_rec IN CS_ServiceRequest_PVT.service_request_rec_type,
251 x_return_status OUT NOCOPY VARCHAR2
252 ); */
253
254
255 PROCEDURE Update_ServiceRequest_Pre
256 ( p_api_version IN NUMBER,
257 p_init_msg_list IN VARCHAR2 ,
258 p_commit IN VARCHAR2 ,
259 p_validation_level IN NUMBER ,
260 x_return_status OUT NOCOPY VARCHAR2,
261 x_msg_count OUT NOCOPY NUMBER,
262 x_msg_data OUT NOCOPY VARCHAR2,
263 p_request_id IN NUMBER,
264 p_object_version_number IN NUMBER,
265 p_resp_appl_id IN NUMBER ,
266 p_resp_id IN NUMBER ,
267 p_last_updated_by IN NUMBER,
268 p_last_update_login IN NUMBER ,
269 p_last_update_date IN DATE,
270 p_invocation_mode IN VARCHAR2 := 'NORMAL',
271 p_service_request_rec IN CS_ServiceRequest_PVT.service_request_rec_type,
272 p_update_desc_flex IN VARCHAR2 ,
273 p_notes IN CS_ServiceRequest_PVT.notes_table,
274 p_contacts IN CS_ServiceRequest_PVT.contacts_table,
275 p_audit_comments IN VARCHAR2 ,
276 p_called_by_workflow IN VARCHAR2 ,
277 p_workflow_process_id IN NUMBER ,
278 x_workflow_process_id OUT NOCOPY NUMBER,
279 x_interaction_id OUT NOCOPY NUMBER
280 ) IS
281 l_action_type VARCHAR2(15) := 'UPDATE';
282 l_source VARCHAR2(10);
283 l_return_status VARCHAR2(1);
284 l_msg_data VARCHAR2(2000);
285 l_msg_count NUMBER;
286 l_api_name VARCHAR2(30) := 'Update_ServiceRequest_Post';
287 l_api_name_full CONSTANT VARCHAR2(61) := G_PKG_NAME||'.'||l_api_name;
288 Begin
289
290 Savepoint CS_ServiceRequest_CUHK;
291
292 x_return_status := fnd_api.g_ret_sts_success;
293 /*
294 -- Call to ISupport Package
295
296 IBU_SR_CUHK.Update_ServiceRequest_Pre(
297 p_api_version => p_api_version,
298 p_init_msg_list => p_init_msg_list,
299 p_commit => p_commit,
300 p_validation_level => fnd_api.g_valid_level_full,
301 x_return_status => l_return_status,
302 x_msg_count => x_msg_count,
303 x_msg_data => x_msg_data,
304 p_request_id => p_request_id,
305 p_object_version_number => p_object_version_number,
306 p_resp_appl_id => p_resp_appl_id,
307 p_resp_id => p_resp_id,
308 p_last_updated_by => p_last_updated_by,
309 p_last_update_login => p_last_update_login,
310 p_last_update_date => p_last_update_date,
311 p_invocation_mode => p_invocation_mode,
312 p_service_request_rec => p_service_request_rec,
313 p_update_desc_flex => p_update_desc_flex,
314 p_notes => p_notes,
315 p_contacts => p_contacts,
316 p_audit_comments => p_audit_comments,
317 p_called_by_workflow => p_called_by_workflow,
318 p_workflow_process_id => p_workflow_process_id,
319 x_workflow_process_id => x_workflow_process_id,
320 x_interaction_id => x_interaction_id
321 );
322
323 IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
324 RAISE FND_API.G_EXC_ERROR;
325 END IF;
326 ---------
327
328 CS_GIT_USERHOOK_PKG.GIT_Update_ServiceRequest_Pre(
329 p_api_version => p_api_version,
330 p_init_msg_list => p_init_msg_list,
334 x_msg_count => x_msg_count,
331 p_commit => p_commit,
332 p_validation_level => FND_API.G_VALID_LEVEL_FULL,
333 x_return_status => l_return_status,
335 x_msg_data => x_msg_data,
336 p_sr_rec => p_service_request_rec,
337 p_incident_id => p_request_id,
338 p_invocation_mode => p_invocation_mode
339 );
340
341 IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
342 RAISE FND_API.G_EXC_ERROR;
343 END IF;
344 */
345 NULL;
346
347 /*CS_OSS_USERHOOK_PKG.OSS_Update_ServiceRequest_Pre(
348 p_api_version => p_api_version,
349 p_init_msg_list => p_init_msg_list,
350 p_commit => p_commit,
351 p_validation_level => FND_API.G_VALID_LEVEL_FULL,
352 x_return_status => l_return_status,
353 x_msg_count => x_msg_count,
354 x_msg_data => x_msg_data,
355 p_service_request_rec => p_service_request_rec
356 );
357
358 IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
359 RAISE FND_API.G_EXC_ERROR;
360 END IF;
361 */
362 -- Standard call to get message count and if count is 1, get message info
363 FND_MSG_PUB.Count_And_Get( p_count => x_msg_count,
364 p_data => x_msg_data );
365 EXCEPTION
366 WHEN FND_API.G_EXC_ERROR THEN
367 ROLLBACK TO CS_ServiceRequest_CUHK;
368 x_return_status := FND_API.G_RET_STS_ERROR;
369 FND_MSG_PUB.Count_And_Get
370 ( p_count => x_msg_count,
371 p_data => x_msg_data );
372 WHEN OTHERS THEN
373 ROLLBACK TO CS_ServiceRequest_CUHK;
374 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
375 IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
376 FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
377 END IF;
378 FND_MSG_PUB.Count_And_Get
379 ( p_count => x_msg_count,
380 p_data => x_msg_data
381 );
382 End;
383
384 /* Customer Procedure for post processing in case of
385 update service request */
386
387
388 /*
389 PROCEDURE Update_ServiceRequest_Post
390 ( p_request_id IN NUMBER,
391 p_service_request_rec IN CS_ServiceRequest_PVT.service_request_rec_type,
392 x_return_status OUT NOCOPY VARCHAR2); */
393
394
395
396 PROCEDURE Update_ServiceRequest_Post
397 ( p_api_version IN NUMBER,
398 p_init_msg_list IN VARCHAR2 ,
399 p_commit IN VARCHAR2 ,
400 p_validation_level IN NUMBER ,
401 x_return_status OUT NOCOPY VARCHAR2,
402 x_msg_count OUT NOCOPY NUMBER,
403 x_msg_data OUT NOCOPY VARCHAR2,
404 p_request_id IN NUMBER,
405 p_object_version_number IN NUMBER,
406 p_resp_appl_id IN NUMBER ,
407 p_resp_id IN NUMBER ,
408 p_last_updated_by IN NUMBER,
409 p_last_update_login IN NUMBER ,
410 p_last_update_date IN DATE,
411 p_invocation_mode IN VARCHAR2 := 'NORMAL',
412 p_service_request_rec IN CS_ServiceRequest_PVT.service_request_rec_type,
413 p_update_desc_flex IN VARCHAR2 ,
414 p_notes IN CS_ServiceRequest_PVT.notes_table,
415 p_contacts IN CS_ServiceRequest_PVT.contacts_table,
416 p_audit_comments IN VARCHAR2 ,
417 p_called_by_workflow IN VARCHAR2 ,
418 p_workflow_process_id IN NUMBER ,
419 x_workflow_process_id OUT NOCOPY NUMBER,
420 x_interaction_id OUT NOCOPY NUMBER
421 ) IS
422 l_action_type VARCHAR2(15) := 'UPDATE';
423 l_source VARCHAR2(10);
424 l_return_status VARCHAR2(1);
425 l_api_name VARCHAR2(30) := 'Update_ServiceRequest_Post';
426 l_api_name_full CONSTANT VARCHAR2(61) := G_PKG_NAME||'.'||l_api_name;
427 BEGIN
428
429 Savepoint CS_ServiceRequest_CUHK;
430
431 x_return_status := fnd_api.g_ret_sts_success;
432 /*
433 IBU_SR_CUHK.Update_ServiceRequest_Post(
434 p_api_version => p_api_version,
435 p_init_msg_list => p_init_msg_list,
436 p_commit => p_commit,
437 p_validation_level => fnd_api.g_valid_level_full,
438 x_return_status => l_return_status,
439 x_msg_count => x_msg_count,
440 x_msg_data => x_msg_data,
441 p_request_id => p_request_id,
442 p_object_version_number => p_object_version_number,
443 p_resp_appl_id => p_resp_appl_id,
444 p_resp_id => p_resp_id,
445 p_last_updated_by => p_last_updated_by,
446 p_last_update_login => p_last_update_login,
447 p_last_update_date => p_last_update_date,
448 p_invocation_mode => p_invocation_mode,
449 p_service_request_rec => p_service_request_rec,
450 p_update_desc_flex => p_update_desc_flex,
451 p_notes => p_notes,
452 p_contacts => p_contacts,
453 p_audit_comments => p_audit_comments,
454 p_called_by_workflow => p_called_by_workflow,
458 );
455 p_workflow_process_id => p_workflow_process_id,
456 x_workflow_process_id => x_workflow_process_id,
457 x_interaction_id => x_interaction_id
459
460 IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
461 RAISE FND_API.G_EXC_ERROR;
462 END IF;
463
464 CS_GIT_USERHOOK_PKG.GIT_Update_ServiceRequest_Post(
465 p_api_version => p_api_version,
466 p_init_msg_list => p_init_msg_list,
467 p_commit => p_commit,
468 p_validation_level => FND_API.G_VALID_LEVEL_FULL,
469 x_return_status => l_return_status,
470 x_msg_count => x_msg_count,
471 x_msg_data => x_msg_data,
472 p_sr_rec => p_service_request_rec,
473 p_incident_id => p_request_id,
474 p_invocation_mode => p_invocation_mode
475 );
476
477 IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
478 RAISE FND_API.G_EXC_ERROR;
479 END IF;
480 */
481 NULL;
482
483 -- Standard call to get message count and if count is 1, get message info
484 FND_MSG_PUB.Count_And_Get( p_count => x_msg_count,
485 p_data => x_msg_data );
486
487 EXCEPTION
488 WHEN FND_API.G_EXC_ERROR THEN
489 ROLLBACK TO CS_ServiceRequest_CUHK;
490 x_return_status := FND_API.G_RET_STS_ERROR;
491 FND_MSG_PUB.Count_And_Get
492 ( p_count => x_msg_count,
493 p_data => x_msg_data );
494 WHEN OTHERS THEN
495 ROLLBACK TO CS_ServiceRequest_CUHK;
496 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
497 IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
498 FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
499 END IF;
500 FND_MSG_PUB.Count_And_Get
501 ( p_count => x_msg_count,
502 p_data => x_msg_data
503 );
504 END;
505
506 FUNCTION Ok_To_Generate_Msg
507 (p_request_id IN NUMBER,
508 p_service_request_rec IN CS_ServiceRequest_PVT.service_request_rec_type)
509 RETURN BOOLEAN IS
510 Begin
511 --Return IBU_SR_CUHK.Ok_To_Generate_Msg(p_request_id, p_service_request_rec);
512 NULL;
513 End;
514
515 FUNCTION Ok_To_Launch_Workflow
516 ( p_request_id IN NUMBER,
517 p_service_request_rec IN CS_ServiceRequest_PVT.service_request_rec_type)
518 RETURN BOOLEAN IS
519 Begin
520 return false;
521 End;
522
523
524 END cs_servicerequest_cuhk;