DBA Data[Home] [Help]

PACKAGE BODY: APPS.IEX_CO_WF

Source


1 PACKAGE BODY IEX_CO_WF AS
2 /* $Header: IEXRCOWB.pls 120.0 2004/01/24 03:15:16 appldev noship $ */
3   ---------------------------------------------------------------------------
4   -- PROCEDURE notify_customer
5   ---------------------------------------------------------------------------
6 --  PG_DEBUG NUMBER(2) := TO_NUMBER(NVL(FND_PROFILE.value('IEX_DEBUG_LEVEL'), '20'));
7 PG_DEBUG NUMBER := FND_LOG.G_CURRENT_RUNTIME_LEVEL;
8 
9 PROCEDURE notify_customer(itemtype        in varchar2,
10                             itemkey         in varchar2,
11                             actid           in number,
12                             funcmode        in varchar2,
13                             resultout       out NOCOPY varchar2) AS
14     l_delinquency_id NUMBER := NULL;
15     l_api_version NUMBER := 1.0;
16     l_init_msg_list VARCHAR2(1) := fnd_api.g_false;
17     l_return_status VARCHAR2(1);
18     lx_msg_count NUMBER ;
19     lx_msg_data VARCHAR2(2000);
20 
21     CURSOR l_khr_csr(cp_delinquency_id IN NUMBER) IS SELECT ico.object_id
22     FROM iex_delinquencies_all ida
23         ,iex_case_objects ico
24     WHERE ida.delinquency_id = cp_delinquency_id
25     AND ida.case_id = ico.cas_id;
26   BEGIN
27     	if (funcmode = 'RUN') then
28      		l_delinquency_id := wf_engine.GetItemAttrText( itemtype => itemtype,
29 						      	itemkey	=> itemkey,
30 							aname  	=> 'DELINQUENCY_ID');
31 
32                 FOR cur IN l_khr_csr(l_delinquency_id) LOOP
33                   iex_open_interface_pub.insert_pending(
34                     p_api_version => l_api_version,
35                     p_init_msg_list => l_init_msg_list,
36                     p_object1_id1 => cur.object_id,
37                     p_object1_id2 => '#',
38                     p_jtot_object1_code => 'OKX_LEASE',
39                     p_action => IEX_OPI_PVT.ACTION_NOTIFY_CUST,
40                     p_status => IEX_OPI_PVT.STATUS_PENDING_AUTO,
41                     p_comments => OKC_API.G_MISS_CHAR,
42                     p_ext_agncy_id => NULL,
43                     p_review_date => NULL,
44                     p_recall_date => NULL,
45                     p_automatic_recall_flag => NULL,
46                     p_review_before_recall_flag => NULL,
47                     x_return_status => l_return_status,
48                     x_msg_count => lx_msg_count,
49                     x_msg_data => lx_msg_data);
50 
51                   IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
52                     RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
53                   ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
54                     RAISE okl_api.G_EXCEPTION_ERROR;
55                   END IF;
56                 END LOOP;
57 		resultout := 'COMPLETE:';
58          	RETURN ;
59 	end if;
60         --
61         -- CANCEL mode
62         --
63         if (funcmode = 'CANCEL') then
64                 --
65                 resultout := 'COMPLETE:';
66                 return;
67                 --
68         end if;
69         --
70         -- TIMEOUT mode
71         --
72         if (funcmode = 'TIMEOUT') then
73                 --
74                 resultout := 'COMPLETE:';
75                 return;
76                 --
77         end if;
78   EXCEPTION
79      when others then
80        --resultout := wf_engine.eng_completed ||':'||wf_no;
81        wf_core.context('IEX_CO_WF','notify_customer',itemtype,
82                    itemkey,to_char(actid),funcmode);
83        raise;
84   END notify_customer;
85 
86   ---------------------------------------------------------------------------
87   -- PROCEDURE report_customer
88   ---------------------------------------------------------------------------
89   PROCEDURE report_customer(itemtype        in varchar2,
90                             itemkey         in varchar2,
91                             actid           in number,
92                             funcmode        in varchar2,
93                             resultout       out NOCOPY varchar2) AS
94     l_delinquency_id NUMBER := NULL;
95     l_api_version NUMBER := 1.0;
96     l_init_msg_list VARCHAR2(1) := fnd_api.g_false;
97     l_return_status VARCHAR2(1);
98     lx_msg_count NUMBER ;
102     FROM iex_delinquencies_all ida
99     lx_msg_data VARCHAR2(2000);
100 
101     CURSOR l_khr_csr(cp_delinquency_id IN NUMBER) IS SELECT ico.object_id
103         ,iex_case_objects ico
104     WHERE ida.delinquency_id = cp_delinquency_id
105     AND ida.case_id = ico.cas_id;
106   BEGIN
107     	if (funcmode = 'RUN') then
108      		l_delinquency_id := wf_engine.GetItemAttrText( itemtype => itemtype,
109 						      	itemkey	=> itemkey,
110 							aname  	=> 'DELINQUENCY_ID');
111 
112                 FOR cur IN l_khr_csr(l_delinquency_id) LOOP
113                   iex_open_interface_pub.insert_pending(
114                     p_api_version => l_api_version,
115                     p_init_msg_list => l_init_msg_list,
116                     p_object1_id1 => cur.object_id,
117                     p_object1_id2 => '#',
118                     p_jtot_object1_code => 'OKX_LEASE',
119                     p_action => IEX_OPI_PVT.ACTION_REPORT_CB,
120                     p_status => IEX_OPI_PVT.STATUS_PENDING_AUTO,
121                     p_comments => OKC_API.G_MISS_CHAR,
122                     p_ext_agncy_id => NULL,
123                     p_review_date => NULL,
124                     p_recall_date => NULL,
125                     p_automatic_recall_flag => NULL,
126                     p_review_before_recall_flag => NULL,
127                     x_return_status => l_return_status,
128                     x_msg_count => lx_msg_count,
129                     x_msg_data => lx_msg_data);
130 
131                   IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
132                     RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
133                   ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
134                     RAISE okl_api.G_EXCEPTION_ERROR;
135                   END IF;
136                 END LOOP;
137 		resultout := 'COMPLETE:';
138          	RETURN ;
139 	end if;
140         --
141         -- CANCEL mode
142         --
143         if (funcmode = 'CANCEL') then
144                 --
145                 resultout := 'COMPLETE:';
146                 return;
147                 --
148         end if;
149         --
150         -- TIMEOUT mode
151         --
152         if (funcmode = 'TIMEOUT') then
153                 --
154                 resultout := 'COMPLETE:';
155                 return;
156                 --
157         end if;
158   EXCEPTION
159      when others then
160        --resultout := wf_engine.eng_completed ||':'||wf_no;
161        wf_core.context('IEX_CO_WF','report_customer',itemtype,
162                    itemkey,to_char(actid),funcmode);
163        raise;
164   END report_customer;
165 
166   ---------------------------------------------------------------------------
167   -- PROCEDURE transfer_case
168   ---------------------------------------------------------------------------
169   PROCEDURE transfer_case(itemtype        in varchar2,
170                             itemkey         in varchar2,
171                             actid           in number,
172                             funcmode        in varchar2,
173                             resultout       out NOCOPY varchar2) AS
174     l_delinquency_id NUMBER := NULL;
175     l_api_version NUMBER := 1.0;
176     l_init_msg_list VARCHAR2(1) := fnd_api.g_false;
177     l_return_status VARCHAR2(1);
178     lx_msg_count NUMBER ;
179     lx_msg_data VARCHAR2(2000);
180 
181     CURSOR l_khr_csr(cp_delinquency_id IN NUMBER) IS SELECT ico.object_id
182     FROM iex_delinquencies_all ida
183         ,iex_case_objects ico
184     WHERE ida.delinquency_id = cp_delinquency_id
185     AND ida.case_id = ico.cas_id;
186   BEGIN
187     	if (funcmode = 'RUN') then
188      		l_delinquency_id := wf_engine.GetItemAttrText( itemtype => itemtype,
189 						      	itemkey	=> itemkey,
190 							aname  	=> 'DELINQUENCY_ID');
191 
192                 FOR cur IN l_khr_csr(l_delinquency_id) LOOP
193                   iex_open_interface_pub.insert_pending(
194                     p_api_version => l_api_version,
195                     p_init_msg_list => l_init_msg_list,
196                     p_object1_id1 => cur.object_id,
197                     p_object1_id2 => '#',
198                     p_jtot_object1_code => 'OKX_LEASE',
199                     p_action => IEX_OPI_PVT.ACTION_TRANSFER_EXT_AGNCY,
200                     p_status => IEX_OPI_PVT.STATUS_PENDING_AUTO,
201                     p_comments => OKC_API.G_MISS_CHAR,
202                     p_ext_agncy_id => NULL,
203                     p_review_date => NULL,
204                     p_recall_date => NULL,
205                     p_automatic_recall_flag => NULL,
206                     p_review_before_recall_flag => NULL,
207                     x_return_status => l_return_status,
208                     x_msg_count => lx_msg_count,
209                     x_msg_data => lx_msg_data);
210 
211                   IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
212                     RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
213                   ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
214                     RAISE okl_api.G_EXCEPTION_ERROR;
215                   END IF;
216                 END LOOP;
217 		resultout := 'COMPLETE:';
218          	RETURN ;
219 	end if;
220         --
221         -- CANCEL mode
222         --
223         if (funcmode = 'CANCEL') then
224                 --
225                 resultout := 'COMPLETE:';
226                 return;
227                 --
228         end if;
229         --
230         -- TIMEOUT mode
231         --
232         if (funcmode = 'TIMEOUT') then
233                 --
234                 resultout := 'COMPLETE:';
235                 return;
236                 --
237         end if;
238   EXCEPTION
239      when others then
240        --resultout := wf_engine.eng_completed ||':'||wf_no;
241        wf_core.context('IEX_CO_WF','transfer_case',itemtype,
242                    itemkey,to_char(actid),funcmode);
243        raise;
244   END transfer_case;
245 
249   PROCEDURE review_case(itemtype        in varchar2,
246   ---------------------------------------------------------------------------
247   -- PROCEDURE review_case
248   ---------------------------------------------------------------------------
250                             itemkey         in varchar2,
251                             actid           in number,
252                             funcmode        in varchar2,
253                             resultout       out NOCOPY varchar2) AS
254     l_delinquency_id NUMBER := NULL;
255     l_api_version NUMBER := 1.0;
256     l_init_msg_list VARCHAR2(1) := fnd_api.g_false;
257     l_return_status VARCHAR2(1);
258     lx_msg_count NUMBER ;
259     lx_msg_data VARCHAR2(2000);
260 
261     CURSOR l_khr_csr(cp_delinquency_id IN NUMBER) IS SELECT OIN.ID,
262             OIN.KHR_ID,
263             OIN.CAS_ID,
264             IOH.ID HST_ID,
265             IOH.OBJECT1_ID1,
266             IOH.OBJECT1_ID2,
267             IOH.JTOT_OBJECT1_CODE,
268             IOH.ACTION,
269             IOH.STATUS,
270             IOH.REQUEST_DATE,
271             IOH.PROCESS_DATE,
272             IOH.EXT_AGNCY_ID
273     FROM iex_delinquencies_all ida
274         ,iex_case_objects ico
275         ,Okl_Open_Int OIN
276         ,Iex_Open_Int_Hst IOH
277     WHERE ida.delinquency_id = cp_delinquency_id
278     AND ida.case_id = ico.cas_id
279     AND ico.object_id = oin.khr_id
280     AND OIN.khr_id = TO_NUMBER(IOH.object1_id1)
281     AND   IOH.jtot_object1_code = 'OKX_LEASE'
282     AND   (IOH.ACTION = IEX_OPI_PVT.ACTION_TRANSFER_EXT_AGNCY)
283     AND   (IOH.STATUS = IEX_OPI_PVT.STATUS_PROCESSED);
284 
285     l_oinv_rec                 iex_open_interface_pub.oinv_rec_type;
286     lx_oinv_rec                iex_open_interface_pub.oinv_rec_type;
287     l_iohv_rec                 iex_open_interface_pub.iohv_rec_type;
288     lx_iohv_rec                iex_open_interface_pub.iohv_rec_type;
289   BEGIN
290     	if (funcmode = 'RUN') then
291      		l_delinquency_id := wf_engine.GetItemAttrText( itemtype => itemtype,
292 						      	itemkey	=> itemkey,
293 							aname  	=> 'DELINQUENCY_ID');
294 
295                 FOR cur IN l_khr_csr(l_delinquency_id) LOOP
296                   l_oinv_rec.id := cur.id;
297                   l_oinv_rec.khr_id := cur.khr_id;
298                   l_oinv_rec.cas_id := cur.cas_id;
299                   l_iohv_rec.id := cur.hst_id;
300                   l_iohv_rec.object1_id1 := cur.object1_id1;
301                   l_iohv_rec.object1_id2 := cur.object1_id2;
302                   l_iohv_rec.jtot_object1_code := cur.jtot_object1_code;
303                   l_iohv_rec.action := cur.action;
304                   l_iohv_rec.status := cur.status;
305                   l_iohv_rec.request_date := cur.request_date;
306                   l_iohv_rec.process_date := cur.process_date;
307                   l_iohv_rec.ext_agncy_id := cur.ext_agncy_id;
308 
309                   iex_open_interface_pub.review_transfer(
310                     p_api_version => l_api_version,
311                     p_init_msg_list => l_init_msg_list,
315                     x_iohv_rec => lx_iohv_rec,
312                     p_oinv_rec => l_oinv_rec,
313                     p_iohv_rec => l_iohv_rec,
314                     x_oinv_rec => lx_oinv_rec,
316                     x_return_status => l_return_status,
317                     x_msg_count => lx_msg_count,
318                     x_msg_data => lx_msg_data);
319 
320                   IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
321                     RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
322                   ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
323                     RAISE okl_api.G_EXCEPTION_ERROR;
324                   END IF;
325                 END LOOP;
326 		resultout := 'COMPLETE:';
327          	RETURN ;
328 	end if;
329         --
330         -- CANCEL mode
331         --
332         if (funcmode = 'CANCEL') then
333                 --
334                 resultout := 'COMPLETE:';
335                 return;
336                 --
337         end if;
338         --
339         -- TIMEOUT mode
340         --
341         if (funcmode = 'TIMEOUT') then
342                 --
343                 resultout := 'COMPLETE:';
344                 return;
345                 --
346         end if;
347   EXCEPTION
348      when others then
349        --resultout := wf_engine.eng_completed ||':'||wf_no;
350        wf_core.context('IEX_CO_WF','review_case',itemtype,
351                    itemkey,to_char(actid),funcmode);
352        raise;
353   END review_case;
354 
355   ---------------------------------------------------------------------------
356   -- PROCEDURE recall_case
360                             actid           in number,
357   ---------------------------------------------------------------------------
358   PROCEDURE recall_case(itemtype        in varchar2,
359                             itemkey         in varchar2,
361                             funcmode        in varchar2,
362                             resultout       out NOCOPY varchar2) AS
363     l_delinquency_id NUMBER := NULL;
364     l_api_version NUMBER := 1.0;
365     l_init_msg_list VARCHAR2(1) := fnd_api.g_false;
366     l_return_status VARCHAR2(1);
367     lx_msg_count NUMBER ;
368     lx_msg_data VARCHAR2(2000);
369 
370     CURSOR l_khr_csr(cp_delinquency_id IN NUMBER) IS SELECT OIN.ID,
371             OIN.KHR_ID,
372             IOH.ID hst_id,
373             IOH.OBJECT1_ID1,
374             IOH.OBJECT1_ID2,
375             IOH.JTOT_OBJECT1_CODE,
376             IOH.EXT_AGNCY_ID
377     FROM iex_delinquencies_all ida
378         ,iex_case_objects ico
379         ,Okl_Open_Int OIN
380         ,Iex_Open_Int_Hst IOH
381     WHERE ida.delinquency_id = cp_delinquency_id
382     AND ida.case_id = ico.cas_id
383     AND ico.object_id = oin.khr_id
384     AND OIN.khr_id = TO_NUMBER(IOH.object1_id1)
385     AND   IOH.jtot_object1_code = 'OKX_LEASE'
386     AND   (IOH.ACTION = IEX_OPI_PVT.ACTION_TRANSFER_EXT_AGNCY)
387     AND   (IOH.STATUS = IEX_OPI_PVT.STATUS_NOTIFIED OR IOH.STATUS = IEX_OPI_PVT.STATUS_PROCESSED);
388 
389     l_oinv_rec                 iex_open_interface_pub.oinv_rec_type;
390     lx_oinv_rec                iex_open_interface_pub.oinv_rec_type;
391     l_iohv_rec                 iex_open_interface_pub.iohv_rec_type;
392     lx_iohv_rec                iex_open_interface_pub.iohv_rec_type;
393   BEGIN
394     	if (funcmode = 'RUN') then
395      		l_delinquency_id := wf_engine.GetItemAttrText( itemtype => itemtype,
396 						      	itemkey	=> itemkey,
397 							aname  	=> 'DELINQUENCY_ID');
398 
399                 FOR cur IN l_khr_csr(l_delinquency_id) LOOP
400                   l_oinv_rec.id := cur.id;
401                   l_oinv_rec.khr_id := cur.khr_id;
402                   l_iohv_rec.id := cur.hst_id;
403                   l_iohv_rec.object1_id1 := cur.object1_id1;
404                   l_iohv_rec.object1_id2 := cur.object1_id2;
405                   l_iohv_rec.jtot_object1_code := cur.jtot_object1_code;
406                   l_iohv_rec.ext_agncy_id := cur.ext_agncy_id;
407 
408                   iex_open_interface_pub.recall_transfer(p_api_version => l_api_version
409                      ,p_init_msg_list => l_init_msg_list
410                      ,p_interface_id => l_oinv_rec.id
411                      ,p_recall_date => SYSDATE
412                      ,p_comments => null
413                      ,x_return_status => l_return_status
414                      ,x_msg_count => lx_msg_count
415                      ,x_msg_data => lx_msg_data);
416 
417                   IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
418                     RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
419                   ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
420                     RAISE okl_api.G_EXCEPTION_ERROR;
421                   END IF;
422                 END LOOP;
423 		resultout := 'COMPLETE:';
424          	RETURN ;
425 	end if;
426         --
427         -- CANCEL mode
428         --
429         if (funcmode = 'CANCEL') then
430                 --
431                 resultout := 'COMPLETE:';
432                 return;
433                 --
434         end if;
435         --
436         -- TIMEOUT mode
437         --
438         if (funcmode = 'TIMEOUT') then
439                 --
440                 resultout := 'COMPLETE:';
441                 return;
442                 --
443         end if;
444   EXCEPTION
445      when others then
446        --resultout := wf_engine.eng_completed ||':'||wf_no;
447        wf_core.context('IEX_CO_WF','recall_case',itemtype,
448                    itemkey,to_char(actid),funcmode);
449        raise;
450   END recall_case;
451 
452   ---------------------------------------------------------------------------
453   -- PROCEDURE wf_send_signal_cancelled
454   ---------------------------------------------------------------------------
455   /** send signal to the main work flow that the custom work
456    *  flow is over and also updates the work item
457    * the send signal is sent when the agent REJECTS the
458    * notification since the vendor didn't approve it ,
459    * so set the status to 'CANCELLED'.
460    **/
461 
462   PROCEDURE wf_send_signal_cancelled(
463     itemtype    in   varchar2,
464     itemkey     in   varchar2,
465     actid       in   number,
466     funcmode    in   varchar2,
467     result      out NOCOPY  varchar2)  AS
468 
469     l_work_item_id number;
470     l_strategy_id number;
471     l_return_status     VARCHAR2(20);
472     l_msg_count         NUMBER;
473     l_msg_data          VARCHAR2(2000);
474     l_msg_index_out number;
478     if funcmode <> 'RUN' then
475     i number;
476     l_error VARCHAR2(32767);
477   Begin
479       result := wf_engine.eng_null;
480       return;
481     end if;
482 
483     l_work_item_id := wf_engine.GetItemAttrNumber(
484                                            itemtype  => itemtype,
485                                            itemkey   => itemkey,
486                                            aname     => 'WORK_ITEMID');
487 
488     l_strategy_id := wf_engine.GetItemAttrNumber(
489                                            itemtype  => itemtype,
490                                            itemkey   => itemkey,
491                                            aname     => 'STRATEGY_ID');
492 
493     if (l_work_item_id is not null) then
494 
495       iex_stry_utl_pub.update_work_item(
496                            p_api_version   => 1.0,
497                            p_commit        => FND_API.G_TRUE,
498                            p_init_msg_list => FND_API.G_TRUE,
499                            p_work_item_id  => l_work_item_id,
500                            p_status        => 'CANCELLED',
501                            x_return_status => l_return_status,
502                            x_msg_count     => l_msg_count,
503                            x_msg_data      => l_msg_data
504                            );
505 
506       if l_return_status =FND_API.G_RET_STS_SUCCESS THEN
507         iex_strategy_wf.send_signal(
508                          process    => 'IEXSTRY' ,
509                          strategy_id => l_strategy_id,
510                          status      => 'CANCELLED',
511                          work_item_id => l_work_item_id,
512                          signal_source =>'CUSTOM');
513 
514 
515       end if; -- if update is succcessful;
516     end if;
517 
518     result := wf_engine.eng_completed;
519 
520   EXCEPTION
521     when others then
522       FOR i in 1..fnd_msg_pub.count_msg() LOOP
523         fnd_msg_pub.get(p_data => l_msg_data,
524                         p_msg_index_out => l_msg_index_out);
525 --        IF PG_DEBUG < 10  THEN
526         IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
527            iex_debug_pub.logmessage('wf_send_signal_cancelled: ' || 'error message is ' || l_msg_data);
528         END IF;
529         --dbms_output.put_line(to_char(i) || ':' || x_msg_data);
530       END LOOP;
531 
532       --iex_strategy_wf.Get_Messages(l_msg_count,l_error);
533       wf_core.context('IEX_CO_WF','wf_send_signal_cancelled',itemtype,
534                        itemkey,to_char(actid),funcmode);
535       raise;
536   END wf_send_signal_cancelled;
537 
538   ---------------------------------------------------------------------------
539   -- PROCEDURE wf_send_signal_complete
540   ---------------------------------------------------------------------------
541   /** send signal to the main work flow that the custom work
542    *  flow is over and also updates the work item
543    * the send signal is sent when the agent REJECTS the
544    * notification since the vendor didn't approve it ,
545    * so set the status to 'COMPLETE'.
546    **/
547 
548   PROCEDURE wf_send_signal_complete(
549     itemtype    in   varchar2,
550     itemkey     in   varchar2,
551     actid       in   number,
552     funcmode    in   varchar2,
553     result      out NOCOPY  varchar2)  AS
554 
555     l_work_item_id number;
556     l_strategy_id number;
557     l_return_status     VARCHAR2(20);
558     l_msg_count         NUMBER;
559     l_msg_data          VARCHAR2(2000);
560     l_msg_index_out number;
561     i number;
562     l_error VARCHAR2(32767);
563   Begin
564     if funcmode <> 'RUN' then
565       result := wf_engine.eng_null;
566       return;
567     end if;
568 
569     l_work_item_id := wf_engine.GetItemAttrNumber(
570                                            itemtype  => itemtype,
571                                            itemkey   => itemkey,
572                                            aname     => 'WORK_ITEMID');
573 
574     l_strategy_id := wf_engine.GetItemAttrNumber(
575                                            itemtype  => itemtype,
576                                            itemkey   => itemkey,
577                                            aname     => 'STRATEGY_ID');
578 
579     if (l_work_item_id is not null) then
580 
581       iex_stry_utl_pub.update_work_item(
582                            p_api_version   => 1.0,
583                            p_commit        => FND_API.G_TRUE,
584                            p_init_msg_list => FND_API.G_TRUE,
585                            p_work_item_id  => l_work_item_id,
586                            p_status        => 'COMPLETE',
587                            x_return_status => l_return_status,
588                            x_msg_count     => l_msg_count,
589                            x_msg_data      => l_msg_data
590                            );
591 
592       if l_return_status =FND_API.G_RET_STS_SUCCESS THEN
593         iex_strategy_wf.send_signal(
597                          work_item_id => l_work_item_id,
594                          process    => 'IEXSTRY' ,
595                          strategy_id => l_strategy_id,
596                          status      => 'COMPLETE',
598                          signal_source =>'CUSTOM');
599 
600 
601       end if; -- if update is succcessful;
602     end if;
603 
604     result := wf_engine.eng_completed;
605 
606   EXCEPTION
607     when others then
608       FOR i in 1..fnd_msg_pub.count_msg() LOOP
609         fnd_msg_pub.get(p_data => l_msg_data,
610                         p_msg_index_out => l_msg_index_out);
611 --        IF PG_DEBUG < 10  THEN
612         IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
613            iex_debug_pub.logmessage('wf_send_signal_complete: ' || 'error message is ' || l_msg_data);
614         END IF;
615         --dbms_output.put_line(to_char(i) || ':' || x_msg_data);
616       END LOOP;
617 
618       --iex_strategy_wf.Get_Messages(l_msg_count,l_error);
619       wf_core.context('IEX_CO_WF','wf_send_signal_complete',itemtype,
620                        itemkey,to_char(actid),funcmode);
621       raise;
622   END wf_send_signal_complete;
623 
624   /*
625   ---------------------------------------------------------------------------
626   -- PROCEDURE raise_report_cb_event
627   ---------------------------------------------------------------------------
628   PROCEDURE raise_report_cb_event(p_delinquency_id IN NUMBER) AS
629         l_parameter_list        wf_parameter_list_t;
630         l_key                   varchar2(240);
631         l_seq                   NUMBER;
635         --l_itemtype              varchar2(240) := 'IEXCOTEA';
632         l_event_name            varchar2(240) := 'oracle.apps.iex.co.reportcb';
633         l_itemtype              varchar2(240) := 'IEXCORCB';
634         --l_event_name            varchar2(240) := 'oracle.apps.iex.co.transferea';
636 
637 	CURSOR okl_key_csr IS
638 	SELECT okl_wf_item_s.nextval
639 	FROM  dual;
640   BEGIN
641         SAVEPOINT raise_report_cb_event;
642 
643 	OPEN okl_key_csr;
644 	FETCH okl_key_csr INTO l_seq;
645 	CLOSE okl_key_csr;
646     l_key := l_event_name ||l_seq ;
647 
648 
649   --Code for starting a workflow starts here
650      wf_engine.createprocess(itemtype => l_itemtype,
651                              itemkey  => l_key,
652                              process  =>'IEX:STRATEGY_CUSTOM_WORKFLOW');
653 
654 
655      wf_engine.SetItemAttrText(itemtype => l_itemtype,
656                                  itemkey  => l_key,
657                                  aname     => 'DELINQUENCY_ID',
658                                  avalue    => p_delinquency_id);
659 
660      wf_engine.SetItemAttrText(itemtype => l_itemtype,
661                                  itemkey  => l_key,
662                                  aname     => 'PARTY_NAME',
663                                  avalue    => 'Pradeep Gomes');
664 
665      wf_engine.SetItemAttrText(itemtype => l_itemtype,
666                                  itemkey  => l_key,
667                                  aname     => 'NOTIFICATION_USERNAME',
668                                  avalue    => 'ADMIN');
669 
670      wf_engine.SetItemAttrNumber(itemtype  => l_itemtype,
671                                      itemkey   =>  l_key,
672                                      aname     => 'STRATEGY_ID',
673                                      avalue    => 10128);
674 
675      wf_engine.SetItemAttrNumber(itemtype  => l_itemtype,
676                                      itemkey   =>  l_key,
677                                      aname     => 'WORK_ITEMID',
678                                      avalue    => 10219);
679 
680     wf_engine.startprocess(itemtype => l_itemtype,
681                            itemkey  => l_key);
682   --Code for ending a workflow starts here
683 
684   --Code for raising an event starts here
685         --wf_event.AddParameterToList('DELINQUENCY_ID',p_delinquency_id,l_parameter_list);
686         --wf_event.AddParameterToList('PARTY_NAME','PRADEEP GOMES',l_parameter_list);
687         --wf_event.AddParameterToList('CASE_NUMBER','PGOMES1002',l_parameter_list);
688         --wf_event.AddParameterToList('NOTIFICATION_USERNAME','ADMIN',l_parameter_list);
689 
690    -- Raise Event
691         --wf_event.raise(p_event_name => l_event_name
692         --                ,p_event_key   => l_key
693         --                ,p_parameters  => l_parameter_list);
694         --   l_parameter_list.DELETE;
695   --Code for raising an event ends here
696 
697 EXCEPTION
701   FND_MSG_PUB.ADD;
698  WHEN OTHERS THEN
699   FND_MESSAGE.SET_NAME('IEX', 'IEX_API_OTHERS_EXCEP');
700   FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
702   ROLLBACK TO raise_report_cb_event;
703 END raise_report_cb_event;
704 */
705 
706 END IEX_CO_WF;