[Home] [Help]
PACKAGE BODY: APPS.CCT_COLLECTIONROUTING_PUB
Source
1 PACKAGE BODY CCT_COLLECTIONROUTING_PUB as
2 /* $Header: cctrcolb.pls 115.7 2003/08/23 01:47:49 gvasvani ship $ */
3
4 G_PKG_NAME CONSTANT VARCHAR2(30) := 'CCT_COLLECTIONROUTING_PUB';
5
6 PROCEDURE isCustomerOverdue (
7 itemtype in varchar2
8 , itemkey in varchar2
9 , actid in number
10 , funmode in varchar2
11 , resultout in out nocopy varchar2
12 )
13 IS
14 l_proc_name VARCHAR2(30) := 'isCustomerOverdue';
15 l_return_status VARCHAR2(32);
16 l_msg_count NUMBER;
17 l_msg_data VARCHAR2(32);
18 l_customer_id NUMBER;
19 l_overdue BOOLEAN;
20
21 BEGIN
22 IF (funmode = 'RUN')
23 THEN
24 -- Get the customer id from wf attribute
25 l_customer_id := WF_ENGINE.GetItemAttrNumber (
26 itemtype
27 ,itemkey
28 ,CCT_INTERACTIONKEYS_PUB.KEY_CUSTOMER_ID
29 );
30 /*
31 -- Call IEX api to get overdue status of customer
32 iex_routing_pvt.isCustomerOverdue (
33 p_api_version => '1'
34 , x_return_status => l_return_status
35 , x_msg_count => l_msg_count
36 , x_msg_data => l_msg_data
37 , p_customer_id => l_customer_id
38 , p_customer_overdue => l_overdue
39 );
40 */
41
42 IF l_overdue
43 THEN
44 -- Customer is Overdue return Yes to workflow
45 resultout := wf_engine.eng_completed || ':Y';
46 ELSE
47 -- Customer is Not Overdue return No to workflow
48 resultout := wf_engine.eng_completed || ':N';
49 END IF;
50
51 END IF;
52
53 EXCEPTION
54 WHEN OTHERS THEN
55 WF_CORE.Context(G_PKG_NAME, l_proc_name,
56 itemtype, itemkey, to_char(actid), funmode);
57 RAISE;
58 END isCustomerOverdue;
59
60 PROCEDURE getCollectors (
61 itemtype in varchar2
62 , itemkey in varchar2
63 , actid in number
64 , funmode in varchar2
65 , resultout in out nocopy varchar2
66 )
67 IS
68 l_proc_name VARCHAR2(30) := 'getCollectors';
69 l_return_status VARCHAR2(32);
70 l_msg_count NUMBER;
71 l_msg_data VARCHAR2(32);
72 l_customer_id NUMBER;
73 l_call_id VARCHAR2(32);
74 -- l_collectors iex_routing_pvt.iex_collectors_tbl_type;
75
76 BEGIN
77 IF (funmode = 'RUN')
78 THEN
79 -- set default result
80 resultout := wf_engine.eng_completed ;
81
82 -- Get the customer id from wf attribute
83 l_customer_id := WF_ENGINE.GetItemAttrNumber (
84 itemtype
85 ,itemkey
86 ,CCT_INTERACTIONKEYS_PUB.KEY_CUSTOMER_ID
87 );
88
89 -- Get the customer id from wf attribute
90 l_call_id := WF_ENGINE.GetItemAttrText (
91 itemtype
92 ,itemkey
93 ,'OCCTMEDIAITEMID'
94 );
95 -- If no customer id or call id exists return
96 IF ( (l_customer_ID IS NULL) OR (l_call_ID IS NULL) ) THEN
97 return;
98 END IF;
99 /*
100 -- Call IEX api to get collectors of customer
101 iex_routing_pvt.getCollectors (
102 p_api_version => '1' -- ??
103 , x_return_status => l_return_status
104 , x_msg_count => l_msg_count
105 , x_msg_data => l_msg_data
106 , p_customer_id => l_customer_id
107 , p_collectors => l_collectors
108 );
109 */
110 -- If no collectors exist return
111 IF (l_msg_count = 0) THEN
112 return;
113 END IF;
114
115 -- insert the agents into the CCT_TEMPAGENTS table
116 -- CCT_RoutingWorkflow_UTL.InsertResults
117 -- (l_call_ID, 'IEX_GetCOLLECTORS' , l_collectors);
118
119 END IF;
120
121 EXCEPTION
122 WHEN OTHERS THEN
123 WF_CORE.Context(G_PKG_NAME, l_proc_name,
124 itemtype, itemkey, to_char(actid), funmode);
125 RAISE;
126 END getCollectors;
127
128
129 END CCT_COLLECTIONROUTING_PUB;