DBA Data[Home] [Help]

PACKAGE BODY: APPS.CCT_OTHERATTRIBINIT_PUB

Source


1 PACKAGE BODY CCT_OTHERATTRIBINIT_PUB  as
2 /* $Header: cctothrb.pls 120.0 2005/06/02 09:44:03 appldev noship $ */
3 
4 
5 G_PKG_NAME CONSTANT VARCHAR2(30) := 'CCT_OTHERATTRIBINIT_PUB';
6 
7 /* -----------------------------------------------------------------------
8 1   Activity Name : WF_SR_Exists (branch node)
9      To check if the Service Request Number already exists
10    IN
11     itemtype  - item type
12     itemkey   - item key
13     actid     - process activity instance id
14     funmode   - execution mode
15    OUT
16     comparison result (WFSTD_YES_NO lookup code)
17    ITEM ATTRIBUTES REFERENCED
18     ServiceRequestNum   - the Service Request Number
19 *-----------------------------------------------------------------------*/
20 procedure WF_SR_Exists (
21 	itemtype   	in varchar2
22 	, itemkey  	in varchar2
23 	, actid    	in number
24 	, funmode 	in varchar2
25 	, resultout 	in  out nocopy  varchar2) IS
26 
27     l_proc_name     VARCHAR2(30) := 'WF_SR_Exists';
28     l_party_id   NUMBER;
29     l_cct_party_id_key VARCHAR2(64):='SERVICEREQUESTNUM';
30   BEGIN
31 
32     IF (funmode <> 'RUN') THEN
33 	resultout := wf_engine.eng_null;
34 	return;
35     end if;
36 
37     -- set default result
38     resultout := wf_engine.eng_completed || ':N';
39 
40     l_party_id  := WF_ENGINE.GetItemAttrNumber(itemtype,itemkey,upper(l_cct_party_id_key));
41     if (l_party_id IS NOT NULL) then
42         resultout := wf_engine.eng_completed || ':Y';
43     end if;
44 
45   EXCEPTION
46     WHEN OTHERS THEN
47       -- if the customer id is not found
48       if (WF_CORE.Error_Name = 'WFENG_ITEM_ATTR') then
49          WF_CORE.CLEAR;
50          -- default result returned
51          return;
52       end if;
53 
54       -- for other errors
55        WF_CORE.Context(G_PKG_NAME, l_proc_name,  itemtype,
56                         itemkey, to_char(actid), funmode);
57       RAISE;
58 
59 end WF_SR_Exists;
60 /* -----------------------------------------------------------------------
61    Activity Name : WF_AccountNum_Exists (branch node)
62      To check if the Account Number already exists
63    IN
64     itemtype  - item type
65     itemkey   - item key
66     actid     - process activity instance id
67     funmode   - execution mode
68    OUT
69     comparison result (WFSTD_YES_NO lookup code)
70    ITEM ATTRIBUTES REFERENCED
71     AccountCode   - the Account Number
72 *-----------------------------------------------------------------------*/
73 procedure WF_AccountNum_Exists (
74 	itemtype   	in varchar2
75 	, itemkey  	in varchar2
76 	, actid    	in number
77 	, funmode 	in varchar2
78 	, resultout 	in  out nocopy  varchar2) IS
79 
80     l_proc_name     VARCHAR2(30) := 'WF_AccountNum_Exists';
81     l_party_id   NUMBER;
82     l_cct_party_id_key VARCHAR2(64):='ACCOUNTCODE';
83   BEGIN
84 
85     IF (funmode <> 'RUN') THEN
86 	resultout := wf_engine.eng_null;
87 	return;
88     end if;
89 
90     -- set default result
91     resultout := wf_engine.eng_completed || ':N';
92 
93     l_party_id  := WF_ENGINE.GetItemAttrNumber(itemtype,itemkey,upper(l_cct_party_id_key));
94     if (l_party_id IS NOT NULL) then
95         resultout := wf_engine.eng_completed || ':Y';
96     end if;
97 
98   EXCEPTION
99     WHEN OTHERS THEN
100       -- if the customer id is not found
101       if (WF_CORE.Error_Name = 'WFENG_ITEM_ATTR') then
102          WF_CORE.CLEAR;
103          -- default result returned
104          return;
105       end if;
106 
107       -- for other errors
108        WF_CORE.Context(G_PKG_NAME, l_proc_name,  itemtype,
109                         itemkey, to_char(actid), funmode);
110       RAISE;
111 
112 end ;
113 /* -----------------------------------------------------------------------
114    Activity Name : WF_ANI_Exists (branch node)
115      To check if the ANI already exists
116    IN
117     itemtype  - item type
118     itemkey   - item key
119     actid     - process activity instance id
120     funmode   - execution mode
121    OUT
122     comparison result (WFSTD_YES_NO lookup code)
123    ITEM ATTRIBUTES REFERENCED
124     ANI   - the ANI
125 *-----------------------------------------------------------------------*/
126 procedure WF_ANI_Exists (
127 	itemtype   	in varchar2
128 	, itemkey  	in varchar2
129 	, actid    	in number
130 	, funmode 	in varchar2
131 	, resultout 	in  out nocopy  varchar2) IS
132 
133     l_proc_name     VARCHAR2(30) := 'WF_ANI_Exists';
134     l_party_id   NUMBER;
135     l_cct_party_id_key VARCHAR2(64):='OCCTANI';
136   BEGIN
137 
138     IF (funmode <> 'RUN') THEN
139 	resultout := wf_engine.eng_null;
140 	return;
141     end if;
142 
143     -- set default result
144     resultout := wf_engine.eng_completed || ':N';
145 
146     l_party_id  := WF_ENGINE.GetItemAttrNumber(itemtype,itemkey,upper(l_cct_party_id_key));
147     if (l_party_id IS NOT NULL) then
148         resultout := wf_engine.eng_completed || ':Y';
149     end if;
150 
151   EXCEPTION
152     WHEN OTHERS THEN
153       -- if the customer id is not found
154       if (WF_CORE.Error_Name = 'WFENG_ITEM_ATTR') then
155          WF_CORE.CLEAR;
156          -- default result returned
157          return;
158       end if;
159 
160       -- for other errors
161        WF_CORE.Context(G_PKG_NAME, l_proc_name,  itemtype,
162                         itemkey, to_char(actid), funmode);
163       RAISE;
164 
165 end ;
166 
167 /* -----------------------------------------------------------------------
168    Activity Name : WF_CollateralReqNum_Exists (branch node)
169      To check if the Collateral Request Number already exists
170    IN
171     itemtype  - item type
172     itemkey   - item key
173     actid     - process activity instance id
174     funmode   - execution mode
175    OUT
176     comparison result (WFSTD_YES_NO lookup code)
177    ITEM ATTRIBUTES REFERENCED
178    CollateralReqNum - Collateral Request Number
179 *-----------------------------------------------------------------------*/
180 procedure WF_CollateralReqNum_Exists (
181 	itemtype   	in varchar2
182 	, itemkey  	in varchar2
183 	, actid    	in number
184 	, funmode 	in varchar2
185 	, resultout 	in  out nocopy  varchar2) IS
186 
187     l_proc_name     VARCHAR2(30) := 'WF_CollateralReqNum_Exists';
188     l_party_id   NUMBER;
189     l_cct_party_id_key VARCHAR2(64):='CollateralReq';
190   BEGIN
191 
192     IF (funmode <> 'RUN') THEN
193 	resultout := wf_engine.eng_null;
194 	return;
195     end if;
196 
197     -- set default result
198     resultout := wf_engine.eng_completed || ':N';
199 
200     l_party_id  := WF_ENGINE.GetItemAttrNumber(itemtype,itemkey,upper(l_cct_party_id_key));
201     if (l_party_id IS NOT NULL) then
202         resultout := wf_engine.eng_completed || ':Y';
203     end if;
204 
205   EXCEPTION
206     WHEN OTHERS THEN
207       -- if the customer id is not found
208       if (WF_CORE.Error_Name = 'WFENG_ITEM_ATTR') then
209          WF_CORE.CLEAR;
210          -- default result returned
211          return;
212       end if;
213 
214       -- for other errors
215        WF_CORE.Context(G_PKG_NAME, l_proc_name,  itemtype,
216                         itemkey, to_char(actid), funmode);
217       RAISE;
218 
219 end ;
220 /* -----------------------------------------------------------------------
221    Activity Name : WF_ContractNum_Exists (branch node)
222      To check if the Contract Number already exists
223    IN
224     itemtype  - item type
225     itemkey   - item key
226     actid     - process activity instance id
227     funmode   - execution mode
228    OUT
229     comparison result (WFSTD_YES_NO lookup code)
230    ITEM ATTRIBUTES REFERENCED
231    ContractNum - Contract Number
232 *-----------------------------------------------------------------------*/
233 procedure WF_ContractNum_Exists (
234 	itemtype   	in varchar2
235 	, itemkey  	in varchar2
236 	, actid    	in number
237 	, funmode 	in varchar2
238 	, resultout 	in  out nocopy  varchar2)IS
239 
240     l_proc_name     VARCHAR2(30) := 'WF_ContractNum_Exists';
241     l_party_id   NUMBER;
242     l_cct_party_id_key VARCHAR2(64):='ContractNum';
243   BEGIN
244 
245     IF (funmode <> 'RUN') THEN
246 	resultout := wf_engine.eng_null;
247 	return;
248     end if;
249 
250     -- set default result
251     resultout := wf_engine.eng_completed || ':N';
252 
253     l_party_id  := WF_ENGINE.GetItemAttrNumber(itemtype,itemkey,upper(l_cct_party_id_key));
254     if (l_party_id IS NOT NULL) then
255         resultout := wf_engine.eng_completed || ':Y';
256     end if;
257 
258   EXCEPTION
259     WHEN OTHERS THEN
260       -- if the customer id is not found
261       if (WF_CORE.Error_Name = 'WFENG_ITEM_ATTR') then
262          WF_CORE.CLEAR;
263          -- default result returned
264          return;
265       end if;
266 
267       -- for other errors
268        WF_CORE.Context(G_PKG_NAME, l_proc_name,  itemtype,
269                         itemkey, to_char(actid), funmode);
270       RAISE;
271 
272 end ;
273 
274 /* -----------------------------------------------------------------------
275    Activity Name : WF_EventCode_Exists (branch node)
276      To check if the Event Registration Code already exists
277    IN
278     itemtype  - item type
279     itemkey   - item key
280     actid     - process activity instance id
281     funmode   - execution mode
282    OUT
283     comparison result (WFSTD_YES_NO lookup code)
284    ITEM ATTRIBUTES REFERENCED
285    EventCode - Event Registration Code
286 *-----------------------------------------------------------------------*/
287 procedure WF_EventCode_Exists (
288 	itemtype   	in varchar2
289 	, itemkey  	in varchar2
290 	, actid    	in number
291 	, funmode 	in varchar2
292 	, resultout 	in  out nocopy  varchar2) IS
293 	    l_proc_name     VARCHAR2(30) := 'WF_EventCode_Exists';
294     l_party_id   NUMBER;
295     l_cct_party_id_key VARCHAR2(64):='EventCode';
296   BEGIN
297 
298     IF (funmode <> 'RUN') THEN
299 	resultout := wf_engine.eng_null;
300 	return;
301     end if;
302 
303     -- set default result
304     resultout := wf_engine.eng_completed || ':N';
305 
306     l_party_id  := WF_ENGINE.GetItemAttrNumber(itemtype,itemkey,upper(l_cct_party_id_key));
307     if (l_party_id IS NOT NULL) then
308         resultout := wf_engine.eng_completed || ':Y';
309     end if;
310 
311   EXCEPTION
312     WHEN OTHERS THEN
313       -- if the customer id is not found
314       if (WF_CORE.Error_Name = 'WFENG_ITEM_ATTR') then
315          WF_CORE.CLEAR;
316          -- default result returned
317          return;
318       end if;
319 
320       -- for other errors
321        WF_CORE.Context(G_PKG_NAME, l_proc_name,  itemtype,
322                         itemkey, to_char(actid), funmode);
323       RAISE;
324 
325 end ;
326 /* -----------------------------------------------------------------------
327    Activity Name : WF_MarketingPIN_Exists (branch node)
328      To check if the Event Registration Code already exists
329    IN
330     itemtype  - item type
331     itemkey   - item key
332     actid     - process activity instance id
333     funmode   - execution mode
334    OUT
335     comparison result (WFSTD_YES_NO lookup code)
336    ITEM ATTRIBUTES REFERENCED
337    MarketingPIN
338 *-----------------------------------------------------------------------*/
339 procedure WF_MarketingPIN_Exists (
340 	itemtype   	in varchar2
341 	, itemkey  	in varchar2
342 	, actid    	in number
343 	, funmode 	in varchar2
344 	, resultout 	in  out nocopy  varchar2) IS
345 	l_proc_name     VARCHAR2(60) := 'WF_MarketingPIN_Exists';
346     l_party_id   NUMBER;
347     l_cct_party_id_key VARCHAR2(64):='MarketingPIN';
348   BEGIN
349 
350     IF (funmode <> 'RUN') THEN
351 	resultout := wf_engine.eng_null;
352 	return;
353     end if;
354 
355     -- set default result
356     resultout := wf_engine.eng_completed || ':N';
357 
358     l_party_id  := WF_ENGINE.GetItemAttrNumber(itemtype,itemkey,upper(l_cct_party_id_key));
359     if (l_party_id IS NOT NULL) then
360         resultout := wf_engine.eng_completed || ':Y';
361     end if;
362 
363   EXCEPTION
364     WHEN OTHERS THEN
365       -- if the customer id is not found
366       if (WF_CORE.Error_Name = 'WFENG_ITEM_ATTR') then
367          WF_CORE.CLEAR;
368          -- default result returned
369          return;
370       end if;
371 
372       -- for other errors
373        WF_CORE.Context(G_PKG_NAME, l_proc_name,  itemtype,
374                         itemkey, to_char(actid), funmode);
375       RAISE;
376 
377 end ;
378 
379 /* -----------------------------------------------------------------------
380    Activity Name : WF_OrderNum_Exists (branch node)
381      To check if the OrderNum already exists
382    IN
383     itemtype  - item type
384     itemkey   - item key
385     actid     - process activity instance id
386     funmode   - execution mode
387    OUT
388     comparison result (WFSTD_YES_NO lookup code)
389    ITEM ATTRIBUTES REFERENCED
390   OrderNum
391 *-----------------------------------------------------------------------*/
392 procedure WF_ORderNum_Exists (
393 	itemtype   	in varchar2
394 	, itemkey  	in varchar2
395 	, actid    	in number
396 	, funmode 	in varchar2
397 	, resultout 	in  out nocopy  varchar2) IS
398 	l_proc_name     VARCHAR2(60) := 'WF_OrderNum_Exists';
399     l_party_id   NUMBER;
400     l_cct_party_id_key VARCHAR2(64):='OrderNum';
401   BEGIN
402 
403     IF (funmode <> 'RUN') THEN
404 	resultout := wf_engine.eng_null;
405 	return;
406     end if;
407 
408     -- set default result
409     resultout := wf_engine.eng_completed || ':N';
410 
411     l_party_id  := WF_ENGINE.GetItemAttrNumber(itemtype,itemkey,upper(l_cct_party_id_key));
412     if (l_party_id IS NOT NULL) then
413         resultout := wf_engine.eng_completed || ':Y';
414     end if;
415 
416   EXCEPTION
417     WHEN OTHERS THEN
418       -- if the customer id is not found
419       if (WF_CORE.Error_Name = 'WFENG_ITEM_ATTR') then
420          WF_CORE.CLEAR;
421          -- default result returned
422          return;
423       end if;
424 
425       -- for other errors
426        WF_CORE.Context(G_PKG_NAME, l_proc_name,  itemtype,
427                         itemkey, to_char(actid), funmode);
428       RAISE;
429 
430 end ;
431 /* -----------------------------------------------------------------------
432    Activity Name : WF_CustomerNum_Exists (branch node)
433      To check if the Event Registration Code already exists
434    IN
435     itemtype  - item type
436     itemkey   - item key
437     actid     - process activity instance id
438     funmode   - execution mode
439    OUT
440     comparison result (WFSTD_YES_NO lookup code)
441    ITEM ATTRIBUTES REFERENCED
442    CustomerNum
443 *-----------------------------------------------------------------------*/
444 procedure WF_CustomerNum_Exists (
445 	itemtype   	in varchar2
449 	, resultout 	in  out nocopy  varchar2) IS
446 	, itemkey  	in varchar2
447 	, actid    	in number
448 	, funmode 	in varchar2
450 	l_proc_name     VARCHAR2(60) := 'WF_CustomerNum_Exists';
451     l_party_id   NUMBER;
452     l_cct_party_id_key VARCHAR2(64):='CustomerNum';
453   BEGIN
454 
455     IF (funmode <> 'RUN') THEN
456 	resultout := wf_engine.eng_null;
457 	return;
458     end if;
459 
460     -- set default result
461     resultout := wf_engine.eng_completed || ':N';
462 
463     l_party_id  := WF_ENGINE.GetItemAttrNumber(itemtype,itemkey,upper(l_cct_party_id_key));
464     if (l_party_id IS NOT NULL) then
465         resultout := wf_engine.eng_completed || ':Y';
466     end if;
467 
468   EXCEPTION
469     WHEN OTHERS THEN
470       -- if the customer id is not found
471       if (WF_CORE.Error_Name = 'WFENG_ITEM_ATTR') then
472          WF_CORE.CLEAR;
473          -- default result returned
474          return;
475       end if;
476 
477       -- for other errors
478        WF_CORE.Context(G_PKG_NAME, l_proc_name,  itemtype,
479                         itemkey, to_char(actid), funmode);
480       RAISE;
481 
482 end ;
483 /* -----------------------------------------------------------------------
484    Activity Name : WF_QuoteNum_Exists (branch node)
485      To check if the QuoteNum already exists
486    IN
487     itemtype  - item type
488     itemkey   - item key
489     actid     - process activity instance id
490     funmode   - execution mode
491    OUT
492     comparison result (WFSTD_YES_NO lookup code)
493    ITEM ATTRIBUTES REFERENCED
494    QuoteNum
495 *-----------------------------------------------------------------------*/
496 procedure WF_QuoteNum_Exists (
497 	itemtype   	in varchar2
498 	, itemkey  	in varchar2
499 	, actid    	in number
500 	, funmode 	in varchar2
501 	, resultout 	in  out nocopy  varchar2) IS
502 	l_proc_name     VARCHAR2(60) := 'WF_QuoteNum_Exists';
503     l_party_id   NUMBER;
504     l_cct_party_id_key VARCHAR2(64):='QuoteNum';
505   BEGIN
506 
507     IF (funmode <> 'RUN') THEN
508 	resultout := wf_engine.eng_null;
509 	return;
510     end if;
511 
512     -- set default result
513     resultout := wf_engine.eng_completed || ':N';
514 
515     l_party_id  := WF_ENGINE.GetItemAttrNumber(itemtype,itemkey,upper(l_cct_party_id_key));
516     if (l_party_id IS NOT NULL) then
517         resultout := wf_engine.eng_completed || ':Y';
518     end if;
519 
520   EXCEPTION
521     WHEN OTHERS THEN
522       -- if the customer id is not found
523       if (WF_CORE.Error_Name = 'WFENG_ITEM_ATTR') then
524          WF_CORE.CLEAR;
525          -- default result returned
526          return;
527       end if;
528 
529       -- for other errors
530        WF_CORE.Context(G_PKG_NAME, l_proc_name,  itemtype,
531                         itemkey, to_char(actid), funmode);
532       RAISE;
533 
534 end ;
535 /* -----------------------------------------------------------------------
536    Activity Name : WF_ServiceKey_Exists (branch node)
537      To check if the ServiceKey already exists
538    IN
539     itemtype  - item type
540     itemkey   - item key
541     actid     - process activity instance id
542     funmode   - execution mode
543    OUT
544     comparison result (WFSTD_YES_NO lookup code)
545    ITEM ATTRIBUTES REFERENCED
546    ServiceKey
547 *-----------------------------------------------------------------------*/
548 procedure WF_ServiceKey_Exists (
549 	itemtype   	in varchar2
550 	, itemkey  	in varchar2
551 	, actid    	in number
552 	, funmode 	in varchar2
553 	, resultout 	in  out nocopy  varchar2) IS
554 	l_proc_name     VARCHAR2(60) := 'WF_ServiceKey_Exists';
555     l_party_id   NUMBER;
556     l_cct_party_id_key VARCHAR2(64):='ServiceKey';
557   BEGIN
558 
559     IF (funmode <> 'RUN') THEN
560 	resultout := wf_engine.eng_null;
561 	return;
562     end if;
563 
564     -- set default result
565     resultout := wf_engine.eng_completed || ':N';
566 
567     l_party_id  := WF_ENGINE.GetItemAttrNumber(itemtype,itemkey,upper(l_cct_party_id_key));
568     if (l_party_id IS NOT NULL) then
569         resultout := wf_engine.eng_completed || ':Y';
570     end if;
571 
572   EXCEPTION
573     WHEN OTHERS THEN
574       -- if the customer id is not found
575       if (WF_CORE.Error_Name = 'WFENG_ITEM_ATTR') then
576          WF_CORE.CLEAR;
577          -- default result returned
578          return;
579       end if;
580 
581       -- for other errors
582        WF_CORE.Context(G_PKG_NAME, l_proc_name,  itemtype,
583                         itemkey, to_char(actid), funmode);
584       RAISE;
585 
586 end ;
587 /* -----------------------------------------------------------------------
588    Activity Name : WF_SourceCode_Exists (branch node)
589      To check if the Source Code already exists
590    IN
591     itemtype  - item type
592     itemkey   - item key
593     actid     - process activity instance id
594     funmode   - execution mode
595    OUT
596     comparison result (WFSTD_YES_NO lookup code)
597    Source Code
598 *-----------------------------------------------------------------------*/
599 procedure WF_SourceCode_Exists (
600 	itemtype   	in varchar2
601 	, itemkey  	in varchar2
602 	, actid    	in number
603 	, funmode 	in varchar2
604 	, resultout 	in  out nocopy  varchar2) IS
605 	l_proc_name     VARCHAR2(60) := 'WF_SourceCode_Exists';
606     l_source_code   VARCHAR2(255);
607     l_cct_party_id_key VARCHAR2(64):='SourceCode';
608   BEGIN
609 
610     IF (funmode <> 'RUN') THEN
611 	resultout := wf_engine.eng_null;
612 	return;
613     end if;
614 
615     -- set default result
616     resultout := wf_engine.eng_completed || ':N';
617 
618     l_source_code  := WF_ENGINE.GetItemAttrText(itemtype,itemkey,upper(l_cct_party_id_key));
619     --dbms_output.put_line('SourceCodeexists?='||l_source_code);
620     if (l_source_code IS NOT NULL) then
621         resultout := wf_engine.eng_completed || ':Y';
622     end if;
623 
624   EXCEPTION
625     WHEN OTHERS THEN
626       -- if the customer id is not found
627       if (WF_CORE.Error_Name = 'WFENG_ITEM_ATTR') then
628          WF_CORE.CLEAR;
629          -- default result returned
630          return;
631       end if;
632 
633       -- for other errors
634        WF_CORE.Context(G_PKG_NAME, l_proc_name,  itemtype,
635                         itemkey, to_char(actid), funmode);
636       RAISE;
637 
638 end ;
639 END CCT_OTHERATTRIBINIT_PUB;