[Home] [Help]
PACKAGE BODY: APPS.CCT_BANKROUTING_PUB
Source
1 PACKAGE BODY CCT_BANKROUTING_PUB as
2 /* $Header: cctrbnkb.pls 115.6 2003/08/23 01:43:32 gvasvani ship $ */
3
4 G_PKG_NAME CONSTANT VARCHAR2(30) := 'CCT_BANKROUTING_PUB';
5
6 procedure Get_Group_from_Profitability (
7 itemtype in varchar2
8 , itemkey in varchar2
9 , actid in number
10 , funmode in varchar2
11 , resultout in out nocopy varchar2) IS
12
13 l_proc_name VARCHAR2(30) := 'Get_Group_from_Profitability';
14 l_customer_id NUMBER;
15 -- l_group_tbl FPT_ROUTING_UTIL.resource_tbl_type;
16 l_agents_tbl CCT_RoutingWorkflow_UTL.agent_tbl_type;
17 l_num_agents NUMBER := 0;
18 l_call_ID VARCHAR2(32);
19 l_num_groups NUMBER :=0;
20 BEGIN
21 -- set default result
22 resultout := wf_engine.eng_completed ;
23
24 IF (funmode = 'RUN') THEN
25 l_customer_id := WF_ENGINE.GetItemAttrNumber(itemtype,itemkey,CCT_INTERACTIONKEYS_PUB.KEY_CUSTOMER_ID );
26 l_call_ID := WF_ENGINE.GetItemAttrText(
27 itemtype, itemkey, 'OCCTMEDIAITEMID');
28
29 IF ( (l_customer_ID IS NULL) OR (l_call_ID IS NULL) ) THEN
30 return;
31 END IF;
32 /* commented to remove dependency
33 -- call FPT API
34 l_num_groups :=
35 FPT_ROUTING_UTIL.CustID_profitability_GroupID
36 ( p_customer_id => l_customer_id
37 , x_resource_tbl => l_group_tbl) ;
38 -- If group_id is null do nothing
39 IF (l_num_groups = 0) THEN
40 return;
41 END IF;
42
43 l_num_agents := CCT_RoutingWorkflow_UTL.Get_Agents_From_Group_Id(
44 l_group_tbl, l_agents_tbl);
45
46 */
47 IF (l_num_agents = 0) THEN
48 return;
49 END IF;
50
51 -- insert the agents into the CCT_TEMPAGENTS table
52 CCT_RoutingWorkflow_UTL.InsertResults
53 (l_call_ID, 'BNK_AGENT_FROM_PROFITABILITY' , l_agents_tbl);
54
55 END IF;
56
57 EXCEPTION
58 WHEN OTHERS THEN
59 WF_CORE.Context(G_PKG_NAME, l_proc_name,
60 itemtype, itemkey, to_char(actid), funmode);
61 RAISE;
62 END Get_Group_from_Profitability;
63
64 procedure Get_Group_from_Bank_Id (
65 itemtype in varchar2
66 , itemkey in varchar2
67 , actid in number
68 , funmode in varchar2
69 , resultout in out nocopy varchar2) IS
70
71 l_proc_name VARCHAR2(30) := 'Get_Group_from_Bank_Id';
72 l_customer_id NUMBER;
73 --l_group_tbl FPT_ROUTING_UTIL.resource_tbl_type;
74 l_agents_tbl CCT_RoutingWorkflow_UTL.agent_tbl_type;
75 l_num_agents NUMBER := 0;
76 l_call_ID VARCHAR2(32);
77 l_num_groups NUMBER :=0;
78
79 BEGIN
80 -- set default result
81 resultout := wf_engine.eng_completed ;
82
83 IF (funmode = 'RUN') THEN
84 l_customer_id := WF_ENGINE.GetItemAttrNumber(itemtype,itemkey,CCT_INTERACTIONKEYS_PUB.KEY_CUSTOMER_ID );
85 l_call_ID := WF_ENGINE.GetItemAttrText(
86 itemtype, itemkey, 'OCCTMEDIAITEMID');
87
88 IF ( (l_customer_ID IS NULL) OR (l_call_ID IS NULL) ) THEN
89 return;
90 END IF;
91 -- call FPT API
92 /*
93 l_num_groups :=
94 FPT_ROUTING_UTIL.CustID_bank_GroupID
95 ( p_customer_id => l_customer_id
96 , x_resource_tbl => l_group_tbl) ;
97
98 -- If group_id is null do nothing
99 IF (l_num_groups = 0) THEN
100 return;
101 END IF;
102
103 l_num_agents := CCT_RoutingWorkflow_UTL.Get_Agents_From_Group_Id(
104 l_group_tbl, l_agents_tbl);
105 */
106
107 IF (l_num_agents = 0) THEN
108 return;
109 END IF;
110
111 -- insert the agents into the CCT_TEMPAGENTS table
112 CCT_RoutingWorkflow_UTL.InsertResults
113 (l_call_ID, 'BNK_AGENT_FROM_BANK_ID' , l_agents_tbl);
114
115 END IF;
116
117
118 EXCEPTION
119 WHEN OTHERS THEN
120 WF_CORE.Context(G_PKG_NAME, l_proc_name,
121 itemtype, itemkey, to_char(actid), funmode);
122 RAISE;
123 END Get_Group_from_Bank_Id;
124
125 procedure Get_Group_from_Bank_Branch (
126 itemtype in varchar2
127 , itemkey in varchar2
128 , actid in number
129 , funmode in varchar2
130 , resultout in out nocopy varchar2) IS
131
132 l_proc_name VARCHAR2(30) := 'Get_Group_from_Bank_Branch';
133 l_customer_id NUMBER;
134 --l_group_tbl FPT_ROUTING_UTIL.resource_tbl_type;
135 l_agents_tbl CCT_RoutingWorkflow_UTL.agent_tbl_type;
136 l_num_agents NUMBER := 0;
137 l_call_ID VARCHAR2(32);
138 l_num_groups NUMBER :=0;
139
140 BEGIN
141
142 -- set default result
143 resultout := wf_engine.eng_completed ;
144
145 IF (funmode = 'RUN') THEN
146 l_customer_id := WF_ENGINE.GetItemAttrNumber(itemtype,itemkey,CCT_INTERACTIONKEYS_PUB.KEY_CUSTOMER_ID );
147 l_call_ID := WF_ENGINE.GetItemAttrText(
148 itemtype, itemkey, 'OCCTMEDIAITEMID');
149
150 IF ( (l_customer_ID IS NULL) OR (l_call_ID IS NULL) ) THEN
151 return;
152 END IF;
153 /*
154 -- call FPT API
155 l_num_groups :=
156 FPT_ROUTING_UTIL.CustID_branch_GroupID
157 ( p_customer_id => l_customer_id
158 , x_resource_tbl => l_group_tbl) ;
159
160 -- If group_id is null do nothing
161 IF (l_num_groups = 0) THEN
162 return;
163 END IF;
164
165 l_num_agents := CCT_RoutingWorkflow_UTL.Get_Agents_From_Group_Id(
166 l_group_tbl, l_agents_tbl);
167 */
168 IF (l_num_agents = 0) THEN
169 return;
170 END IF;
171
172 -- insert the agents into the CCT_TEMPAGENTS table
173 CCT_RoutingWorkflow_UTL.InsertResults
174 (l_call_ID, 'BNK_AGENT_FROM_BANK_BRANCH' , l_agents_tbl);
175
176 END IF;
177
178 EXCEPTION
179 WHEN OTHERS THEN
180 WF_CORE.Context(G_PKG_NAME, l_proc_name,
181 itemtype, itemkey, to_char(actid), funmode);
182 RAISE;
183 END Get_Group_from_Bank_Branch;
184
185
186 END CCT_BANKROUTING_PUB;