Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Calling Workflow from PLSQL

Hoang TongJun 12 2015 — edited Jun 17 2015

Hi Oracle People,

I am trying to invoke the workflow 'HR_AWARD_JSP_PRC' from PLSQL.If I execute the PLSQL below, I can see the workflow being created in Oracle e-Business in Status Monitor. However, it stops early in the workflow and does not reach the part of the workflow that sends out the email to the employee's manager. How is this done? I think I may have to set some attributes via wf_engine.setItemAttrText() but how do I know which attributes need to be set? etc

Appreciate your help on this,

Hoang.

---------------------------------------------------

SET SERVEROUTPUT ON
DECLARE
   l_itemtype   VARCHAR2 (15);
   l_itemkey    VARCHAR2 (15);
  
BEGIN
   -- some unique keybegin
   l_itemtype := 'HRSSA';

   -- code to have some unique key for this process instance
   l_itemkey := '1568071';

   -- which process of the workflow you want to start?
   wf_engine.CreateProcess (ItemType   => l_itemtype,
                            ItemKey    => l_itemkey,
                            Process    => 'HR_AWARD_JSP_PRC');

   -- set user key
   wf_engine.SetItemUserKey (ItemType   => l_itemtype,
                             ItemKey    => l_itemkey,
                             UserKey    => NULL);

   -- set owner
   wf_engine.SetItemOwner (itemtype   => l_itemtype,
                           itemkey    => l_itemkey,
                           owner      => 'MyUsername');                    --person who owns the workflow

 
   -- Now start the process
   wf_engine.startprocess (itemtype => l_itemtype,
                           itemkey => l_itemkey);
 
   COMMIT;
   
dbms_output.put_line('Completed!!!');

EXCEPTION
WHEN OTHERS THEN
  dbms_output.put_line('EXCEPTIONS: ' || sqlerrm);

END;

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 15 2015
Added on Jun 12 2015
5 comments
4,495 views