How to see Business Event Parameters
Business Event mechanism provided by Oracle Workflow is a very good tool for customization and to add new business functionality on a particular event. (Mostly asynchronous)
But while coding a subscription function, having event name is not sufficient. Sometimes you will require more parameters to handle the event in a proper way.
For example, you want to use delete or update event of a record and in such cases sometimes it is not possible to fetch older data based on event name or primary key. Using event parameters, code, which raised the event, can pass older data, which may be useful for event subscription.
Following basic code snippet shows, how we can check all the parameters passed with the event.
procedure log_me (t varchar2) IS pragma autonomous_transaction; <br />begin <br /> insert into my_log_table values(t); <br /> commit; <br />
end;<br /><br />function update_asgn (p_subscription_guid in raw, <br /> p_event in out WF_EVENT_T) return varchar2 is<br /> <br /> l_wf_parameter_list_t wf_parameter_list_t;<br /> i number := 1;<br /> c number;<br /> l_key varchar2(30);<br /> l_val varchar2(2000);<br />begin<br /> l_wf_parameter_list_t := p_event.getParameterList();<br /> c := l_wf_parameter_list_t.count();<br /> <br /> log_me('event = ' || p_event.getEventName());<br /> log_me('count : ' || c);<br /> <br /> while (i<=c) <br /> loop<br /> <br /> l_key := l_wf_parameter_list_t(i).getName();<br /> l_val := l_wf_parameter_list_t(i).getValue();<br /> <br /> log_me(l_key || '=' || l_val);<br /> <br /> i := i + 1;<br /> end loop;<br /> <br /> return 'SUCCESS';<br /> exception<br /> when others then <br /> log_me('errm' || sqlerrm);<br />end;
Here wf_parameter_list_t is a varray. For more information on API please refer Oracle Workflow API Reference
Most important thing is, you can check same at WF_DEFERRED queue log from Oracle Application Manager -> Workflow Manger without writing any code!
Njoy,
Hardik Tank

Posted by Hardik