132: FETCH c_status INTO l_prev_status;
133: CLOSE c_status;
134:
135: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
136: IEX_DEBUG_PUB.logmessage('l_prev_status: ' || l_prev_status);
137: END IF;
138:
139: IEX_STRATEGY_WF.SEND_SIGNAL(process => 'IEXSTRY',
140: strategy_id => p_strategy_id,
141: status => p_status ) ;
142:
143: -- IF PG_DEBUG < 10 THEN
144: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
145: IEX_DEBUG_PUB.logmessage('REASSIGN_STRATEGY: ' || 'AFTER SEND SIGNAL');
146: END IF;
147:
148: OPEN c_status(p_strategy_id);
149: FETCH c_status INTO l_status;
151:
152: IF ( l_status = 'CANCELLED' ) THEN
153: -- IF PG_DEBUG < 10 THEN
154: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
155: IEX_DEBUG_PUB.logmessage('REASSIGN_STRATEGY: ' || 'After Send Signal and it successfull ');
156: END IF;
157: OPEN c_object(p_strategy_id);
158: FETCH c_object INTO l_delinquency_id,l_object_id,l_object_type;
159: CLOSE c_object;
159: CLOSE c_object;
160:
161: -- IF PG_DEBUG < 10 THEN
162: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
163: IEX_DEBUG_PUB.logmessage('REASSIGN_STRATEGY: ' || 'IEXSTTAB-Delinquency id'||
164: 'before calling create strategy is '
165: ||l_delinquency_id||
166: ' object_id is '||l_object_id ||
167: ' object_type is' || l_object_type );
168: END IF;
169:
170: -- IF PG_DEBUG < 10 THEN
171: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
172: IEX_DEBUG_PUB.logmessage('REASSIGN_STRATEGY: ' || 'BEFORE CALLING CREATE_STRATEGY ');
173: END IF;
174:
175: IEX_STRATEGY_PUB.CREATE_STRATEGY
176: (p_api_version_number => 2.0,
186: p_strategy_temp_id => p_strategy_temp_id) ;
187:
188: -- IF PG_DEBUG < 10 THEN
189: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
190: iex_debug_pub.logmessage('REASSIGN_STRATEGY: ' || 'status of create strategy ' ||l_return_status);
191: iex_debug_pub.logmessage('REASSIGN_STRATEGY: ' || ' after calling create strategy '
192: || ' object_id is '||l_object_id || ' object_type is' || l_object_type );
193: iex_debug_pub.logmessage('REASSIGN_STRATEGY: ' || 'Calling set_strategy to update the status_code');
194: END IF;
187:
188: -- IF PG_DEBUG < 10 THEN
189: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
190: iex_debug_pub.logmessage('REASSIGN_STRATEGY: ' || 'status of create strategy ' ||l_return_status);
191: iex_debug_pub.logmessage('REASSIGN_STRATEGY: ' || ' after calling create strategy '
192: || ' object_id is '||l_object_id || ' object_type is' || l_object_type );
193: iex_debug_pub.logmessage('REASSIGN_STRATEGY: ' || 'Calling set_strategy to update the status_code');
194: END IF;
195:
189: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
190: iex_debug_pub.logmessage('REASSIGN_STRATEGY: ' || 'status of create strategy ' ||l_return_status);
191: iex_debug_pub.logmessage('REASSIGN_STRATEGY: ' || ' after calling create strategy '
192: || ' object_id is '||l_object_id || ' object_type is' || l_object_type );
193: iex_debug_pub.logmessage('REASSIGN_STRATEGY: ' || 'Calling set_strategy to update the status_code');
194: END IF;
195:
196: IF l_prev_status = 'ONHOLD' THEN
197: iex_strategy_pub.set_strategy(
208: p_Status => 'ONHOLD'
209: );
210: END IF;
211: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
212: iex_debug_pub.logmessage('REASSIGN_STRATEGY: ' || 'status of create strategy ' ||l_return_status);
213: IEX_DEBUG_PUB.logmessage('REASSIGN_STRATEGY: ' || ' after calling set_strategy ');
214: END IF;
215:
216: x_msg_count :=l_msg_count;
209: );
210: END IF;
211: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
212: iex_debug_pub.logmessage('REASSIGN_STRATEGY: ' || 'status of create strategy ' ||l_return_status);
213: IEX_DEBUG_PUB.logmessage('REASSIGN_STRATEGY: ' || ' after calling set_strategy ');
214: END IF;
215:
216: x_msg_count :=l_msg_count;
217: x_msg_data :=l_msg_data;
232: WHEN OTHERS THEN
233: ROLLBACK TO REASSIGN_STRATEGY_PUB;
234: -- IF PG_DEBUG < 10 THEN
235: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
236: IEX_DEBUG_PUB.logmessage('REASSIGN_STRATEGY: ' || 'inexception of reassign strategy '||sqlerrm);
237: END IF;
238: END REASSIGN_STRATEGY;
239:
240: --Start bug 6794510 gnramasa 5th Feb 08
271:
272: x_return_status := FND_API.G_RET_STS_ERROR;
273:
274: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
275: IEX_DEBUG_PUB.logmessage('ASSIGN_STRATEGY: ' || 'IEXSTTAB-Delinquency id'||
276: 'before calling create strategy is '
277: ||l_delinquency_id||
278: ' object_id is '||p_objectid ||
279: ' object_type is' || p_objecttype );
280: END IF;
281:
282: -- IF PG_DEBUG < 10 THEN
283: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
284: IEX_DEBUG_PUB.logmessage('ASSIGN_STRATEGY: ' || 'BEFORE CALLING CREATE_STRATEGY ');
285: END IF;
286:
287: IEX_STRATEGY_PUB.CREATE_STRATEGY
288: (p_api_version_number => 2.0,
298: p_strategy_temp_id => p_strategy_temp_id) ;
299:
300: -- IF PG_DEBUG < 10 THEN
301: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
302: iex_debug_pub.logmessage('ASSIGN_STRATEGY: ' || 'status of create strategy ' ||l_return_status);
303: END IF;
304:
305: x_msg_count :=l_msg_count;
306: x_msg_data :=l_msg_data;
337: ' GROUP BY pd.delinquency_id ' ||
338: ' HAVING sum(nvl(pd.promise_amount,0)) >= ps.amount_due_remaining)';
339:
340:
341: iex_debug_pub.logmessage('p_object_id: '|| p_objectid);
342: iex_debug_pub.logmessage('p_object_type: '|| p_objecttype);
343: iex_debug_pub.logmessage('l_where_clause: '|| l_where_clause);
344: iex_debug_pub.logmessage('vPLSQL: '|| vPLSQL);
345:
338: ' HAVING sum(nvl(pd.promise_amount,0)) >= ps.amount_due_remaining)';
339:
340:
341: iex_debug_pub.logmessage('p_object_id: '|| p_objectid);
342: iex_debug_pub.logmessage('p_object_type: '|| p_objecttype);
343: iex_debug_pub.logmessage('l_where_clause: '|| l_where_clause);
344: iex_debug_pub.logmessage('vPLSQL: '|| vPLSQL);
345:
346: OPEN c_onhold_strategies FOR vPLSQL USING p_objectid;
339:
340:
341: iex_debug_pub.logmessage('p_object_id: '|| p_objectid);
342: iex_debug_pub.logmessage('p_object_type: '|| p_objecttype);
343: iex_debug_pub.logmessage('l_where_clause: '|| l_where_clause);
344: iex_debug_pub.logmessage('vPLSQL: '|| vPLSQL);
345:
346: OPEN c_onhold_strategies FOR vPLSQL USING p_objectid;
347: FETCH c_onhold_strategies INTO l_str_count ;
340:
341: iex_debug_pub.logmessage('p_object_id: '|| p_objectid);
342: iex_debug_pub.logmessage('p_object_type: '|| p_objecttype);
343: iex_debug_pub.logmessage('l_where_clause: '|| l_where_clause);
344: iex_debug_pub.logmessage('vPLSQL: '|| vPLSQL);
345:
346: OPEN c_onhold_strategies FOR vPLSQL USING p_objectid;
347: FETCH c_onhold_strategies INTO l_str_count ;
348: CLOSE c_onhold_strategies;
346: OPEN c_onhold_strategies FOR vPLSQL USING p_objectid;
347: FETCH c_onhold_strategies INTO l_str_count ;
348: CLOSE c_onhold_strategies;
349:
350: iex_debug_pub.logmessage('l_str_count: '|| l_str_count);
351: IF l_str_count = 0 then
352: iex_debug_pub.logmessage('Calling iex_strategy_pub.set_strategy to set the strategy status to ONHOLD');
353:
354: iex_strategy_pub.set_strategy
348: CLOSE c_onhold_strategies;
349:
350: iex_debug_pub.logmessage('l_str_count: '|| l_str_count);
351: IF l_str_count = 0 then
352: iex_debug_pub.logmessage('Calling iex_strategy_pub.set_strategy to set the strategy status to ONHOLD');
353:
354: iex_strategy_pub.set_strategy
355: (
356: P_Api_Version_Number => 2.0,
364: p_ObjectType => p_objecttype,
365: p_ObjectID => p_objectid,
366: p_Status => 'ONHOLD'
367: );
368: iex_debug_pub.logmessage('l_return_status: '|| l_return_status);
369: END IF;
370: EXCEPTION
371: WHEN OTHERS THEN
372: iex_debug_pub.logmessage('In exception block');
368: iex_debug_pub.logmessage('l_return_status: '|| l_return_status);
369: END IF;
370: EXCEPTION
371: WHEN OTHERS THEN
372: iex_debug_pub.logmessage('In exception block');
373: iex_debug_pub.logmessage('SQLCODE: '|| SQLCODE);
374: iex_debug_pub.logmessage('SQLERRM: '|| SQLERRM);
375: END;
376:
369: END IF;
370: EXCEPTION
371: WHEN OTHERS THEN
372: iex_debug_pub.logmessage('In exception block');
373: iex_debug_pub.logmessage('SQLCODE: '|| SQLCODE);
374: iex_debug_pub.logmessage('SQLERRM: '|| SQLERRM);
375: END;
376:
377: -- Standard check of p_commit
370: EXCEPTION
371: WHEN OTHERS THEN
372: iex_debug_pub.logmessage('In exception block');
373: iex_debug_pub.logmessage('SQLCODE: '|| SQLCODE);
374: iex_debug_pub.logmessage('SQLERRM: '|| SQLERRM);
375: END;
376:
377: -- Standard check of p_commit
378: IF FND_API.To_Boolean(p_commit) THEN
383: WHEN OTHERS THEN
384: ROLLBACK TO ASSIGN_STRATEGY_PUB;
385: -- IF PG_DEBUG < 10 THEN
386: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
387: IEX_DEBUG_PUB.logmessage('ASSIGN_STRATEGY: ' || 'inexception of reassign strategy '||sqlerrm);
388: END IF;
389: END ASSIGN_STRATEGY;
390: --End bug 6794510 gnramasa 5th Feb 08
391:
421: --Added INERROR_CHECK_NOTIFY for bug#9736794 by bibeura on 09-Dec-2011
422: if (l_status_code not in ('OPEN', 'ONHOLD','PRE-WAIT','INERROR_CHECK_NOTIFY')) then --Added PRE-WAIT for bug#5474793 by schekuri on 21-Aug-2006
423: x_return_status := FND_API.G_RET_STS_ERROR;
424: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
425: IEX_DEBUG_PUB.logmessage('UPDATE_AND_SENDSIGNAL: ' || 'work item not in status OPEN or ONHOLD');
426: end if;
427: return;
428: end if;
429:
430: EXCEPTION
431: WHEN OTHERS THEN
432: x_return_status := FND_API.G_RET_STS_ERROR;
433: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
434: IEX_DEBUG_PUB.logmessage('UPDATE_AND_SENDSIGNAL: ' || 'work item not found');
435: end if;
436: return;
437: end;
438:
461: work_item_id => p_strategy_work_item_rec.work_item_id);
462:
463: -- IF PG_DEBUG < 10 THEN
464: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
465: IEX_DEBUG_PUB.logmessage('UPDATE_AND_SENDSIGNAL: ' || 'AFTER SEND SIGNAL');
466: END IF;
467: --check if it the strategy is open
468: -- and next work item is not the same as the updated work item
469: -- then the send signal has been successful and it has created
477:
478: if v_result >0 THEN
479: -- IF PG_DEBUG < 10 THEN
480: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
481: IEX_DEBUG_PUB.logmessage('UPDATE_AND_SENDSIGNAL: ' || 'send signal has failed ');
482: END IF;
483: rollback to UPDATE_AND_SENDSIGNAL;
484: x_return_status := FND_API.G_RET_STS_ERROR;
485: return;
485: return;
486: else
487: -- IF PG_DEBUG < 10 THEN
488: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
489: IEX_DEBUG_PUB.logmessage('UPDATE_AND_SENDSIGNAL: ' || 'send signal is successful ');
490: END IF;
491: end if;
492: */
493: END IF; --if status is successful
501: WHEN OTHERS THEN
502: ROLLBACK TO UPDATE_AND_SENDSIGNAL;
503: -- IF PG_DEBUG < 10 THEN
504: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
505: IEX_DEBUG_PUB.logmessage('inexception of UPDATE_AND_SENDSIGNAL '||sqlerrm);
506: END IF;
507:
508: END UPDATE_AND_SENDSIGNAL;
509:
544:
545: BEGIN
546: -- IF PG_DEBUG < 10 THEN
547: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
548: IEX_DEBUG_PUB.logmessage('UPDATE_AND_SENDSIGNAL: ' || 'START UPDATE AND SEND SIGNAL');
549: END IF;
550: SAVEPOINT UPDATE_AND_SENDSIGNAL;
551: x_return_status := FND_API.G_RET_STS_SUCCESS;
552:
563: l_strategy_work_item_rec.strategy_id :=l_strategy_id;
564:
565: -- IF PG_DEBUG < 10 THEN
566: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
567: IEX_DEBUG_PUB.logmessage('UPDATE_AND_SENDSIGNAL: ' || 'BEFORE CALLING UPDATE WORK ITEM PVT');
568: END IF;
569: iex_strategy_work_items_pvt.update_strategy_work_items(
570: p_api_version_number => 2.0,
571: p_init_msg_list => FND_API.G_TRUE,
577: p_strategy_work_item_rec => l_strategy_work_item_rec,
578: xo_object_version_number => l_version_number);
579: -- IF PG_DEBUG < 10 THEN
580: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
581: IEX_DEBUG_PUB.logmessage('UPDATE_AND_SENDSIGNAL: ' || 'Status of work item update ' ||l_return_status);
582: END IF;
583:
584: If l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
585: x_msg_count :=l_msg_count;
597: work_item_id =>l_strategy_work_item_rec.work_item_id);
598:
599: -- IF PG_DEBUG < 10 THEN
600: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
601: IEX_DEBUG_PUB.logmessage('UPDATE_AND_SENDSIGNAL: ' || 'AFTER SEND SIGNAL');
602: END IF;
603: --check if it the strategy is open
604: -- and next work item is not the same as the updated work item
605: -- then the send signal has been successful and it has created
613:
614: if v_result >0 THEN
615: -- IF PG_DEBUG < 10 THEN
616: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
617: IEX_DEBUG_PUB.logmessage('UPDATE_AND_SENDSIGNAL: ' || 'send signal has failed ');
618: END IF;
619: rollback to UPDATE_AND_SENDSIGNAL;
620: x_return_status := FND_API.G_RET_STS_ERROR;
621: return;
621: return;
622: else
623: -- IF PG_DEBUG < 10 THEN
624: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
625: IEX_DEBUG_PUB.logmessage('UPDATE_AND_SENDSIGNAL: ' || 'send signal is successful ');
626: END IF;
627: end if;
628: */
629: END IF ; -- p_status in 'closed' or cancelled'
638: WHEN OTHERS THEN
639: ROLLBACK TO UPDATE_AND_SENDSIGNAL;
640: -- IF PG_DEBUG < 10 THEN
641: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
642: IEX_DEBUG_PUB.logmessage('inexception of UPDATE_AND_SENDSIGNAL '||sqlerrm);
643: END IF;
644:
645:
646: END UPDATE_AND_SENDSIGNAL;
685: --End bug#13842980 schekuri 14-Mar-2012
686: BEGIN
687: -- IF PG_DEBUG < 10 THEN
688: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
689: IEX_DEBUG_PUB.logmessage('Begin IEX_STRY_API_PUB.CHECK_STRATEGY_WORKFLOW' );
690: END IF;
691: --check status of the workflow
692: wf_engine.ItemStatus( itemtype => 'IEXSTRY',
693: itemkey => p_strategy,
713: errstack =>l_errstack);
714: --end bug#13842980 schekuri 14-Mar-2012
715: -- IF PG_DEBUG < 10 THEN
716: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
717: IEX_DEBUG_PUB.logmessage('CHECK_STRATEGY_WORKFLOW: ' || 'wf error is ' ||l_wf_error);
718: END IF;
719:
720: if l_return_status = wf_engine.eng_error THEN
721: -- work flow is in error
727:
728: x_return_message := x_return_message || l_wf_error;
729: -- IF PG_DEBUG < 10 THEN
730: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
731: IEX_DEBUG_PUB.logmessage('CHECK_STRATEGY_WORKFLOW: ' || 'Work flow is in error for strategy Id'
732: ||p_strategy || 'error is ' ||x_return_message);
733: END IF;
734:
735: elsif l_return_status =wf_engine.eng_active THEN
747: aname => 'ACTIVITY_NAME');
748: If l_activity_name is null then
749: -- IF PG_DEBUG < 10 THEN
750: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
751: IEX_DEBUG_PUB.logmessage('CHECK_STRATEGY_WORKFLOW: ' || 'l_activity_name is null ' );
752: END IF;
753: x_return_message :=wf_engine.GetItemAttrText(itemtype => 'IEXSTRY',
754: itemkey => p_strategy,
755: aname => 'ERROR_MESSAGE');
757: x_return_message := x_return_message || l_wf_error;
758: x_return_status := 'E';
759: -- IF PG_DEBUG < 10 THEN
760: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
761: IEX_DEBUG_PUB.logmessage('CHECK_STRATEGY_WORKFLOW: ' || 'Work flow is in error for strategy Id'
762: ||p_strategy || 'error is ' ||x_return_message);
763: END IF;
764: -- set status to success
765: -- cancel or complete optional or escalate work item
776: end if;
777:
778: -- IF PG_DEBUG < 10 THEN
779: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
780: IEX_DEBUG_PUB.logmessage('End IEX_STRY_API_PUB.CHECK_STRATEGY_WORKFLOW' );
781: END IF;
782:
783: EXCEPTION
784: WHEN OTHERS THEN
783: EXCEPTION
784: WHEN OTHERS THEN
785: -- IF PG_DEBUG < 10 THEN
786: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
787: IEX_DEBUG_PUB.logmessage('CHECK_STRATEGY_WORKFLOW: ' || 'inexception of UPDATE_AND_SENDSIGNAL '||sqlerrm);
788: END IF;
789: x_return_status := 'E';
790: x_return_message := sqlerrm;
791: x_wf_Status :=NULL;
819:
820: BEGIN
821: -- IF PG_DEBUG < 10 THEN
822: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
823: IEX_DEBUG_PUB.logmessage('START UPDATE_WORKITEM');
824: END IF;
825: SAVEPOINT UPDATE_WORKITEM;
826: x_return_status := FND_API.G_RET_STS_SUCCESS;
827:
838: l_strategy_work_item_rec.strategy_id :=l_strategy_id;
839:
840: -- IF PG_DEBUG < 10 THEN
841: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
842: IEX_DEBUG_PUB.logmessage('UPDATE_WORKITEM: ' || 'BEFORE CALLING UPDATE WORK ITEM PVT');
843: END IF;
844: iex_strategy_work_items_pvt.update_strategy_work_items(
845: p_api_version_number => 2.0,
846: p_init_msg_list => FND_API.G_TRUE,
852: p_strategy_work_item_rec => l_strategy_work_item_rec,
853: xo_object_version_number => l_version_number);
854: -- IF PG_DEBUG < 10 THEN
855: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
856: IEX_DEBUG_PUB.logmessage('UPDATE_WORKITEM: ' || 'Status of work item update ' ||l_return_status);
857: END IF;
858:
859: -- Standard check of p_commit
860: IF FND_API.To_Boolean(p_commit) THEN
865: WHEN OTHERS THEN
866: ROLLBACK TO UPDATE_WORKITEM;
867: -- IF PG_DEBUG < 10 THEN
868: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
869: IEX_DEBUG_PUB.logmessage('inexception of UPDATE_WORKITEM '||sqlerrm);
870: END IF;
871:
872: END UPDATE_WORKITEM;
873:
908: l_uwq_complete_date date;
909:
910: begin
911: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
912: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': start');
913: END IF;
914:
915: -- Standard start of API savepoint
916: SAVEPOINT SHOW_IN_UWQ_PVT;
932:
933: -- validating uwq status
934: l_validation_item := 'P_UWQ_STATUS';
935: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
936: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': new uwq status: ' || P_UWQ_STATUS);
937: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': Validating ' || l_validation_item);
938: END IF;
939: if P_UWQ_STATUS is null then
940: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
933: -- validating uwq status
934: l_validation_item := 'P_UWQ_STATUS';
935: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
936: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': new uwq status: ' || P_UWQ_STATUS);
937: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': Validating ' || l_validation_item);
938: END IF;
939: if P_UWQ_STATUS is null then
940: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
941: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': ' || l_validation_item || ' failed validation');
937: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': Validating ' || l_validation_item);
938: END IF;
939: if P_UWQ_STATUS is null then
940: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
941: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': ' || l_validation_item || ' failed validation');
942: END IF;
943: FND_MESSAGE.SET_NAME('IEX','IEX_BAD_API_INPUT');
944: FND_MESSAGE.SET_TOKEN('API_NAME', G_PKG_NAME || '.' || l_api_name);
945: FND_MESSAGE.SET_TOKEN('API_PARAMETER', l_validation_item);
949:
950: -- validating table of promises
951: l_validation_item := 'P_WORK_ITEM_ID_TBL';
952: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
953: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': count of P_WORK_ITEM_ID_TBL: ' || P_WORK_ITEM_ID_TBL.count);
954: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': Validating ' || l_validation_item);
955: END IF;
956: if P_WORK_ITEM_ID_TBL.count = 0 then
957: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
950: -- validating table of promises
951: l_validation_item := 'P_WORK_ITEM_ID_TBL';
952: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
953: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': count of P_WORK_ITEM_ID_TBL: ' || P_WORK_ITEM_ID_TBL.count);
954: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': Validating ' || l_validation_item);
955: END IF;
956: if P_WORK_ITEM_ID_TBL.count = 0 then
957: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
958: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': ' || l_validation_item || ' failed validation');
954: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': Validating ' || l_validation_item);
955: END IF;
956: if P_WORK_ITEM_ID_TBL.count = 0 then
957: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
958: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': ' || l_validation_item || ' failed validation');
959: END IF;
960: FND_MESSAGE.SET_NAME('IEX','IEX_BAD_API_INPUT');
961: FND_MESSAGE.SET_TOKEN('API_NAME', G_PKG_NAME || '.' || l_api_name);
962: FND_MESSAGE.SET_TOKEN('API_PARAMETER', l_validation_item);
966:
967: -- validating p_days
968: l_validation_item := 'P_NO_DAYS';
969: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
970: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': P_NO_DAYS: ' || P_NO_DAYS);
971: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': Validating ' || l_validation_item);
972: END IF;
973: if P_NO_DAYS is not null and P_NO_DAYS < 0 then
974: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
967: -- validating p_days
968: l_validation_item := 'P_NO_DAYS';
969: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
970: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': P_NO_DAYS: ' || P_NO_DAYS);
971: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': Validating ' || l_validation_item);
972: END IF;
973: if P_NO_DAYS is not null and P_NO_DAYS < 0 then
974: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
975: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': ' || l_validation_item || ' failed validation');
971: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': Validating ' || l_validation_item);
972: END IF;
973: if P_NO_DAYS is not null and P_NO_DAYS < 0 then
974: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
975: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': ' || l_validation_item || ' failed validation');
976: END IF;
977: FND_MESSAGE.SET_NAME('IEX','IEX_BAD_API_INPUT');
978: FND_MESSAGE.SET_TOKEN('API_NAME', G_PKG_NAME || '.' || l_api_name);
979: FND_MESSAGE.SET_TOKEN('API_PARAMETER', l_validation_item);
987: else
988: l_days := P_NO_DAYS;
989: end if;
990: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
991: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': number of days: ' || l_days);
992: END IF;
993: l_set_status_date := sysdate + l_days;
994: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
995: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': set status date: ' || l_set_status_date);
991: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': number of days: ' || l_days);
992: END IF;
993: l_set_status_date := sysdate + l_days;
994: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
995: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': set status date: ' || l_set_status_date);
996: END IF;
997:
998: -- check for status
999: if P_UWQ_STATUS = 'ACTIVE' then
1009:
1010: nCount := p_work_item_id_tbl.count;
1011: if nCount > 0 then
1012: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1013: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': l_uwq_active_date: ' || l_uwq_active_date);
1014: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': l_uwq_complete_date: ' || l_uwq_complete_date);
1015: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': updating promise details...');
1016: END IF;
1017: FORALL i in 1..nCount
1010: nCount := p_work_item_id_tbl.count;
1011: if nCount > 0 then
1012: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1013: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': l_uwq_active_date: ' || l_uwq_active_date);
1014: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': l_uwq_complete_date: ' || l_uwq_complete_date);
1015: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': updating promise details...');
1016: END IF;
1017: FORALL i in 1..nCount
1018: UPDATE iex_strategy_work_items
1011: if nCount > 0 then
1012: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1013: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': l_uwq_active_date: ' || l_uwq_active_date);
1014: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': l_uwq_complete_date: ' || l_uwq_complete_date);
1015: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': updating promise details...');
1016: END IF;
1017: FORALL i in 1..nCount
1018: UPDATE iex_strategy_work_items
1019: SET uwq_status = p_uwq_status,
1024: where
1025: work_item_id = p_work_item_id_tbl(i);
1026: else
1027: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1028: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || ': nothing to update');
1029: END IF;
1030: end if;
1031:
1032: -- END OF BODY OF API
1073:
1074: begin
1075:
1076: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1077: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || 'begin.' );
1078: END IF;
1079:
1080: SAVEPOINT COPY_WORK_ITEM;
1081:
1090: While Newcnt >= 1
1091: Loop
1092:
1093: Newworkitemname := 'Copy of ' ||Newworkitemname;
1094: iex_debug_pub.LogMessage( 'Inside Loop ... Newworkitemname === '||Newworkitemname );
1095:
1096: select count(name) into Newcnt
1097: from iex_stry_temp_work_items_tl B, FND_LANGUAGES L
1098: where L.INSTALLED_FLAG in ('I', 'B') and B.LANGUAGE = userenv('LANG')
1101: End Loop;
1102:
1103: exception
1104: when others then
1105: iex_debug_pub.LogMessage( 'Exception from bug 8233425....' );
1106: null;
1107: end;
1108:
1109: iex_debug_pub.LogMessage( 'Outside Loop ... Newworkitemname === '||Newworkitemname );
1105: iex_debug_pub.LogMessage( 'Exception from bug 8233425....' );
1106: null;
1107: end;
1108:
1109: iex_debug_pub.LogMessage( 'Outside Loop ... Newworkitemname === '||Newworkitemname );
1110: -- end Bug 8233425
1111:
1112:
1113: -- SELECT IEX_STRATEGY_TEMP_WORK_ITEMS_S.NEXTVAL into l_work_item_seq FROM DUAL;
1147: from iex_strategy_work_skills a
1148: where a.work_item_temp_id = p_work_item_temp_id;
1149:
1150: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1151: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || 'end.' );
1152: END IF;
1153:
1154: EXCEPTION
1155: WHEN FND_API.G_EXC_ERROR THEN
1154: EXCEPTION
1155: WHEN FND_API.G_EXC_ERROR THEN
1156: ROLLBACK TO COPY_WORK_ITEM;
1157: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1158: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || 'g_exc_error.' || sqlerrm );
1159: END IF;
1160: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1161: ROLLBACK TO COPY_WORK_ITEM;
1162: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1159: END IF;
1160: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1161: ROLLBACK TO COPY_WORK_ITEM;
1162: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1163: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || 'g_exc_unexpected_error.' || sqlerrm );
1164: END IF;
1165: WHEN OTHERS THEN
1166: ROLLBACK TO COPY_WORK_ITEM;
1167: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1164: END IF;
1165: WHEN OTHERS THEN
1166: ROLLBACK TO COPY_WORK_ITEM;
1167: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1168: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || l_api_name || 'others error.' || sqlerrm);
1169: END IF;
1170: end;
1171:
1172:
1195: IF (l_activity_label = 'STRATEGY_SUBPROCESS:PRE_WAIT_PROCESS' and p_wkitem_status = 'PRE-WAIT') OR
1196: (l_activity_label = 'STRATEGY_WORKFLOW:WAIT_AFTER_PROCESS' and p_wkitem_status = 'COMPLETE' and p_workitem_id = l_work_item_id) THEN
1197:
1198: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1199: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || 'SKIP_WAIT' || ' Forcing to complete Wait Activity ' || l_activity_label);
1200: END IF;
1201:
1202: wf_engine.CompleteActivity(itemtype => 'IEXSTRY',
1203: itemkey => p_strategy_id,
1204: activity =>l_activity_label,
1205: result =>'#TIMEOUT');
1206: COMMIT WORK;
1207: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1208: iex_debug_pub.LogMessage(G_PKG_NAME || '.' || 'SKIP_WAIT' || ' Forcefully completed Wait Activity ' || l_activity_label);
1209: END IF;
1210: x_return_status := l_return_status;
1211: END IF;
1212: EXCEPTION WHEN OTHERS THEN