480: END IF;
481:
482: -- Approval Will go through Workflow
483: -- Creation of workflow process
484: WF_ENGINE.createProcess( ItemType => l_ItemType,
485: ItemKey => l_ItemKey,
486: process => 'IBC_CITEM_APPROVAL');
487:
488: -- Set WF attribute values
486: process => 'IBC_CITEM_APPROVAL');
487:
488: -- Set WF attribute values
489:
490: WF_ENGINE.SetItemAttrText( itemtype => l_ItemType,
491: itemkey => l_Itemkey,
492: aname => 'DIRECTORY_PATH',
493: avalue => l_directory_path);
494:
491: itemkey => l_Itemkey,
492: aname => 'DIRECTORY_PATH',
493: avalue => l_directory_path);
494:
495: WF_ENGINE.SetItemAttrText( itemtype => l_ItemType,
496: itemkey => l_Itemkey,
497: aname => 'SUBMITTED_BY',
498: avalue => FND_GLOBAL.USER_NAME);
499:
499:
500: OPEN c_submitter_name;
501: FETCH c_submitter_name INTO l_submitter_name;
502: IF c_submitter_name%FOUND AND l_submitter_name IS NOT NULL THEN
503: WF_ENGINE.SetItemAttrText( itemtype => l_ItemType,
504: itemkey => l_Itemkey,
505: aname => 'SUBMITTER_NAME',
506: avalue => l_submitter_name);
507: END IF;
527: ,x_msg_data => x_msg_data
528: );
529: -- Set ALREADY_APPROVED to Y
530: l_already_approved := 'Y'; -- Fix for bug# 3410110
531: WF_ENGINE.SetItemAttrText( itemtype => l_ItemType,
532: itemkey => l_Itemkey,
533: aname => 'ALREADY_APPROVED',
534: avalue => 'Y');
535:
548: ,x_msg_count => x_msg_count
549: ,x_msg_data => x_msg_data
550: );
551: -- Set ALREADY_APPROVED to N
552: WF_ENGINE.SetItemAttrText( itemtype => l_ItemType,
553: itemkey => l_Itemkey,
554: aname => 'ALREADY_APPROVED',
555: avalue => 'N');
556: END IF;
589: );
590: END IF;
591: END IF;
592:
593: WF_ENGINE.SetItemAttrText( itemtype => l_ItemType,
594: itemkey => l_Itemkey,
595: aname => 'NO_APPROVER_DEFINED',
596: avalue => l_wf_no_approver_defined);
597:
594: itemkey => l_Itemkey,
595: aname => 'NO_APPROVER_DEFINED',
596: avalue => l_wf_no_approver_defined);
597:
598: WF_ENGINE.SetItemAttrText( itemtype => l_ItemType,
599: itemkey => l_Itemkey,
600: aname => 'CITEM_APPROVER_ROLE',
601: avalue => l_wf_role_name);
602:
610: ,px_wf_role_name => l_wf_role_name
611: ,px_wf_role_display_name => l_wf_role_display_name
612: ,p_add_to_list => FND_GLOBAL.USER_NAME
613: );
614: WF_ENGINE.SetItemAttrText( itemtype => l_ItemType,
615: itemkey => l_Itemkey,
616: aname => 'REPLY_TO',
617: avalue => l_wf_role_name);
618: END IF;
618: END IF;
619:
620: CLOSE c_owner;
621:
622: WF_ENGINE.SetItemAttrNumber( itemtype => l_ItemType,
623: itemkey => l_Itemkey,
624: aname => 'CITEM_VER_ID',
625: avalue => p_citem_ver_id);
626:
623: itemkey => l_Itemkey,
624: aname => 'CITEM_VER_ID',
625: avalue => p_citem_ver_id);
626:
627: WF_ENGINE.SetItemAttrNumber( itemtype => l_ItemType,
628: itemkey => l_Itemkey,
629: aname => 'CITEM_VERSION_NBR',
630: avalue => l_version_number);
631:
628: itemkey => l_Itemkey,
629: aname => 'CITEM_VERSION_NBR',
630: avalue => l_version_number);
631:
632: WF_ENGINE.SetItemAttrNumber( itemtype => l_ItemType,
633: itemkey => l_Itemkey,
634: aname => 'CITEM_OBJECT_VERSION_NUMBER',
635: avalue => px_object_version_number);
636:
636:
637: OPEN c_citem_name(p_citem_ver_id);
638: FETCH c_citem_name INTO l_citem_name;
639: IF c_citem_name%FOUND AND l_citem_name IS NOT NULL THEN
640: WF_ENGINE.SetItemAttrText( itemtype => l_ItemType,
641: itemkey => l_Itemkey,
642: aname => 'CONTENT_ITEM_NAME',
643: avalue => l_citem_name);
644: END IF;
644: END IF;
645: CLOSE c_citem_name;
646:
647: IF p_notes_to_approver IS NOT NULL THEN
648: WF_ENGINE.SetItemAttrText( itemtype => l_ItemType,
649: itemkey => l_Itemkey,
650: aname => 'NOTES_TO_APPROVER',
651: avalue => p_notes_to_approver);
652: END IF;
651: avalue => p_notes_to_approver);
652: END IF;
653:
654: IF p_priority IS NOT NULL THEN
655: WF_ENGINE.SetItemAttrNumber( itemtype => l_ItemType,
656: itemkey => l_Itemkey,
657: aname => 'PRIORITY',
658: avalue => p_priority);
659: END IF;
658: avalue => p_priority);
659: END IF;
660:
661: IF p_callback_url IS NOT NULL THEN
662: WF_ENGINE.SetItemAttrText( itemtype => l_ItemType,
663: itemkey => l_Itemkey,
664: aname => 'UNTOUCHED_CALLBACK_URL',
665: avalue => p_callback_url);
666: -- Replace Info on Callback URL
688: l_ItemType);
689: l_format_callback_url := REPLACE(l_format_callback_url,
690: FND_GLOBAL.Local_Chr(38) || 'ITEM_KEY',
691: l_ItemKey);
692: WF_ENGINE.SetItemAttrText( itemtype => l_ItemType,
693: itemkey => l_Itemkey,
694: aname => 'ORIGINAL_CALLBACK_URL',
695: avalue => l_format_callback_url);
696:
697: l_format_callback_url := REPLACE(l_format_callback_url,
698: FND_GLOBAL.Local_Chr(38) || 'ACTION_MODE',
699: IBC_UTILITIES_PUB.G_STV_SUBMIT_FOR_APPROVAL);
700:
701: WF_ENGINE.SetItemAttrText( itemtype => l_ItemType,
702: itemkey => l_Itemkey,
703: aname => 'CALLBACK_URL',
704: avalue => l_format_callback_url);
705: l_callback_url_description := NVL(p_callback_url_description, l_format_callback_url);
702: itemkey => l_Itemkey,
703: aname => 'CALLBACK_URL',
704: avalue => l_format_callback_url);
705: l_callback_url_description := NVL(p_callback_url_description, l_format_callback_url);
706: WF_ENGINE.SetItemAttrText( itemtype => l_ItemType,
707: itemkey => l_Itemkey,
708: aname => 'CALLBACK_URL_DESCRIPTION',
709: avalue => l_callback_url_description);
710: END IF;
708: aname => 'CALLBACK_URL_DESCRIPTION',
709: avalue => l_callback_url_description);
710: END IF;
711:
712: WF_ENGINE.SetItemAttrText( itemtype => l_ItemType,
713: itemkey => l_Itemkey,
714: aname => 'CITEM_LANGUAGE',
715: avalue => p_language);
716:
714: aname => 'CITEM_LANGUAGE',
715: avalue => p_language);
716:
717: -- Start WF Process
718: WF_ENGINE.StartProcess ( ItemType => l_ItemType,
719: ItemKey => l_ItemKey);
720:
721: -- If everything is okay so far then set x_wf_item_key
722: x_wf_item_key := l_ItemKey;
807: BEGIN
808: result := '';
809: IF funcmode = 'RUN' THEN
810: result := 'COMPLETE:Y';
811: l_citem_ver_id := WF_ENGINE.GetItemAttrNumber(
812: itemtype => itemtype,
813: itemkey => itemkey,
814: aname => 'CITEM_VER_ID'
815: );
813: itemkey => itemkey,
814: aname => 'CITEM_VER_ID'
815: );
816: l_object_version_number := IBC_CITEM_ADMIN_GRP.getObjVerNum(getCitemId(l_citem_ver_id));
817: l_language := WF_ENGINE.GetItemAttrText(
818: itemtype => itemtype,
819: itemkey => itemkey,
820: aname => 'CITEM_LANGUAGE'
821: );
834: ,x_msg_data => l_msg_data
835: );
836:
837: IF l_return_status = FND_API.G_RET_STS_SUCCESS THEN
838: WF_ENGINE.SetItemAttrText( itemtype => itemtype,
839: itemkey => itemkey,
840: aname => 'APPROVER_NAME',
841: avalue => get_user_description(FND_GLOBAL.user_id));
842: l_callback_url := WF_ENGINE.GetItemAttrText(
838: WF_ENGINE.SetItemAttrText( itemtype => itemtype,
839: itemkey => itemkey,
840: aname => 'APPROVER_NAME',
841: avalue => get_user_description(FND_GLOBAL.user_id));
842: l_callback_url := WF_ENGINE.GetItemAttrText(
843: itemtype => itemtype,
844: itemkey => itemkey,
845: aname => 'ORIGINAL_CALLBACK_URL'
846: );
847: IF l_callback_url IS NOT NULL THEN
848: l_callback_url := REPLACE(l_callback_url,
849: FND_GLOBAL.Local_Chr(38) || 'ACTION_MODE',
850: IBC_UTILITIES_PUB.G_STV_APPROVED);
851: WF_ENGINE.SetItemAttrText(
852: itemtype => itemtype,
853: itemkey => itemkey,
854: aname => 'CALLBACK_URL',
855: avalue => l_callback_url
879: );
880: l_error_msg_stack := FND_GLOBAL.Newline() || 'CITEM_VER_ID:' || l_citem_ver_id ||
881: ' - Object Version Number:' || l_object_version_number ||
882: FND_GLOBAL.NewLine() || l_error_msg_stack;
883: WF_ENGINE.SetItemAttrText(
884: itemtype => itemtype,
885: itemkey => itemkey,
886: aname => 'ERROR_MESSAGE_STACK',
887: avalue => l_error_msg_stack
920: l_comments VARCHAR2(10000);
921: BEGIN
922: result := '';
923: IF funcmode IN ('RUN') THEN
924: l_callback_url := WF_ENGINE.GetItemAttrText(
925: itemtype => itemtype,
926: itemkey => itemkey,
927: aname => 'ORIGINAL_CALLBACK_URL'
928: );
925: itemtype => itemtype,
926: itemkey => itemkey,
927: aname => 'ORIGINAL_CALLBACK_URL'
928: );
929: l_response_code := WF_ENGINE.GetItemAttrText(
930: itemtype => itemtype,
931: itemkey => itemkey,
932: aname => 'RESULT'
933: );
932: aname => 'RESULT'
933: );
934: IF l_response_code = 'N'
935: THEN
936: l_citem_ver_id := WF_ENGINE.GetItemAttrNumber(
937: itemtype => itemtype,
938: itemkey => itemkey,
939: aname => 'CITEM_VER_ID'
940: );
938: itemkey => itemkey,
939: aname => 'CITEM_VER_ID'
940: );
941: l_object_version_number := IBC_CITEM_ADMIN_GRP.getObjVerNum(getCitemId(l_citem_ver_id));
942: l_language := WF_ENGINE.GetItemAttrText(
943: itemtype => itemtype,
944: itemkey => itemkey,
945: aname => 'CITEM_LANGUAGE'
946: );
959: IF l_callback_url IS NOT NULL THEN
960: l_callback_url := REPLACE(l_callback_url,
961: FND_GLOBAL.Local_Chr(38) || 'ACTION_MODE',
962: IBC_UTILITIES_PUB.G_STV_REJECTED);
963: WF_ENGINE.SetItemAttrText(
964: itemtype => itemtype,
965: itemkey => itemkey,
966: aname => 'CALLBACK_URL',
967: avalue => l_callback_url
970: END IF;
971:
972: IF l_return_status = FND_API.G_RET_STS_SUCCESS THEN
973: -- Audit Log Action
974: l_comments := WF_ENGINE.GetItemAttrText(
975: itemtype => itemtype,
976: itemkey => itemkey,
977: aname => 'NOTES_TO_SUBMITTER'
978: );
998: );
999: l_error_msg_stack := FND_GLOBAL.Newline() || 'CITEM_VER_ID:' || l_citem_ver_id ||
1000: ' - Object Version Number:' || l_object_version_number ||
1001: FND_GLOBAL.NewLine() || l_error_msg_stack;
1002: WF_ENGINE.SetItemAttrText(
1003: itemtype => itemtype,
1004: itemkey => itemkey,
1005: aname => 'ERROR_MESSAGE_STACK',
1006: avalue => l_error_msg_stack
1069:
1070: BEGIN
1071: result := '';
1072: IF funcmode IN ('RUN') THEN
1073: l_citem_ver_id := WF_ENGINE.GetItemAttrNumber(
1074: itemtype => itemtype,
1075: itemkey => itemkey,
1076: aname => 'CITEM_VER_ID'
1077: );
1074: itemtype => itemtype,
1075: itemkey => itemkey,
1076: aname => 'CITEM_VER_ID'
1077: );
1078: l_language := WF_ENGINE.GetItemAttrText(
1079: itemtype => itemtype,
1080: itemkey => itemkey,
1081: aname => 'CITEM_LANGUAGE'
1082: );
1114: ,px_wf_role_display_name => l_wf_role_display_name
1115: );
1116:
1117: -- Creation of Translations workflow process
1118: WF_ENGINE.createProcess( ItemType => l_ItemType,
1119: ItemKey => l_ItemKey,
1120: process => 'IBC_CITEM_TRANSLATE');
1121:
1122: -- Set Parent Process
1119: ItemKey => l_ItemKey,
1120: process => 'IBC_CITEM_TRANSLATE');
1121:
1122: -- Set Parent Process
1123: WF_ENGINE.set_item_parent(itemtype => l_ItemType,
1124: itemkey => l_ItemKey,
1125: parent_itemtype => itemtype,
1126: parent_itemkey => itemkey,
1127: parent_context => 'Parent Process');
1126: parent_itemkey => itemkey,
1127: parent_context => 'Parent Process');
1128:
1129: -- Set parameter CITEM_VER_ID
1130: WF_ENGINE.SetItemAttrNumber( itemtype => l_ItemType,
1131: itemkey => l_Itemkey,
1132: aname => 'CITEM_VER_ID',
1133: avalue => l_citem_ver_id);
1134:
1132: aname => 'CITEM_VER_ID',
1133: avalue => l_citem_ver_id);
1134:
1135: -- Set parameter CITEM_VERSION_NBR
1136: WF_ENGINE.SetItemAttrNumber( itemtype => l_ItemType,
1137: itemkey => l_Itemkey,
1138: aname => 'CITEM_VERSION_NBR',
1139: avalue => l_version_number);
1140:
1138: aname => 'CITEM_VERSION_NBR',
1139: avalue => l_version_number);
1140:
1141: -- Set parameter CITEM_TRANSLATORS_ROLE
1142: WF_ENGINE.SetItemAttrText( itemtype => l_ItemType,
1143: itemkey => l_Itemkey,
1144: aname => 'CITEM_TRANSLATORS_ROLE',
1145: avalue => l_wf_role_name);
1146:
1147: -- Set parameter CONTENT_ITEM_NAME
1148: OPEN c_citem_name(l_citem_ver_id, l_language);
1149: FETCH c_citem_name INTO l_citem_name;
1150: IF c_citem_name%FOUND AND l_citem_name IS NOT NULL THEN
1151: WF_ENGINE.SetItemAttrText( itemtype => l_ItemType,
1152: itemkey => l_Itemkey,
1153: aname => 'CONTENT_ITEM_NAME',
1154: avalue => l_citem_name);
1155: END IF;
1155: END IF;
1156: CLOSE c_citem_name;
1157:
1158: -- Set parameter CALLBACK_URL_DESCRIPTION
1159: WF_ENGINE.SetItemAttrText( itemtype => l_ItemType,
1160: itemkey => l_Itemkey,
1161: aname => 'CALLBACK_URL_DESCRIPTION',
1162: avalue => WF_ENGINE.GetItemAttrText(
1163: itemtype => itemtype,
1158: -- Set parameter CALLBACK_URL_DESCRIPTION
1159: WF_ENGINE.SetItemAttrText( itemtype => l_ItemType,
1160: itemkey => l_Itemkey,
1161: aname => 'CALLBACK_URL_DESCRIPTION',
1162: avalue => WF_ENGINE.GetItemAttrText(
1163: itemtype => itemtype,
1164: itemkey => itemkey,
1165: aname => 'CALLBACK_URL_DESCRIPTION'));
1166:
1165: aname => 'CALLBACK_URL_DESCRIPTION'));
1166:
1167:
1168: -- Replace Info on Callback URL
1169: l_format_callback_url := WF_ENGINE.GetItemAttrText(
1170: itemtype => itemtype,
1171: itemkey => itemkey,
1172: aname => 'UNTOUCHED_CALLBACK_URL'
1173: );
1197: l_ItemKey);
1198: l_format_callback_url := REPLACE(l_format_callback_url,
1199: FND_GLOBAL.Local_Chr(38) || 'ACTION_MODE',
1200: 'TRANSLATE');
1201: WF_ENGINE.SetItemAttrText( itemtype => l_ItemType,
1202: itemkey => l_Itemkey,
1203: aname => 'CALLBACK_URL',
1204: avalue => l_format_callback_url);
1205:
1203: aname => 'CALLBACK_URL',
1204: avalue => l_format_callback_url);
1205:
1206: -- Set directory Path
1207: WF_ENGINE.SetItemAttrText( itemtype => l_ItemType,
1208: itemkey => l_Itemkey,
1209: aname => 'DIRECTORY_PATH',
1210: avalue => l_directory_path);
1211:
1209: aname => 'DIRECTORY_PATH',
1210: avalue => l_directory_path);
1211:
1212: -- Start WF Process
1213: WF_ENGINE.StartProcess ( ItemType => l_ItemType,
1214: ItemKey => l_ItemKey);
1215:
1216: NULL;
1217: END IF;
1226: l_error_msg_stack := l_error_msg_stack || ' ... ' ||
1227: FND_MSG_PUB.get(p_encoded => FND_API.g_false) ||
1228: FND_GLOBAL.Newline();
1229: END LOOP;
1230: WF_ENGINE.SetItemAttrText(
1231: itemtype => itemtype,
1232: itemkey => itemkey,
1233: aname => 'ERROR_MESSAGE_STACK',
1234: avalue => l_error_msg_stack
1313: END IF;
1314: CLOSE c_chk_notification;
1315:
1316: IF p_response IN ('Y', 'N') THEN
1317: WF_ENGINE.SetItemAttrText( itemtype => p_item_type,
1318: itemkey => p_item_key,
1319: aname => 'APPROVER_NAME',
1320: avalue => get_user_description(FND_GLOBAL.user_id));
1321: IF p_notes_to_submitter IS NOT NULL THEN
1318: itemkey => p_item_key,
1319: aname => 'APPROVER_NAME',
1320: avalue => get_user_description(FND_GLOBAL.user_id));
1321: IF p_notes_to_submitter IS NOT NULL THEN
1322: WF_ENGINE.SetItemAttrText( itemtype => p_item_type,
1323: itemkey => p_item_key,
1324: aname => 'NOTES_TO_SUBMITTER',
1325: avalue => p_notes_to_submitter);
1326: END IF;
1323: itemkey => p_item_key,
1324: aname => 'NOTES_TO_SUBMITTER',
1325: avalue => p_notes_to_submitter);
1326: END IF;
1327: WF_ENGINE.SetItemAttrText( itemtype => p_item_type,
1328: itemkey => p_item_key,
1329: aname => 'RESULT',
1330: avalue => p_response);
1331: WF_ENGINE.CompleteActivity(p_item_type,
1327: WF_ENGINE.SetItemAttrText( itemtype => p_item_type,
1328: itemkey => p_item_key,
1329: aname => 'RESULT',
1330: avalue => p_response);
1331: WF_ENGINE.CompleteActivity(p_item_type,
1332: p_item_key,
1333: p_activity,
1334: p_response);
1335: ELSE
1442: x_return_status := FND_API.G_RET_STS_SUCCESS;
1443:
1444: -- Begin
1445:
1446: WF_ENGINE.CompleteActivity(p_item_type,
1447: p_item_key,
1448: 'IBC_CITEM_TRANSLATE_REQ',
1449: NULL);
1450:
2089: );
2090:
2091: -- Workflow related Code
2092: -- Creation of workflow process for Content Item Translation Approval
2093: WF_ENGINE.createProcess(itemType => l_ItemType
2094: ,itemKey => l_ItemKey
2095: ,process => 'IBC_CITEM_TRANSLATE_APPROVAL'
2096: );
2097:
2095: ,process => 'IBC_CITEM_TRANSLATE_APPROVAL'
2096: );
2097:
2098: -- Set WF attribute values
2099: WF_ENGINE.SetItemAttrText(itemtype => l_ItemType
2100: ,itemkey => l_Itemkey
2101: ,aname => 'DIRECTORY_PATH'
2102: ,avalue => l_directory_path
2103: );
2101: ,aname => 'DIRECTORY_PATH'
2102: ,avalue => l_directory_path
2103: );
2104:
2105: WF_ENGINE.SetItemAttrText(itemtype => l_ItemType
2106: ,itemkey => l_Itemkey
2107: ,aname => 'SUBMITTED_BY'
2108: ,avalue => FND_GLOBAL.USER_NAME
2109: );
2110:
2111: OPEN c_submitter_name;
2112: FETCH c_submitter_name INTO l_submitter_name;
2113: IF c_submitter_name%FOUND AND l_submitter_name IS NOT NULL THEN
2114: WF_ENGINE.SetItemAttrText(itemtype => l_ItemType
2115: ,itemkey => l_Itemkey
2116: ,aname => 'SUBMITTER_NAME'
2117: ,avalue => l_submitter_name
2118: );
2161: END IF;
2162: END IF;
2163:
2164:
2165: WF_ENGINE.SetItemAttrText(itemtype => l_ItemType
2166: ,itemkey => l_Itemkey
2167: ,aname => 'NO_APPROVER_DEFINED'
2168: ,avalue => l_wf_no_approver_defined
2169: );
2167: ,aname => 'NO_APPROVER_DEFINED'
2168: ,avalue => l_wf_no_approver_defined
2169: );
2170:
2171: WF_ENGINE.SetItemAttrText(itemtype => l_ItemType
2172: ,itemkey => l_Itemkey
2173: ,aname => 'CITEM_TRANS_APPROVER_ROLE'--'CITEM_APPROVER_ROLE'
2174: ,avalue => l_wf_role_name);
2175:
2182: ,px_wf_role_name => l_wf_role_name
2183: ,px_wf_role_display_name => l_wf_role_display_name
2184: ,p_add_to_list => FND_GLOBAL.USER_NAME
2185: );
2186: WF_ENGINE.SetItemAttrText(itemtype => l_ItemType
2187: ,itemkey => l_Itemkey
2188: ,aname => 'REPLY_TO'
2189: ,avalue => l_wf_role_name);
2190: CLOSE c_owner;
2188: ,aname => 'REPLY_TO'
2189: ,avalue => l_wf_role_name);
2190: CLOSE c_owner;
2191:
2192: WF_ENGINE.SetItemAttrNumber(itemtype => l_ItemType
2193: ,itemkey => l_Itemkey
2194: ,aname => 'CITEM_VER_ID'
2195: ,avalue => p_citem_ver_id);
2196:
2193: ,itemkey => l_Itemkey
2194: ,aname => 'CITEM_VER_ID'
2195: ,avalue => p_citem_ver_id);
2196:
2197: WF_ENGINE.SetItemAttrNumber(itemtype => l_ItemType
2198: ,itemkey => l_Itemkey
2199: ,aname => 'CITEM_VERSION_NBR'
2200: ,avalue => l_version_number);
2201:
2198: ,itemkey => l_Itemkey
2199: ,aname => 'CITEM_VERSION_NBR'
2200: ,avalue => l_version_number);
2201:
2202: WF_ENGINE.SetItemAttrNumber(itemtype => l_ItemType
2203: ,itemkey => l_Itemkey
2204: ,aname => 'CITEM_OBJECT_VERSION_NUMBER'
2205: ,avalue => px_object_version_number);
2206:
2206:
2207: OPEN c_citem_name(p_citem_ver_id);
2208: FETCH c_citem_name INTO l_citem_name;
2209: IF c_citem_name%FOUND AND l_citem_name IS NOT NULL THEN
2210: WF_ENGINE.SetItemAttrText(itemtype => l_ItemType
2211: ,itemkey => l_Itemkey
2212: ,aname => 'CONTENT_ITEM_NAME'
2213: ,avalue => l_citem_name);
2214: END IF;
2214: END IF;
2215: CLOSE c_citem_name;
2216:
2217: IF p_notes_to_approver IS NOT NULL THEN
2218: WF_ENGINE.SetItemAttrText(itemtype => l_ItemType
2219: ,itemkey => l_Itemkey
2220: ,aname => 'NOTES_TO_APPROVER'
2221: ,avalue => p_notes_to_approver);
2222: END IF;
2221: ,avalue => p_notes_to_approver);
2222: END IF;
2223:
2224: IF p_priority IS NOT NULL THEN
2225: WF_ENGINE.SetItemAttrNumber(itemtype => l_ItemType
2226: ,itemkey => l_Itemkey
2227: ,aname => 'PRIORITY'
2228: ,avalue => p_priority);
2229: END IF;
2228: ,avalue => p_priority);
2229: END IF;
2230:
2231: IF p_callback_url IS NOT NULL THEN
2232: WF_ENGINE.SetItemAttrText(itemtype => l_ItemType
2233: ,itemkey => l_Itemkey
2234: ,aname => 'UNTOUCHED_CALLBACK_URL'
2235: ,avalue => p_callback_url);
2236:
2251: l_format_callback_url := REPLACE(l_format_callback_url
2252: ,FND_GLOBAL.Local_Chr(38) || 'ITEM_KEY'
2253: ,l_ItemKey);
2254:
2255: WF_ENGINE.SetItemAttrText(itemtype => l_ItemType
2256: ,itemkey => l_Itemkey
2257: ,aname => 'ORIGINAL_CALLBACK_URL'
2258: ,avalue => l_format_callback_url);
2259:
2260: l_format_callback_url := REPLACE(l_format_callback_url
2261: ,FND_GLOBAL.Local_Chr(38) || 'ACTION_MODE'
2262: ,IBC_UTILITIES_PUB.G_STV_SUBMIT_FOR_APPROVAL);
2263:
2264: WF_ENGINE.SetItemAttrText(itemtype => l_ItemType
2265: ,itemkey => l_Itemkey
2266: ,aname => 'CALLBACK_URL'
2267: ,avalue => l_format_callback_url);
2268:
2266: ,aname => 'CALLBACK_URL'
2267: ,avalue => l_format_callback_url);
2268:
2269: l_callback_url_description := NVL(p_callback_url_description, l_format_callback_url);
2270: WF_ENGINE.SetItemAttrText(itemtype => l_ItemType
2271: ,itemkey => l_Itemkey
2272: ,aname => 'CALLBACK_URL_DESCRIPTION'
2273: ,avalue => l_callback_url_description);
2274: END IF;
2272: ,aname => 'CALLBACK_URL_DESCRIPTION'
2273: ,avalue => l_callback_url_description);
2274: END IF;
2275:
2276: WF_ENGINE.SetItemAttrText(itemtype => l_ItemType
2277: ,itemkey => l_Itemkey
2278: ,aname => 'CITEM_LANGUAGE'
2279: ,avalue => p_language);
2280:
2282: IBC_UTILITIES_PVT.Get_Language_Description(p_language_code => p_language
2283: ,p_language_description => l_language_description
2284: );
2285: --DBMS_OUTPUT.put_line('l_language_description =' || l_language_description);
2286: WF_ENGINE.SetItemAttrText(itemtype => l_ItemType
2287: ,itemkey => l_Itemkey
2288: ,aname => 'CITEM_LANGUAGE_DESCRIPTION'
2289: ,avalue => l_language_description);
2290:
2289: ,avalue => l_language_description);
2290:
2291:
2292: -- Start WF Process
2293: WF_ENGINE.StartProcess (ItemType => l_ItemType
2294: ,ItemKey => l_ItemKey);
2295:
2296: -- If everything is okay so far then set x_wf_item_key
2297: x_wf_item_key := l_ItemKey;
2390: result := '';
2391: IF funcmode IN ('RUN') THEN
2392: -- commented to fix 5255155
2393: /*
2394: l_callback_url := WF_ENGINE.GetItemAttrText(itemtype => itemtype
2395: ,itemkey => itemkey
2396: ,aname => 'ORIGINAL_CALLBACK_URL'
2397: );
2398: */
2396: ,aname => 'ORIGINAL_CALLBACK_URL'
2397: );
2398: */
2399:
2400: l_response_code := WF_ENGINE.GetItemAttrText(itemtype => itemtype
2401: ,itemkey => itemkey
2402: ,aname => 'RESULT'
2403: );
2404: IF l_response_code = 'N'
2402: ,aname => 'RESULT'
2403: );
2404: IF l_response_code = 'N'
2405: THEN
2406: l_citem_ver_id := WF_ENGINE.GetItemAttrNumber(itemtype => itemtype
2407: ,itemkey => itemkey
2408: ,aname => 'CITEM_VER_ID'
2409: );
2410:
2409: );
2410:
2411: l_object_version_number := IBC_CITEM_ADMIN_GRP.getObjVerNum(getCitemId(l_citem_ver_id));
2412:
2413: l_language := WF_ENGINE.GetItemAttrText(itemtype => itemtype
2414: ,itemkey => itemkey
2415: ,aname => 'CITEM_LANGUAGE'
2416: );
2417:
2434: ,FND_GLOBAL.Local_Chr(38) || 'ACTION_MODE'
2435: ,IBC_UTILITIES_PUB.G_STV_REJECTED
2436: );
2437:
2438: WF_ENGINE.SetItemAttrText(itemtype => itemtype
2439: ,itemkey => itemkey
2440: ,aname => 'CALLBACK_URL'
2441: ,avalue => l_callback_url
2442: );
2444: END IF;
2445:
2446: IF l_return_status = FND_API.G_RET_STS_SUCCESS THEN
2447: -- Audit Log Action
2448: l_comments := WF_ENGINE.GetItemAttrText(itemtype => itemtype
2449: ,itemkey => itemkey
2450: ,aname => 'NOTES_TO_SUBMITTER'
2451: );
2452: -- Logging
2484: ||l_object_version_number
2485: ||FND_GLOBAL.NewLine()
2486: ||l_error_msg_stack;
2487:
2488: WF_ENGINE.SetItemAttrText(itemtype => itemtype
2489: ,itemkey => itemkey
2490: ,aname => 'ERROR_MESSAGE_STACK'
2491: ,avalue => l_error_msg_stack
2492: );
2531: BEGIN
2532: result := '';
2533: IF funcmode = 'RUN' THEN
2534: result := 'COMPLETE:Y';
2535: l_citem_ver_id := WF_ENGINE.GetItemAttrNumber(itemtype => itemtype
2536: ,itemkey => itemkey
2537: ,aname => 'CITEM_VER_ID'
2538: );
2539:
2538: );
2539:
2540: l_object_version_number := IBC_CITEM_ADMIN_GRP.getObjVerNum(getCitemId(l_citem_ver_id));
2541:
2542: l_language := WF_ENGINE.GetItemAttrText(itemtype => itemtype
2543: ,itemkey => itemkey
2544: ,aname => 'CITEM_LANGUAGE'
2545: );
2546:
2559: );
2560:
2561:
2562: IF l_return_status = FND_API.G_RET_STS_SUCCESS THEN
2563: WF_ENGINE.SetItemAttrText(itemtype => itemtype
2564: ,itemkey => itemkey
2565: ,aname => 'APPROVER_NAME'
2566: ,avalue => get_user_description(FND_GLOBAL.user_id)
2567: );
2565: ,aname => 'APPROVER_NAME'
2566: ,avalue => get_user_description(FND_GLOBAL.user_id)
2567: );
2568:
2569: l_callback_url := WF_ENGINE.GetItemAttrText(itemtype => itemtype
2570: ,itemkey => itemkey
2571: ,aname => 'ORIGINAL_CALLBACK_URL'
2572: );
2573:
2576: ,FND_GLOBAL.Local_Chr(38) || 'ACTION_MODE'
2577: ,IBC_UTILITIES_PUB.G_STV_APPROVED
2578: );
2579:
2580: WF_ENGINE.SetItemAttrText(itemtype => itemtype
2581: ,itemkey => itemkey
2582: ,aname => 'CALLBACK_URL'
2583: ,avalue => l_callback_url
2584: );
2619: ||l_object_version_number
2620: ||FND_GLOBAL.NewLine()
2621: || l_error_msg_stack;
2622:
2623: WF_ENGINE.SetItemAttrText(itemtype => itemtype
2624: ,itemkey => itemkey
2625: ,aname => 'ERROR_MESSAGE_STACK'
2626: ,avalue => l_error_msg_stack
2627: );