Step
by step process of creating custom business event
To create the custom business event we need to use the SYSADMIN user credentials. Then only we can able to create the New Business Event.
To create the custom business event we need to use the SYSADMIN user credentials. Then only we can able to create the New Business Event.
- Creating a table
CREATE TABLE xx_temp (msg VARCHAR2
(4000));
/
- Creating package specification
CREATE OR REPLACE PACKAGE xxu_bes
AS
FUNCTION inv_po_matching (
p_subscription_guid IN RAW,
p_event
IN OUT wf_event_t
)
RETURN VARCHAR2;
END xxu_bes;
/
show err;
- Creating package body
CREATE OR REPLACE PACKAGE BODY
xxu_bes
AS
FUNCTION inv_po_matching (
p_subscription_guid IN RAW,
p_event
IN OUT wf_event_t
)
RETURN VARCHAR2
IS
l_plist wf_parameter_list_t :=
p_event.getparameterlist ();
BEGIN
IF p_event.geteventname () = 'xxu.oracle.apps.ap.inv.match'
THEN
INSERT INTO xx_temp (msg)
VALUES (
'Timestamp: '
|| fnd_date.date_to_canonical (SYSDATE)
|| ' | Event: '
|| p_event.geteventname ()
|| ' | Event Key: '
|| p_event.geteventkey ()
|| ' | SEND_DATE: '
|| wf_event.getvalueforparameter (
'SEND_DATE',
l_plist
)
|| ' | PO_NUMBER: '
|| wf_event.getvalueforparameter (
'PO_NUMBER',
l_plist
||
' | event_data: '
|| p_event.geteventdata ()
);
END IF;
RETURN 'SUCCESS';
EXCEPTION
WHEN OTHERS
THEN
wf_core.context (
'xxu_bes',
'inv_po_matching',
p_event.geteventname (),
p_subscription_guid
);
wf_event.seterrorinfo (p_event, 'ERROR');
RETURN 'ERROR';
END inv_po_matching;
END xxu_bes;
/
show err;
4. And need to have the Workflow
Administrator Web (New) responsibility.
Navigation : Workflow Administrator
Web (New) > Administrator Workflow > Business Events