918:
919: /**
920: * Procedure : LAUNCH_WORKFLOW
921: * Type : Private
922: * Pre_reqs : WF_ENGINE.CREATEPROCESS, WF_ENGINE.SETITEMATTRTEXT, and
923: * WF_ENGINE.STARTPROCESS.
924: * Description : Create and Start workflow process
925: * Parameters :
926: * input parameters
919: /**
920: * Procedure : LAUNCH_WORKFLOW
921: * Type : Private
922: * Pre_reqs : WF_ENGINE.CREATEPROCESS, WF_ENGINE.SETITEMATTRTEXT, and
923: * WF_ENGINE.STARTPROCESS.
924: * Description : Create and Start workflow process
925: * Parameters :
926: * input parameters
927: * @param
963: FETCH get_next_itemkey INTO l_itemkey;
964: CLOSE get_next_itemkey;
965:
966: -- Call the Workflow API to send the notification.
967: WF_ENGINE.CREATEPROCESS (itemtype => l_itemtype,
968: itemkey => l_itemkey,
969: process => 'SEND_EMAIL_NOTIFICATION',
970: owner_role => FND_GLOBAL.USER_NAME);
971:
969: process => 'SEND_EMAIL_NOTIFICATION',
970: owner_role => FND_GLOBAL.USER_NAME);
971:
972: -- Set Workflow Item Attributes.
973: WF_ENGINE.SETITEMATTRTEXT (l_itemtype, l_itemkey, 'RECIPIENT_USERNAME', p_username);
974: WF_ENGINE.SETITEMATTRTEXT (l_itemtype, l_itemkey, 'SUBJECT', p_subject);
975: WF_ENGINE.SETITEMATTRTEXT (l_itemtype, l_itemkey, 'TEXT_BODY', p_text_body);
976:
977: IF (p_HTML_body is null) THEN
970: owner_role => FND_GLOBAL.USER_NAME);
971:
972: -- Set Workflow Item Attributes.
973: WF_ENGINE.SETITEMATTRTEXT (l_itemtype, l_itemkey, 'RECIPIENT_USERNAME', p_username);
974: WF_ENGINE.SETITEMATTRTEXT (l_itemtype, l_itemkey, 'SUBJECT', p_subject);
975: WF_ENGINE.SETITEMATTRTEXT (l_itemtype, l_itemkey, 'TEXT_BODY', p_text_body);
976:
977: IF (p_HTML_body is null) THEN
978: -- The Notification Preference is HTML but p_HTML_body is null, we need
971:
972: -- Set Workflow Item Attributes.
973: WF_ENGINE.SETITEMATTRTEXT (l_itemtype, l_itemkey, 'RECIPIENT_USERNAME', p_username);
974: WF_ENGINE.SETITEMATTRTEXT (l_itemtype, l_itemkey, 'SUBJECT', p_subject);
975: WF_ENGINE.SETITEMATTRTEXT (l_itemtype, l_itemkey, 'TEXT_BODY', p_text_body);
976:
977: IF (p_HTML_body is null) THEN
978: -- The Notification Preference is HTML but p_HTML_body is null, we need
979: -- to add
and
into the text body. This way, it will' || p_text_body || '
');
977: IF (p_HTML_body is null) THEN
978: -- The Notification Preference is HTML but p_HTML_body is null, we need
979: -- to add
and
into the text body. This way, it will' || p_text_body || '
');979: -- to add
and
into the text body. This way, it will' || p_text_body || '
');
982: ELSE
983: WF_ENGINE.SETITEMATTRTEXT (l_itemtype, l_itemkey, 'HTML_BODY', p_HTML_body);
984: END IF;
985:
986: WF_ENGINE.STARTPROCESS (l_itemtype, l_itemkey);
987: END LAUNCH_WORKFLOW;
988:
989: /**
990: * Procedure : EMAIL_NOTIFICATION
988:
989: /**
990: * Procedure : EMAIL_NOTIFICATION
991: * Type : Private
992: * Pre_reqs : WF_NOTIFICATION.Send, WF_ENGINE.SetItemAttrText
993: * Description : Send email notification to user with a username or/and
994: * email provided as input parameters.
995: * Parameters :
996: * input parameters