Join the OracleApps88 Telegram group @OracleApps88to get more information on Oracle EBS R12/Oracle Fusion applications.

If you are facing any issues while copying the Code/Script or any issues with Posts, Please send a mail to OracleApp88@Yahoo.com or message me at @apps88 or +91 905 957 4321 in telegram.

Friday, October 18, 2013

How to Launch Workflow from PL SQL



The below script will launch the desired workflow from PL/SQL code:

declare
   v_itemtype   VARCHAR2(50);
   v_itemkey    VARCHAR2(50);
   v_process    VARCHAR2(50);
   v_userkey    VARCHAR2(50);
begin
    v_itemtype := 'DEMOIT';
    v_itemkey := '1233';
    v_userkey := '1233';
    v_process := 'DEMOPROCESS';
    WF_ENGINE.Threshold := -1;
    WF_ENGINE.CREATEPROCESS(v_itemtype, v_itemkey, v_process);
    wf_engine.setitemuserkey(v_itemtype, v_itemkey, v_userkey );
    wf_engine.setitemowner (v_itemtype, v_itemkey,'SYSADMIN');
    WF_ENGINE.STARTPROCESS(v_itemtype, v_itemkey);
    commit;
exception when others
    then
      dbms_output.put_line(SQLERRM);
end; 

No comments:

Post a Comment

If you are facing any issues while copying the Code/Script or any issues with Posts, Please send a mail to OracleApp88@Yahoo.com or message me at @apps88 or +91 905 957 4321 in telegram.
Best Blogger TipsGet Flower Effect