1 PACKAGE BODY CCT_Default_Lookup_PUB as
2 /* $Header: cctdefcb.pls 120.0 2005/06/02 10:04:29 appldev noship $ */
3
4 /*------------------------------------------------------------------------
5 REM Group : Customer Initialization Phase
6 REM Get Customer/PartyID from any one of the following Objects if available
7 REM ANI --occtANI
8 REM PARTY_NUMBER --PartyNumber
9 REM QUOTE_NUMBER --QuoteNum
10 REM ORDER_NUMBER --OrderNum
11 REM COLLATERAL_REQUEST --CollateralReq
12 REM ACCOUNT_NUMBER --AccountNum
13 REM EVENT_REGISTRATION_CODE --EventCode
14 REM MARKETING_PIN --MarketingPin
15 REM SERVICE_KEY --ServiceKey
16 REM SERVICE_REQUEST_NUMBER --ServiceRequestNum
17 REM
18 REM using an api provided by Telesales team
19 REM
20 REM-----------------------------------------------------------------------*/
21
22 Function GetData(x_key_value_varr IN OUT NOCOPY CCT_KEYVALUE_VARR)
23 Return Varchar2
24 IS
25 p_cct_object_type_1 VARCHAR2(255):=CCT_INTERACTIONKEYS_PUB.KEY_SERVICE_REQUEST_NUMBER;
26 p_cct_object_type_2 VARCHAR2(255):=CCT_INTERACTIONKEYS_PUB.KEY_PARTY_NUMBER;
27 p_cct_object_type_3 VARCHAR2(255):=CCT_INTERACTIONKEYS_PUB.KEY_QUOTE_NUMBER;
28 p_cct_object_type_4 VARCHAR2(255):=CCT_INTERACTIONKEYS_PUB.KEY_ORDER_NUMBER;
29 p_cct_object_type_5 VARCHAR2(255):=CCT_INTERACTIONKEYS_PUB.KEY_COLLATERAL_REQUEST_NUMBER ;
30 p_cct_object_type_6 VARCHAR2(255):=CCT_INTERACTIONKEYS_PUB.KEY_ACCOUNT_NUMBER;
31 p_cct_object_type_7 VARCHAR2(255):=CCT_INTERACTIONKEYS_PUB.KEY_EVENT_REGISTRATION_CODE;
32 p_cct_object_type_8 VARCHAR2(255):=CCT_INTERACTIONKEYS_PUB.KEY_MARKETING_PIN ;
33 p_cct_object_type_9 VARCHAR2(255):=CCT_INTERACTIONKEYS_PUB.KEY_SERVICE_KEY;
34 p_cct_object_type_10 VARCHAR2(255):=CCT_INTERACTIONKEYS_PUB.KEY_ANI;
35
36
37 p_result VARCHAR2(1):='N';
38 p_tmp_result VARCHAR2(4000):='N';
39 p_object_type VARCHAR2(255);
40 p_object_value VARCHAR2(255);
41 p_cct_party_id_Key VARCHAR2(255):=CCT_INTERACTIONKEYS_PUB.KEY_CUSTOMER_ID;
42 p_cct_party_name_key VARCHAR2(255):=CCT_INTERACTIONKEYS_PUB.KEY_CUSTOMER_NAME;
43 p_party_id NUMBER;
44 p_party_name VARCHAR2(255);
45 Begin
46 -- Check if Customer_ID is already present in incoming request. If yes call getPartyForObject
47 -- and retrieve CustomerName for that ID. If no CustomerName can be found then re-try using
48 -- above KEYs.
49
50 p_object_value:=cct_collection_util_pub.get(x_key_value_varr,p_cct_party_id_Key,p_result);
51 if(p_result='Y') then
52 p_object_type:=p_cct_party_id_Key;
53 AST_ROUTING_PUB.getPartyForObject(p_object_type,p_object_value,p_party_name,p_party_id);
54 If ((p_party_id<>AST_ROUTING_PUB.G_NO_PARTY) AND (p_party_id<>AST_ROUTING_PUB.G_MULTIPLE_PARTY)) THEN
55 p_tmp_result:=CCT_collection_util_pub.put(x_key_value_varr,p_cct_party_name_key,p_party_name);
56 p_result:='Y';
57 return p_result;
58 END IF;
59 --dbms_output.put_line('@Start : Value of key '||p_object_type||' and value '||p_object_value);
60
61 end if;
62
63 p_object_value:=cct_collection_util_pub.get(x_key_value_varr,p_cct_object_type_1,p_result);
64 if(p_result='Y') then
65 p_object_type:=p_cct_object_type_1;
66 goto EXECUTE_API;
67 end if;
68 p_object_value:=cct_collection_util_pub.get(x_key_value_varr,p_cct_object_type_2,p_result);
69 if(p_result='Y') then
70 p_object_type:=p_cct_object_type_2;
71 goto EXECUTE_API;
72 end if;
73 p_object_value:=cct_collection_util_pub.get(x_key_value_varr,p_cct_object_type_3,p_result);
74 if(p_result='Y') then
75 p_object_type:=p_cct_object_type_3;
76 goto EXECUTE_API;
77 end if;
78 p_object_value:=cct_collection_util_pub.get(x_key_value_varr,p_cct_object_type_4,p_result);
79 if(p_result='Y') then
80 p_object_type:=p_cct_object_type_4;
81 goto EXECUTE_API;
82 end if;
83 p_object_value:=cct_collection_util_pub.get(x_key_value_varr,p_cct_object_type_5,p_result);
84 if(p_result='Y') then
85 p_object_type:=p_cct_object_type_5;
86 goto EXECUTE_API;
87 end if;
88 p_object_value:=cct_collection_util_pub.get(x_key_value_varr,p_cct_object_type_6,p_result);
89 if(p_result='Y') then
90 p_object_type:=p_cct_object_type_6;
91 goto EXECUTE_API;
92 end if;
93 p_object_value:=cct_collection_util_pub.get(x_key_value_varr,p_cct_object_type_7,p_result);
94 if(p_result='Y') then
95 p_object_type:=p_cct_object_type_7;
96 goto EXECUTE_API;
97 end if;
98 p_object_value:=cct_collection_util_pub.get(x_key_value_varr,p_cct_object_type_8,p_result);
99 if(p_result='Y') then
100 p_object_type:=p_cct_object_type_8;
101 goto EXECUTE_API;
102 end if;
103 p_object_value:=cct_collection_util_pub.get(x_key_value_varr,p_cct_object_type_9,p_result);
104 if(p_result='Y') then
105 p_object_type:=p_cct_object_type_9;
106 goto EXECUTE_API;
107 end if;
108 p_object_value:=cct_collection_util_pub.get(x_key_value_varr,p_cct_object_type_10,p_result);
109 if(p_result='Y') then
110 p_object_type:=p_cct_object_type_10;
111 goto EXECUTE_API;
112 end if;
113
114
115
116 <<EXECUTE_API>>
117 AST_ROUTING_PUB.getPartyForObject(p_object_type,p_object_value,p_party_name,p_party_id);
118 If ((p_party_id<>AST_ROUTING_PUB.G_NO_PARTY) AND (p_party_id<>AST_ROUTING_PUB.G_MULTIPLE_PARTY)) THEN
119 p_tmp_result:=CCT_collection_util_pub.put(x_key_value_varr,p_cct_party_id_key,to_char(p_party_id));
120 p_tmp_result:=CCT_collection_util_pub.put(x_key_value_varr,p_cct_party_name_key,p_party_name);
121 END IF;
122 --dbms_output.put_line('Value of key '||p_object_type||' and value '||p_object_value);
123 --dbms_output.put_line('Value of partyName '||p_party_name||' and p_party_id '||p_party_id);
124 -- Everything succeeded, so mark the operation as success and return it
125 p_result:='Y';
126 return p_result;
127 EXCEPTION
128 WHEN OTHERS THEN
129 p_result:='N';
130 --dbms_output.put_line('Exception : Value of key '||p_object_type||' and value '||p_object_value);
131 return p_result;
132 END;
133
134 END CCT_Default_Lookup_PUB;