Raise a business event using PL/SQL:
DECLARE
l_event_name VARCHAR2 (240) := 'xx.oracle.apps.send.cancelpo';
l_event_parameter_list wf_parameter_list_t := wf_parameter_list_t ();
L_ORG_ID number := 101;
L_PO_HEADER_ID Number := 100;
l_event_data clob;
--
BEGIN
wf_event.addparametertolist (p_name => 'ORG_ID'
, p_value => L_ORG_ID
, p_parameterlist => l_event_parameter_list
);
wf_event.addparametertolist (p_name => 'PO_HEADER_ID'
, p_value => L_PO_HEADER_ID
, p_parameterlist => l_event_parameter_list
);
wf_event.addparametertolist (p_name => 'USER_ID'
, p_value => fnd_global.user_id
, p_parameterlist => l_event_parameter_list
);
wf_event.addparametertolist (p_name => 'RESP_ID'
, p_value => fnd_global.resp_id
, p_parameterlist => l_event_parameter_list
);
wf_event.addparametertolist (p_name => 'RESP_APPL_ID'
, p_value => fnd_global.resp_appl_id
, p_parameterlist => l_event_parameter_list
);
--
l_event_data := '<EVENT_XML_DATA>
<SUPPLIER>ABC LTD</SUPPLIER>
<PO_NUMBER>1234</PO_NUMBER>
</EVENT_XML_DATA>';
wf_event.raise(p_event_name => l_event_name,
p_event_key => L_PO_HEADER_ID , //SYS_GUID ()
p_event_data => l_event_data,
p_parameters => l_event_parameter_list,
p_send_date => Sysdate);
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END;
/
DECLARE
l_event_name VARCHAR2 (240) := 'xx.oracle.apps.send.cancelpo';
l_event_parameter_list wf_parameter_list_t := wf_parameter_list_t ();
L_ORG_ID number := 101;
L_PO_HEADER_ID Number := 100;
l_event_data clob;
--
BEGIN
wf_event.addparametertolist (p_name => 'ORG_ID'
, p_value => L_ORG_ID
, p_parameterlist => l_event_parameter_list
);
wf_event.addparametertolist (p_name => 'PO_HEADER_ID'
, p_value => L_PO_HEADER_ID
, p_parameterlist => l_event_parameter_list
);
wf_event.addparametertolist (p_name => 'USER_ID'
, p_value => fnd_global.user_id
, p_parameterlist => l_event_parameter_list
);
wf_event.addparametertolist (p_name => 'RESP_ID'
, p_value => fnd_global.resp_id
, p_parameterlist => l_event_parameter_list
);
wf_event.addparametertolist (p_name => 'RESP_APPL_ID'
, p_value => fnd_global.resp_appl_id
, p_parameterlist => l_event_parameter_list
);
--
l_event_data := '<EVENT_XML_DATA>
<SUPPLIER>ABC LTD</SUPPLIER>
<PO_NUMBER>1234</PO_NUMBER>
</EVENT_XML_DATA>';
wf_event.raise(p_event_name => l_event_name,
p_event_key => L_PO_HEADER_ID , //SYS_GUID ()
p_event_data => l_event_data,
p_parameters => l_event_parameter_list,
p_send_date => Sysdate);
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END;
/
No comments:
Post a Comment