DBA Data[Home] [Help]

PACKAGE BODY: APPS.CCT_ROUTINGWORKFLOW_UTL

Source


1 PACKAGE BODY CCT_RoutingWorkflow_UTL  as
2 /* $Header: cctucrob.pls 120.0 2005/06/02 09:06:31 appldev noship $ */
3 
4 ------------------------------------------------------------------------------
5 --  Function	: Get_Result_Code
6 --  Usage	: Used by the Routing module to get the internal result code
7 --		  for a given result lookup type and display name
8 --  Parameters	:
9 --      p_result_lookup_type       IN      VARCHAR2        Required
10 --      p_result_display_name      IN      VARCHAR2        Required
11 --  Return	: VARCHAR2
12 ------------------------------------------------------------------------------
13 FUNCTION Get_Result_Code (
14       p_result_lookup_type       IN      VARCHAR2
15     ,  p_result_display_name      IN      VARCHAR2
16 )
17 RETURN VARCHAR2 IS
18    l_result_code	VARCHAR2(30);
19 BEGIN
20    select lookup_code into l_result_code
21    from   wf_lookups
22    where  lookup_type = p_result_lookup_type
23    and    meaning     = p_result_display_name;
24 
25    return l_result_code;
26 
27   EXCEPTION
28     when OTHERS then
29     return NULL;
30 END Get_Result_Code;
31 
32 ------------------------------------------------------------------------------
33 --  PROCEDURE	: InsertResults
34 --  Usage	: Used by all the filter functions to insert agent results
35 --		  into the CCT_TEMPAGENTS tables
36 --  Parameters	:
37 --      p_call_ID       IN      VARCHAR2        Required
38 --      p_filter_type   IN      VARCHAR2        Required
39 --      p_agent_ID     IN out nocopy VARCHAR2        Required
40 ------------------------------------------------------------------------------
41 PROCEDURE InsertResults (
42       p_call_ID       IN      VARCHAR2
43       , p_filter_type   IN      VARCHAR2
44       , p_agent_ID     IN  out nocopy   VARCHAR2
45 )  IS
46 
47   l_dummyAgent  VARCHAR2(32) := '-1';
48   i             INTEGER;
49 BEGIN
50 
51    insert into CCT_TEMPAGENTS (call_id, agent_id, filter_type,
52 	tempagnet_id,last_update_date,last_updated_by,creation_date,
53 	created_by)
54        values (p_call_id, l_dummyAgent, p_filter_type,
55 	   1001,sysdate,1,sysdate,1);
56 
57    -- insert
58            INSERT INTO CCT_TEMPAGENTS (call_id, agent_id, filter_type,
59 	       tempagnet_id,last_update_date,last_updated_by,creation_date,
60 		  created_by)
61            VALUES ( p_call_ID, p_agent_ID, p_filter_type,
62 	            1002,sysdate,1,sysdate,1);
63 
64 EXCEPTION
65    when OTHERS then
66      return;
67 END INSERTRESULTS;
68 
69 
70 
71 ------------------------------------------------------------------------------
72 --  PROCEDURE	: InsertResults
73 --  Usage	: Used by all the filter functions to insert agent results
74 --		  into the CCT_TEMPAGENTS tables
75 --  Parameters	:
76 --      p_call_ID       IN      VARCHAR2        Required
77 --      p_filter_type   IN      VARCHAR2        Required
78 --      p_agents_tbl     IN out nocopy     agent_tbl_type  Required
79 ------------------------------------------------------------------------------
80 PROCEDURE InsertResults (
81       p_call_ID       IN      VARCHAR2
82       , p_filter_type   IN      VARCHAR2
83       , p_agents_tbl     IN out nocopy     agent_tbl_type
84 ) IS
85 
86   l_dummyAgent  VARCHAR2(32) := '-1';
87   i             INTEGER;
88 BEGIN
89 
90    insert into CCT_TEMPAGENTS (call_id, agent_id, filter_type,
91 	tempagnet_id,last_update_date,last_updated_by,creation_date,
92 	created_by)
93        values (p_call_id, l_dummyAgent, p_filter_type,
94 	   1001,sysdate,1,sysdate,1);
95 
96    -- convert from employee_id to agent_id
97    FOR i in p_agents_tbl.FIRST..p_agents_tbl.LAST LOOP
98 
99            INSERT INTO CCT_TEMPAGENTS (call_id, agent_id, filter_type,
100 	       tempagnet_id,last_update_date,last_updated_by,creation_date,
101 		  created_by)
102            VALUES ( p_call_ID, p_agents_tbl(i), p_filter_type,
103 	            1002,sysdate,1,sysdate,1);
104 
105    end loop;
106 
107 EXCEPTION
108    when OTHERS then
109      return;
110 END INSERTRESULTS;
111 
112 
113 ------------------------------------------------------------------------------
114 --  PROCEDURE	: InsertResults
115 --  Usage	: Used by all the CS filter functions to insert agent results
116 --		  into the CCT_TEMPAGENTS tables
117 --  Parameters	:
118 --      p_call_ID       IN      VARCHAR2        Required
119 --      p_filter_type   IN      VARCHAR2        Required
120 --      p_agents_tbl     IN out nocopy      CS_ROUTING_UTL.emp_tbl_type  Required
121 ------------------------------------------------------------------------------
122 PROCEDURE InsertResults (
123       p_call_ID       IN      VARCHAR2
124       , p_filter_type   IN      VARCHAR2
125       , p_agents_tbl     IN out nocopy      CS_ROUTING_UTL.emp_tbl_type
126 ) IS
127   l_dummyAgent  VARCHAR2(32) := '-1';
128   i             INTEGER;
129 BEGIN
130 
131    insert into CCT_TEMPAGENTS (call_id, agent_id, filter_type,
132 	tempagnet_id,last_update_date,last_updated_by,creation_date,
133 	created_by)
134        values (p_call_id, l_dummyAgent, p_filter_type,
135 	   1001,sysdate,1,sysdate,1);
136 
137    -- convert from employee_id to agent_id
138    FOR i in p_agents_tbl.FIRST..p_agents_tbl.LAST LOOP
139        if (p_agents_tbl(i) IS NOT NULL) then
140            INSERT INTO CCT_TEMPAGENTS (call_id, agent_id, filter_type,
141 	       tempagnet_id,last_update_date,last_updated_by,creation_date,
142 		  created_by)
143            VALUES ( p_call_ID, p_agents_tbl(i), p_filter_type,
144 	            1002,sysdate,1,sysdate,1);
145        end if;
146    end loop;
147 
148 EXCEPTION
149    when OTHERS then
150      return;
151 END INSERTResults;
152 
153 
154 ------------------------------------------------------------------------------
155 --  PROCEDURE	: InsertResults
156 --  Usage	: Used by all the JTF filter functions to insert agent results
157 --		  into the CCT_TEMPAGENTS tables
158 --  Parameters	:
159 --      p_call_ID       IN      VARCHAR2        Required
160 --      p_filter_type   IN      VARCHAR2        Required
161 --      p_agents_tbl     IN out nocopy     JTF_TERRITORY_PUB.WinningTerrMember_tbl_type
162 ------------------------------------------------------------------------------
163 PROCEDURE InsertResults (
164       p_call_ID       IN      VARCHAR2
165       , p_filter_type   IN      VARCHAR2
166       , p_agents_tbl     IN out nocopy JTF_TERRITORY_PUB.WinningTerrMember_tbl_type
167 ) IS
168   l_dummyAgent  VARCHAR2(32) := '-1';
169   i             INTEGER;
170 BEGIN
171 
172    insert into CCT_TEMPAGENTS (call_id, agent_id, filter_type,
173 	tempagnet_id,last_update_date,last_updated_by,creation_date,
174 	created_by)
175        values (p_call_id, l_dummyAgent, p_filter_type,
176 	   1001,sysdate,1,sysdate,1);
177 
178    -- convert from employee_id to agent_id
179    FOR i in p_agents_tbl.FIRST..p_agents_tbl.LAST LOOP
180        if (p_agents_tbl(i).RESOURCE_ID IS NOT NULL) then
181            INSERT INTO CCT_TEMPAGENTS (call_id, agent_id, filter_type,
182 	       tempagnet_id,last_update_date,last_updated_by,creation_date,
183 		  created_by)
184            VALUES ( p_call_ID, p_agents_tbl(i).RESOURCE_ID, p_filter_type,
185 	            1002,sysdate,1,sysdate,1);
186        end if;
187    end loop;
188 
189 EXCEPTION
190    when OTHERS then
191      return;
192 END INSERTResults;
193 
194 ------------------------------------------------------------------------------
195 --  PROCEDURE	: InsertResults
196 --  Usage	: Used by all the telesales filter functions to insert agent results
197 --		  into the CCT_TEMPAGENTS tables
198 --  Parameters	:
199 --      p_call_ID       IN      VARCHAR2        Required
200 --      p_filter_type   IN      VARCHAR2        Required
201 --      p_agents_tbl     IN out nocopy AST_Routing_PUB.resource_access_tbl_type  Required
202 ------------------------------------------------------------------------------
203 PROCEDURE InsertResults (
204       p_call_ID          IN      VARCHAR2
205       , p_filter_type    IN      VARCHAR2
206       , p_agents_tbl     IN out nocopy  AST_Routing_PUB.resource_access_tbl_type
207 ) IS
208   l_dummyAgent  VARCHAR2(32) := '-1';
209   i             INTEGER;
210 BEGIN
211 
212    insert into CCT_TEMPAGENTS (call_id, agent_id, filter_type,
213 	tempagnet_id,last_update_date,last_updated_by,creation_date,
214 	created_by)
215        values (p_call_id, l_dummyAgent, p_filter_type,
216 	   1001,sysdate,1,sysdate,1);
217 
218    FOR i in p_agents_tbl.FIRST..p_agents_tbl.LAST LOOP
219        if (p_agents_tbl(i).resource_id IS NOT NULL) then
220            INSERT INTO CCT_TEMPAGENTS (call_id, agent_id, filter_type,
221 	       tempagnet_id,last_update_date,last_updated_by,creation_date,
222 		  created_by)
223            VALUES ( p_call_ID, p_agents_tbl(i).resource_id, p_filter_type,
224 	            1002,sysdate,1,sysdate,1);
225        end if;
226    end loop;
227 
228 EXCEPTION
229    when OTHERS then
230      return;
231 END INSERTResults;
232 
233 END CCT_RoutingWorkflow_UTL;