1308:
1309: -- "RUN"
1310: IF (funcmode = 'RUN') THEN
1311: --l_user_id := fnd_profile.value('OKL_LEASE_FUNDING_APPROVER');
1312: l_user_id := wf_engine.GetItemAttrText (itemtype => itemtype,
1313: itemkey => itemkey,
1314: aname => G_WF_ITM_REQUESTER_ID);
1315:
1316: l_funding_number := wf_engine.GetItemAttrText (itemtype => itemtype,
1312: l_user_id := wf_engine.GetItemAttrText (itemtype => itemtype,
1313: itemkey => itemkey,
1314: aname => G_WF_ITM_REQUESTER_ID);
1315:
1316: l_funding_number := wf_engine.GetItemAttrText (itemtype => itemtype,
1317: itemkey => itemkey,
1318: aname => G_WF_ITM_FUNDING_NUMBER);
1319:
1320: resultout := 'COMPLETE:NOT_FOUND'; -- default
1320: resultout := 'COMPLETE:NOT_FOUND'; -- default
1321: IF l_user_id IS NOT NULL THEN
1322: FOR l_fnd_users_rec IN l_fnd_users_csr(l_user_id)
1323: LOOP
1324: wf_engine.SetItemAttrText (itemtype => itemtype,
1325: itemkey => itemkey,
1326: aname => G_WF_ITM_APPROVER,
1327: avalue => l_fnd_users_rec.user_name);
1328:
1326: aname => G_WF_ITM_APPROVER,
1327: avalue => l_fnd_users_rec.user_name);
1328:
1329:
1330: wf_engine.SetItemAttrText (itemtype => itemtype,
1331: itemkey => itemkey,
1332: aname => G_WF_ITM_MESSAGE_SUBJECT,
1333: avalue =>
1334: get_message('OKL_LLA_FUND_REQ_APPROVAL_SUB',l_funding_number));
1377: BEGIN
1378: SAVEPOINT set_atts;
1379: IF (funcmode = 'RUN') THEN
1380: -- Get current approval status
1381: l_result := wf_engine.GetItemAttrText (itemtype => itemtype,
1382: itemkey => itemkey,
1383: aname => G_WF_ITM_RESULT);
1384:
1385: l_parent_key := wf_engine.GetItemAttrText
1381: l_result := wf_engine.GetItemAttrText (itemtype => itemtype,
1382: itemkey => itemkey,
1383: aname => G_WF_ITM_RESULT);
1384:
1385: l_parent_key := wf_engine.GetItemAttrText
1386: (itemtype => itemtype,
1387: itemkey => itemkey,
1388: aname => G_WF_ITM_PARENT_ITEM_KEY);
1389:
1386: (itemtype => itemtype,
1387: itemkey => itemkey,
1388: aname => G_WF_ITM_PARENT_ITEM_KEY);
1389:
1390: l_parent_type := wf_engine.GetItemAttrText
1391: (itemtype => itemtype,
1392: itemkey => itemkey,
1393: aname => G_WF_ITM_PARENT_ITEM_TYPE);
1394:
1391: (itemtype => itemtype,
1392: itemkey => itemkey,
1393: aname => G_WF_ITM_PARENT_ITEM_TYPE);
1394:
1395: l_funding_number := wf_engine.GetItemAttrText
1396: (itemtype => itemtype,
1397: itemkey => itemkey,
1398: aname => G_WF_ITM_FUNDING_NUMBER);
1399: IF l_result = G_WF_ITM_RESULT_APPROVED THEN
1397: itemkey => itemkey,
1398: aname => G_WF_ITM_FUNDING_NUMBER);
1399: IF l_result = G_WF_ITM_RESULT_APPROVED THEN
1400: l_approved_yn := G_WF_ITM_APPROVED_YN_YES;
1401: wf_engine.SetItemAttrText (itemtype => itemtype,
1402: itemkey => itemkey,
1403: aname => G_WF_ITM_MESSAGE_SUBJECT,
1404: avalue =>
1405: -- Fixed incorrect message token 12-05-2003 cklee
1405: -- Fixed incorrect message token 12-05-2003 cklee
1406: get_message('OKL_LLA_FUND_REQ_APPROVAL_SUB',l_funding_number));
1407: ELSE
1408: l_approved_yn := G_WF_ITM_APPROVED_YN_NO;
1409: wf_engine.SetItemAttrText (itemtype => itemtype,
1410: itemkey => itemkey,
1411: aname => G_WF_ITM_MESSAGE_SUBJECT,
1412: avalue =>
1413: get_message('OKL_LLA_FUND_REQ_REJECTED_SUB',l_funding_number));
1412: avalue =>
1413: get_message('OKL_LLA_FUND_REQ_REJECTED_SUB',l_funding_number));
1414: END IF;
1415:
1416: wf_engine.SetItemAttrText(itemtype => l_parent_type,
1417: itemkey => l_parent_key,
1418: aname => G_WF_ITM_APPROVED_YN,
1419: avalue => l_approved_yn);
1420: resultout := 'COMPLETE:';
1503: --For bug 8788410 - NIKSHAH: END
1504:
1505: BEGIN
1506: -- We getting the contract_Id from WF
1507: l_funding_id := wf_engine.GetItemAttrText(itemtype => itemtype,
1508: itemkey => itemkey,
1509: aname => G_WF_ITM_FUNDING_ID);
1510:
1511: --For bug 8788410 - NIKSHAH: START
1519: END IF;
1520: --For bug 8788410 - NIKSHAH: END
1521: --Run Mode
1522: IF funcmode = 'RUN' THEN
1523: l_approved_yn := wf_engine.GetItemAttrText (itemtype => itemtype,
1524: itemkey => itemkey,
1525: aname => G_WF_ITM_APPROVED_YN);
1526:
1527: IF l_approved_yn = G_WF_ITM_APPROVED_YN_YES THEN
1559: END IF;
1560: END IF;
1561:
1562: -- trx's trx_number IS ame's trx_id
1563: l_trx_number := wf_engine.GetItemAttrText (itemtype => itemtype,
1564: itemkey => itemkey,
1565: aname => G_WF_ITM_TRANSACTION_ID);
1566:
1567: FOR l_okl_trx_contracts_rec IN l_okl_trx_contracts_csr(l_trx_number)
1592: RETURN;
1593: END IF;
1594: --Transfer Mode
1595: IF funcmode = 'TRANSFER' THEN
1596: resultout := wf_engine.eng_null;
1597: RETURN;
1598: END IF;
1599: -- CANCEL mode
1600: IF (funcmode = 'CANCEL') THEN
1662: l_message VARCHAR2(4000);
1663: l_funding_id NUMBER;
1664: BEGIN
1665:
1666: l_funding_id := wf_engine.GetItemAttrText (
1667: itemtype => G_ITEM_TYPE_WF,
1668: itemkey => document_id,
1669: aname => G_WF_ITM_FUNDING_ID);
1670:
1698:
1699: l_approval_option := fnd_profile.value('OKL_LEASE_FUNDING_APPROVAL_PROCESS');
1700: IF l_approval_option = G_LEASE_FUNDING_APPROVAL_AME THEN
1701:
1702: l_funding_id := wf_engine.GetItemAttrText(itemtype => itemtype,
1703: itemkey => itemkey,
1704: aname => G_WF_ITM_FUNDING_ID);
1705:
1706: l_funding_number := wf_engine.GetItemAttrText(itemtype => itemtype,
1702: l_funding_id := wf_engine.GetItemAttrText(itemtype => itemtype,
1703: itemkey => itemkey,
1704: aname => G_WF_ITM_FUNDING_ID);
1705:
1706: l_funding_number := wf_engine.GetItemAttrText(itemtype => itemtype,
1707: itemkey => itemkey,
1708: aname => G_WF_ITM_FUNDING_NUMBER);
1709: wf_engine.SetItemAttrText (itemtype => itemtype,
1710: itemkey => itemkey,
1705:
1706: l_funding_number := wf_engine.GetItemAttrText(itemtype => itemtype,
1707: itemkey => itemkey,
1708: aname => G_WF_ITM_FUNDING_NUMBER);
1709: wf_engine.SetItemAttrText (itemtype => itemtype,
1710: itemkey => itemkey,
1711: aname => G_WF_ITM_MESSAGE_DESCRIPTION,
1712: avalue => compile_message(l_funding_id));
1713:
1710: itemkey => itemkey,
1711: aname => G_WF_ITM_MESSAGE_DESCRIPTION,
1712: avalue => compile_message(l_funding_id));
1713:
1714: wf_engine.SetItemAttrText (itemtype => itemtype,
1715: itemkey => itemkey,
1716: aname => G_WF_ITM_APP_REQUEST_SUB,
1717: avalue =>
1718: get_message('OKL_LLA_FUND_REQ_APPROVAL_SUB',l_funding_number));
1716: aname => G_WF_ITM_APP_REQUEST_SUB,
1717: avalue =>
1718: get_message('OKL_LLA_FUND_REQ_APPROVAL_SUB',l_funding_number));
1719:
1720: wf_engine.SetItemAttrText (itemtype => itemtype,
1721: itemkey => itemkey,
1722: aname => G_WF_ITM_APP_REMINDER_SUB,
1723: avalue =>
1724: get_message('OKL_LLA_FUND_REQ_APPR_SUB_REMD',l_funding_number));
1722: aname => G_WF_ITM_APP_REMINDER_SUB,
1723: avalue =>
1724: get_message('OKL_LLA_FUND_REQ_APPR_SUB_REMD',l_funding_number));
1725:
1726: wf_engine.SetItemAttrText (itemtype => itemtype,
1727: itemkey => itemkey,
1728: aname => G_WF_ITM_APP_APPROVED_SUB,
1729: avalue =>
1730: -- Fixed incorrect message token 12-05-2003 cklee
1729: avalue =>
1730: -- Fixed incorrect message token 12-05-2003 cklee
1731: get_message('OKL_LLA_FUND_REQ_APPROVAL_SUB',l_funding_number));
1732:
1733: wf_engine.SetItemAttrText (itemtype => itemtype,
1734: itemkey => itemkey,
1735: aname => G_WF_ITM_APP_REJECTED_SUB,
1736: avalue =>
1737: get_message('OKL_LLA_FUND_REQ_REJECTED_SUB',l_funding_number));
1735: aname => G_WF_ITM_APP_REJECTED_SUB,
1736: avalue =>
1737: get_message('OKL_LLA_FUND_REQ_REJECTED_SUB',l_funding_number));
1738:
1739: wf_engine.SetItemAttrText (itemtype => itemtype,
1740: itemkey => itemkey,
1741: aname => G_WF_ITM_APP_REMINDER_HEAD,
1742: avalue =>
1743: get_message('OKL_LLA_FUND_REQ_APPROVAL_REMD',l_funding_number));
1741: aname => G_WF_ITM_APP_REMINDER_HEAD,
1742: avalue =>
1743: get_message('OKL_LLA_FUND_REQ_APPROVAL_REMD',l_funding_number));
1744:
1745: wf_engine.SetItemAttrText (itemtype => itemtype,
1746: itemkey => itemkey,
1747: aname => G_WF_ITM_APP_APPROVED_HEAD,
1748: avalue =>
1749: -- Fixed incorrect message token 12-05-2003 cklee
1748: avalue =>
1749: -- Fixed incorrect message token 12-05-2003 cklee
1750: get_message('OKL_LLA_FUND_REQ_APPROVAL_SUB',l_funding_number));
1751:
1752: wf_engine.SetItemAttrText (itemtype => itemtype,
1753: itemkey => itemkey,
1754: aname => G_WF_ITM_APP_REJECTED_HEAD,
1755: avalue =>
1756: get_message('OKL_LLA_FUND_REQ_REJECTED_SUB',l_funding_number));
1821: CLOSE l_wf_item_key_csr;
1822:
1823: IF (funcmode = 'RUN') THEN
1824:
1825: wf_engine.CreateProcess(itemtype => l_item_type,
1826: itemkey => l_key,
1827: process => l_process);
1828:
1829: wf_engine.SetItemParent(itemtype => l_item_type,
1825: wf_engine.CreateProcess(itemtype => l_item_type,
1826: itemkey => l_key,
1827: process => l_process);
1828:
1829: wf_engine.SetItemParent(itemtype => l_item_type,
1830: itemkey => l_key,
1831: parent_itemtype => itemtype,
1832: parent_itemkey => itemkey,
1833: parent_context => G_WF_ITM_MASTER);
1831: parent_itemtype => itemtype,
1832: parent_itemkey => itemkey,
1833: parent_context => G_WF_ITM_MASTER);
1834:
1835: wf_engine.SetItemAttrText (
1836: itemtype => l_item_type,
1837: itemkey => l_key,
1838: aname => G_WF_ITM_PARENT_ITEM_KEY,
1839: avalue => itemkey);
1837: itemkey => l_key,
1838: aname => G_WF_ITM_PARENT_ITEM_KEY,
1839: avalue => itemkey);
1840:
1841: wf_engine.SetItemAttrText (
1842: itemtype => l_item_type,
1843: itemkey => l_key,
1844: aname => G_WF_ITM_PARENT_ITEM_TYPE,
1845: avalue => itemtype);
1845: avalue => itemtype);
1846:
1847: -- Re populate Item Attributes for the Detail Process
1848:
1849: l_funding_id := wf_engine.GetItemAttrText (itemtype => itemtype,
1850: itemkey => itemkey,
1851: aname => G_WF_ITM_FUNDING_ID);
1852:
1853: l_funding_number := wf_engine.GetItemAttrText (itemtype => itemtype,
1849: l_funding_id := wf_engine.GetItemAttrText (itemtype => itemtype,
1850: itemkey => itemkey,
1851: aname => G_WF_ITM_FUNDING_ID);
1852:
1853: l_funding_number := wf_engine.GetItemAttrText (itemtype => itemtype,
1854: itemkey => itemkey,
1855: aname => G_WF_ITM_FUNDING_NUMBER);
1856:
1857: l_requester := wf_engine.GetItemAttrText (itemtype => itemtype,
1853: l_funding_number := wf_engine.GetItemAttrText (itemtype => itemtype,
1854: itemkey => itemkey,
1855: aname => G_WF_ITM_FUNDING_NUMBER);
1856:
1857: l_requester := wf_engine.GetItemAttrText (itemtype => itemtype,
1858: itemkey => itemkey,
1859: aname => G_WF_ITM_REQUESTER);
1860:
1861: l_requester_id := wf_engine.GetItemAttrText (itemtype => itemtype,
1857: l_requester := wf_engine.GetItemAttrText (itemtype => itemtype,
1858: itemkey => itemkey,
1859: aname => G_WF_ITM_REQUESTER);
1860:
1861: l_requester_id := wf_engine.GetItemAttrText (itemtype => itemtype,
1862: itemkey => itemkey,
1863: aname => G_WF_ITM_REQUESTER_ID);
1864:
1865: wf_engine.SetItemAttrText (
1861: l_requester_id := wf_engine.GetItemAttrText (itemtype => itemtype,
1862: itemkey => itemkey,
1863: aname => G_WF_ITM_REQUESTER_ID);
1864:
1865: wf_engine.SetItemAttrText (
1866: itemtype => l_item_type,
1867: itemkey => l_key,
1868: aname => G_WF_ITM_FUNDING_ID,
1869: avalue => l_funding_id);
1867: itemkey => l_key,
1868: aname => G_WF_ITM_FUNDING_ID,
1869: avalue => l_funding_id);
1870:
1871: wf_engine.SetItemAttrText (
1872: itemtype => l_item_type,
1873: itemkey => l_key,
1874: aname => G_WF_ITM_FUNDING_NUMBER,
1875: avalue => l_funding_number);
1873: itemkey => l_key,
1874: aname => G_WF_ITM_FUNDING_NUMBER,
1875: avalue => l_funding_number);
1876:
1877: wf_engine.SetItemAttrText (
1878: itemtype => l_item_type,
1879: itemkey => l_key,
1880: aname => G_WF_ITM_REQUESTER,
1881: avalue => l_requester);
1878: itemtype => l_item_type,
1879: itemkey => l_key,
1880: aname => G_WF_ITM_REQUESTER,
1881: avalue => l_requester);
1882: wf_engine.SetItemAttrText (
1883: itemtype => l_item_type,
1884: itemkey => l_key,
1885: aname => G_WF_ITM_REQUESTER_ID,
1886: avalue => l_requester_id);
1885: aname => G_WF_ITM_REQUESTER_ID,
1886: avalue => l_requester_id);
1887:
1888: -- Set the Message Document
1889: wf_engine.SetItemAttrText (itemtype => l_item_type,
1890: itemkey => l_key,
1891: aname => G_WF_ITM_MESSAGE_DOC,
1892: avalue => 'plsql:OKL_FUNDING_WF.pop_approval_doc/'||l_key);
1893:
1891: aname => G_WF_ITM_MESSAGE_DOC,
1892: avalue => 'plsql:OKL_FUNDING_WF.pop_approval_doc/'||l_key);
1893:
1894: -- Now, Start the Detail Process
1895: wf_engine.StartProcess(itemtype => l_item_type,
1896: itemkey => l_key);
1897:
1898: resultout := 'COMPLETE:';
1899: RETURN;