264: WHERE b.source_id = a.source_mgr_id
265: AND a.user_id = p_user_id;
266:
267: BEGIN
268: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
269: iex_debug_pub.logmessage('IEX Start Bankruptcy Workflow..');
270: end if;
271:
272: -- Standard Start of API savepoint
296: -- Initialize API return status to SUCCESS
297: x_return_status := FND_API.G_RET_STS_SUCCESS;
298:
299: --Start bug 3659342 by gnramasa
300: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
301: iex_debug_pub.logmessage('IEX Start Bankruptcy Workflow..p_bankruptcy_id=' ||p_bankruptcy_id);
302: end if;
303:
304: /*
310:
311: itemtype := 'IEXBANST';
312: workflowprocess := 'BANKRUPT_STATUS';
313:
314: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
315: iex_debug_pub.logmessage('IEX Start Bankruptcy Workflow..P_user_id=' ||p_user_id);
316: end if;
317:
318: begin
323: when others then
324: iex_debug_pub.logmessage('IEX Start Bankruptcy Workflow usernme exception');
325: end;
326:
327: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
328: iex_debug_pub.logmessage('IEX Start Bankruptcy Workflow..P_Party_id=' ||p_party_id);
329: end if;
330:
331: begin
335: when others then
336: iex_debug_pub.logmessage('IEX Start Bankruptcy Workflow party_name exception');
337: end;
338:
339: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
340: iex_debug_pub.logmessage('IEX Start Bankruptcy Workflow..P_Useerid=' ||p_user_id);
341: iex_debug_pub.logmessage('IEX Start Bankruptcy Workflow..username=' ||l_user_name);
342: end if;
343:
361: from iex_delinquencies d, iex_bankruptcies b
362: where d.delinquency_id = b.delinquency_id
363: and d.delinquency_id = p_delinquency_id;
364: */
365: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
366: iex_debug_pub.logmessage('IEX Start Bankruptcy Workflow..getting bankruptcy id=' ||l_user_name);
367: end if;
368:
369: /*
383: when others then null;
384: end;
385: -- bug 15935804 end ...
386:
387: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
388: --iex_debug_pub.logmessage('IEX-4 Start Invoking BK Id..'||l_bankruptcy_id);
389: iex_debug_pub.logmessage('IEX-4 Start Invoking BK Id..'||p_bankruptcy_id);
390: iex_debug_pub.logmessage('IEX-4 Start Invoking Manager Name..'||l_manager_name);
391: iex_debug_pub.logmessage('IEX-4 Start Invoking requesterID ..'||p_user_id);
555: end if;
556:
557: l_profile := NVL(fnd_profile.value('IEX_STRY_CREATE_BANKRUPTCY'), 'Y');
558:
559: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
560: iex_debug_pub.logmessage ('update_approval_status start');
561: iex_debug_pub.logmessage ('Profile IEX_STRY_CREATE_BANKRUPTCY == '||l_profile);
562: END IF;
563:
593: l_party_name := wf_engine.GetItemAttrNumber(
594: itemtype => itemtype,
595: itemkey => itemkey,
596: aname => 'PARTY_NAME');
597: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
598: iex_debug_pub.logmessage ('update_approval_status start, before getting the bankruptcy id');
599: END IF;
600:
601: --Start bug 6359342 gnramasa 23-Aug-07
603: itemtype => itemtype,
604: itemkey => itemkey,
605: aname => 'BANKRUPTCY_ID');
606:
607: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
608: iex_debug_pub.logmessage ('update_approval_status start, after getting the bankruptcy id');
609: END IF;
610:
611: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
607: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
608: iex_debug_pub.logmessage ('update_approval_status start, after getting the bankruptcy id');
609: END IF;
610:
611: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
612: iex_debug_pub.logmessage ('update_approval_status: ' || 'l_delinquency_id : '||l_delinquency_id);
613: iex_debug_pub.logmessage ('update_approval_status: ' || 'l_bankruptcy_id : '||l_bankruptcy_id);
614: iex_debug_pub.logmessage ('update_approval_status: ' || 'l_party_id : '||l_party_id);
615: END IF;
626: p_bankruptcy_id => l_bankruptcy_id,
627: p_party_id => l_party_id
628: );
629:
630: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
631: iex_debug_pub.logmessage ('update_approval_status:'||l_return_status);
632: END IF;
633: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
634: RAISE L_API_ERROR;
909: x_msg_data => l_msg_data);
910: END IF;
911:
912: -- IF PG_DEBUG < 10 THEN
913: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
914: iex_debug_pub.logmessage ('set_no_contact_in_tca: ' || 'Update Contact Preference:'||l_return_status);
915: END IF;
916: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
917: RAISE L_API_ERROR;
952: x_msg_count => l_msg_count,
953: x_msg_data => l_msg_data);
954:
955: -- IF PG_DEBUG < 10 THEN
956: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
957: iex_debug_pub.logmessage ('set_no_contact_in_tca: ' || 'Create Contact Preference:'||l_return_status);
958: END IF;
959: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
960: RAISE L_API_ERROR;
1043: result := wf_engine.eng_completed ||':N';
1044: -- result := 'COMPLETE:N';
1045: END IF;
1046: -- IF PG_DEBUG < 10 THEN
1047: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1048: iex_debug_pub.logmessage ('turnoff_collection_profile: ' || 'result =>'||result);
1049: END IF;
1050:
1051: EXCEPTION
1175: p_object_id_tbl => CaseIdTab, -- Table of Case Ids.
1176: x_del_id_tbl => DelIdTab -- Table of Deliquencies that got created (Index correspoding to the case_id table);
1177: );
1178: -- IF PG_DEBUG < 10 THEN
1179: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1180: iex_debug_pub.logMessage('In turnoff_collections.Create Ind Delinquency: ' ||l_return_status);
1181: END IF;
1182:
1183: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1203: X_Msg_Count => l_msg_count,
1204: X_Msg_Data => l_msg_data
1205: );
1206: -- IF PG_DEBUG < 10 THEN
1207: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1208: iex_debug_pub.logMessage('In turnoff_collections.Create bankruptcy: ' ||l_return_status);
1209: END IF;
1210: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1211: RAISE L_API_ERROR;
1223: p_ObjectType => P_ObjectType,
1224: p_ObjectID => P_ObjectID);
1225:
1226: -- IF PG_DEBUG < 10 THEN
1227: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1228: iex_debug_pub.logMessage('In turnoff_collections.Create strategy: ' ||l_return_status);
1229: END IF;
1230: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1231: RAISE L_API_ERROR;
1367: p_object_id_tbl => CaseIdTab, -- Table of Case Ids.
1368: x_del_id_tbl => DelIdTab -- Table of Deliquencies that got created (Index correspoding to the case_id table);
1369: );
1370: -- IF PG_DEBUG < 10 THEN
1371: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1372: iex_debug_pub.logMessage('In no_turnoff_collections.Create Ind Delinquency: ' ||l_return_status);
1373: END IF;
1374: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1375: RAISE L_API_ERROR;
1392: X_Msg_Count => l_msg_count,
1393: X_Msg_Data => l_msg_data
1394: );
1395: -- IF PG_DEBUG < 10 THEN
1396: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1397: iex_debug_pub.logMessage('In no_turnoff_collections.Create bankruptcy: ' ||l_return_status);
1398: END IF;
1399: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1400: RAISE L_API_ERROR;
1411: p_DelinquencyID => l_del_id,
1412: p_ObjectType => P_ObjectType,
1413: p_ObjectID => P_ObjectID);
1414: -- IF PG_DEBUG < 10 THEN
1415: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1416: iex_debug_pub.logMessage('In no_turnoff_collections.Create strategy: ' ||l_return_status);
1417: END IF;
1418: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1419: RAISE L_API_ERROR;
1507: into l_disposition_code
1508: from iex_bankruptcies
1509: where bankruptcy_id = p_bankruptcy_id;
1510:
1511: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1512: IEX_DEBUG_PUB.logMessage('Create_Strategy : l_disposition_code := ' ||l_disposition_code);
1513: END IF;
1514:
1515: if l_disposition_code is NULL then
1512: IEX_DEBUG_PUB.logMessage('Create_Strategy : l_disposition_code := ' ||l_disposition_code);
1513: END IF;
1514:
1515: if l_disposition_code is NULL then
1516: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1517: IEX_DEBUG_PUB.logMessage('Create_Strategy : Calling IEX_STRATEGY_PUB.create_strategy');
1518: END IF;
1519: IEX_STRATEGY_PUB.create_strategy(
1520: P_Api_Version_Number => l_api_version_number,
1527: p_DelinquencyID => p_delinquency_id,
1528: p_ObjectType => P_ObjectType,
1529: p_ObjectID => P_ObjectID);
1530: else
1531: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1532: IEX_DEBUG_PUB.logMessage('Start cancel_strategy_and_workflow');
1533: END IF;
1534: end if;
1535:
1589: where name = 'BANKRUPTCY_ID' and number_value = c_id and item_type = 'IEXDELCS';
1590: -- End bug 7703313
1591:
1592: begin
1593: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1594: IEX_DEBUG_PUB.logMessage('Start cancel_strategy_and_workflow');
1595: END IF;
1596: SAVEPOINT cancel_strategy_and_workflow;
1597:
1594: IEX_DEBUG_PUB.logMessage('Start cancel_strategy_and_workflow');
1595: END IF;
1596: SAVEPOINT cancel_strategy_and_workflow;
1597:
1598: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1599: IEX_DEBUG_PUB.logMessage('cancel_strategy_and_workflow: p_party_id =>' || p_party_id);
1600: IEX_DEBUG_PUB.logMessage('cancel_strategy_and_workflow: p_bankruptcy_id =>' || p_bankruptcy_id);
1601: IEX_DEBUG_PUB.logMessage('cancel_strategy_and_workflow: p_disposition_code =>' || p_disposition_code);
1602: END IF;
1605: open c_get_strategy_id (p_bankruptcy_id);
1606: fetch c_get_strategy_id into l_startegy_id;
1607: close c_get_strategy_id;
1608:
1609: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1610: IEX_DEBUG_PUB.logMessage('cancel_strategy_and_workflow: l_startegy_id =>' || l_startegy_id);
1611: END IF;
1612:
1613: exception
1615: end;
1616:
1617: if l_startegy_id is not null then
1618: begin
1619: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1620: IEX_DEBUG_PUB.logMessage('cancel_strategy_and_workflow: Before calling IEX_STRATEGY_WF.SEND_SIGNAL');
1621: END IF;
1622: IEX_STRATEGY_WF.SEND_SIGNAL(process => 'IEXSTRY',
1623: strategy_id => l_startegy_id,
1622: IEX_STRATEGY_WF.SEND_SIGNAL(process => 'IEXSTRY',
1623: strategy_id => l_startegy_id,
1624: status => 'CANCELLED' ) ;
1625:
1626: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1627: IEX_DEBUG_PUB.logMessage('cancel_strategy_and_workflow: After calling IEX_STRATEGY_WF.SEND_SIGNAL');
1628: END IF;
1629: exception
1630: when others then
1627: IEX_DEBUG_PUB.logMessage('cancel_strategy_and_workflow: After calling IEX_STRATEGY_WF.SEND_SIGNAL');
1628: END IF;
1629: exception
1630: when others then
1631: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1632: IEX_DEBUG_PUB.logMessage('cancel_strategy_and_workflow: In others exception');
1633: END IF;
1634: Update iex_strategies set status_code = 'CANCELLED'
1635: where strategy_id = l_startegy_id;
1638: set status_code = 'CANCELLED'
1639: where strategy_id = l_startegy_id
1640: and status_code in ('PRE-WAIT','OPEN');
1641:
1642: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1643: IEX_DEBUG_PUB.logMessage('cancel_strategy_and_workflow: End of others exception');
1644: END IF;
1645: end;
1646: end if;
1647:
1648: if (p_disposition_code = 'WITHDRAWN') or (p_disposition_code = 'DISMISSED') then
1649: begin
1650: wf_engine.itemstatus(itemtype => l_item_type, itemkey => p_bankruptcy_id, status => l_status, result => l_result);
1651: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1652: IEX_DEBUG_PUB.logMessage('cancel_strategy_and_workflow: Workflow status =>' || l_status);
1653: END IF;
1654:
1655: IF l_status <> wf_engine.eng_completed THEN
1654:
1655: IF l_status <> wf_engine.eng_completed THEN
1656: wf_engine.abortprocess(itemtype => l_item_type, itemkey => p_bankruptcy_id);
1657: wf_engine.itemstatus(itemtype => l_item_type, itemkey => p_bankruptcy_id, status => l_status, result => l_result);
1658: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1659: IEX_DEBUG_PUB.logMessage('cancel_strategy_and_workflow: Abort process has completed and status =>' || l_status);
1660: END IF;
1661:
1662: END IF;
1671: Loop
1672: fetch get_cs_itemkey into l_itemkey;
1673: exit when get_cs_itemkey%NOTFOUND;
1674:
1675: if (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1676: IEX_DEBUG_PUB.logMessage('IEXDELCS Workflow Status = :: =>' || l_status||'and itemkey is...'||l_itemkey);
1677: end if;
1678:
1679: wf_engine.itemstatus(itemtype => 'IEXDELCS', itemkey => l_itemkey, status => l_status, result => l_result);
1676: IEX_DEBUG_PUB.logMessage('IEXDELCS Workflow Status = :: =>' || l_status||'and itemkey is...'||l_itemkey);
1677: end if;
1678:
1679: wf_engine.itemstatus(itemtype => 'IEXDELCS', itemkey => l_itemkey, status => l_status, result => l_result);
1680: if (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1681: IEX_DEBUG_PUB.logMessage('IEXDELCS Workflow Status = :: =>' || l_status||'and itemkey is...'||l_itemkey);
1682: end if;
1683:
1684: if l_status <> wf_engine.eng_completed THEN
1683:
1684: if l_status <> wf_engine.eng_completed THEN
1685: wf_engine.abortprocess(itemtype => 'IEXDELCS', itemkey => l_itemkey);
1686: wf_engine.itemstatus(itemtype => 'IEXDELCS', itemkey => l_itemkey, status => l_status, result => l_result);
1687: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1688: IEX_DEBUG_PUB.logMessage('cancel serviceHold_workflow: Abort process has completed and status =>' || l_status);
1689: END IF;
1690: end if;
1691: End Loop;
1702: Loop
1703: fetch get_cr_itemkey into l_itemkey;
1704: exit when get_cr_itemkey%NOTFOUND;
1705:
1706: if (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1707: IEX_DEBUG_PUB.logMessage('IEXDELCR Workflow Status = :: =>' || l_status||'and itemkwy is ...'||l_itemkey);
1708: end if;
1709:
1710: wf_engine.itemstatus(itemtype => 'IEXDELCR', itemkey => l_itemkey, status => l_status, result => l_result);
1707: IEX_DEBUG_PUB.logMessage('IEXDELCR Workflow Status = :: =>' || l_status||'and itemkwy is ...'||l_itemkey);
1708: end if;
1709:
1710: wf_engine.itemstatus(itemtype => 'IEXDELCR', itemkey => l_itemkey, status => l_status, result => l_result);
1711: if (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1712: IEX_DEBUG_PUB.logMessage('IEXDELCR Workflow Status = :: =>' || l_status||'and itemkwy is ...'||l_itemkey);
1713: end if;
1714:
1715: if l_status <> wf_engine.eng_completed THEN
1714:
1715: if l_status <> wf_engine.eng_completed THEN
1716: wf_engine.abortprocess(itemtype => 'IEXDELCR', itemkey => l_itemkey);
1717: wf_engine.itemstatus(itemtype => 'IEXDELCR', itemkey => l_itemkey, status => l_status, result => l_result);
1718: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1719: IEX_DEBUG_PUB.logMessage('cancel_creditHold_request_workflow: Abort process has completed and status =>' || l_status);
1720: END IF;
1721: end if;
1722: End Loop;
1730: -- End bug 7703313
1731:
1732: end if;
1733: commit;
1734: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1735: IEX_DEBUG_PUB.logMessage('End cancel_strategy_and_workflow');
1736: END IF;
1737: end cancel_strategy_and_workflow;
1738: --End bug 7661724 gnramasa 8th Jan 09
1757: WHERE bankruptcy_id = p_bankruptcy_id;
1758:
1759: BEGIN
1760:
1761: if (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1762: iex_debug_pub.logmessage ('**** START NOTIFY_CHECK ************');
1763: end if;
1764:
1765: if funcmode <> 'RUN' then
1784:
1785: result := wf_engine.eng_completed ||':'||l_result;
1786: iex_debug_pub.logmessage ('**** Result ==> '||l_notify);
1787:
1788: IF (FND_LOG.LEVEL_EVENT >= PG_DEBUG) THEN
1789: iex_debug_pub.logmessage ('**** END NOTIFY_CHECK ************');
1790: END IF;
1791:
1792: exception
1801:
1802: BEGIN
1803:
1804: G_PKG_NAME := 'IEX_WF_BAN_STATUS_PUB';
1805: PG_DEBUG := FND_LOG.G_CURRENT_RUNTIME_LEVEL;
1806:
1807: END IEX_WF_BAN_STATUS_PUB;