Below is the Sample Script to raise the Business Event .
DECLARE
l_event_name VARCHAR2 (240) := 'xx.apps.ar.hz.Organization.upsert';
l_event_parameter_list wf_parameter_list_t := wf_parameter_list_t ();
BEGIN
wf_event.addparametertolist (p_name => '<Parameter Name>'
, p_value => '<Parameter Value>'
, p_parameterlist => l_event_parameter_list
);
wf_event.addparametertolist (p_name => '<Parameter Name1>'
, p_value => '<Parameter Value1>'
, p_parameterlist => l_event_parameter_list
);
wf_event.addparametertolist (p_name => '<Parameter Name2>'
, p_value => '<Parameter Value2>'
, p_parameterlist => l_event_parameter_list
);
BEGIN
wf_event.RAISE (p_event_name => l_event_name, p_event_key => SYS_GUID (), p_parameters => l_event_parameter_list);
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line (' Unexpected Error : ' || SUBSTR (SQLERRM, 1, 250));
END;
l_event_parameter_list.DELETE;
EXCEPTION
WHEN OTHERS
THEN
NULL;
END;
/***************************************************************************/
OR use Below Script
/***************************************************************************/
DECLARE
l_error VARCHAR2 (2000);
l_event_parameter_list wf_parameter_list_t;
l_param wf_parameter_t;
l_event_name VARCHAR2 (100) := 'oracle.apps.ar.hz.Party.merge';
l_parameter_index NUMBER := 0;
l_error_msg VARCHAR2 (2000);
BEGIN
--1st parameter to the Event if exists
l_event_parameter_list := wf_parameter_list_t ();
l_param := wf_parameter_t (NULL, NULL);
l_event_parameter_list.EXTEND;
l_param.setname ('batch_id');
l_param.setvalue (132054);
l_parameter_index := l_parameter_index + 1;
l_event_parameter_list (l_parameter_index) := l_param;
--2nd parameter to the Event if exists
l_param := wf_parameter_t (NULL, NULL);
l_event_parameter_list.EXTEND;
l_param.setname ('PARMA_2');
l_param.setvalue ('VALUE_FOR_PARMA_2');
l_parameter_index := l_parameter_index + 1;
l_event_parameter_list (l_parameter_index) := l_param;
--3rd parameter to the Event if exists
l_param := wf_parameter_t (NULL, NULL);
l_event_parameter_list.EXTEND;
l_param.setname ('PARAM3');
l_param.setvalue ('VALUE_FOR_PARMA_3');
l_parameter_index := l_parameter_index + 1;
l_event_parameter_list (l_parameter_index) := l_param;
BEGIN
wf_event.RAISE (p_event_name => l_event_name
, p_event_key => 'oracle.apps.ar.hz.Party.merge132054'
, p_parameters => l_event_parameter_list
, p_send_date => SYSDATE
);
COMMIT;
EXCEPTION
WHEN OTHERS
THEN
l_error_msg := 'Unexpected Error : ' || SUBSTR (SQLERRM, 1, 250);
DBMS_OUTPUT.put_line (l_error_msg);
END;
EXCEPTION
WHEN OTHERS
THEN
l_error_msg := 'Unexpected Error In main : ' || SUBSTR (SQLERRM, 1, 250);
DBMS_OUTPUT.put_line (l_error_msg);
END;
/
DECLARE
l_event_name VARCHAR2 (240) := 'xx.apps.ar.hz.Organization.upsert';
l_event_parameter_list wf_parameter_list_t := wf_parameter_list_t ();
BEGIN
wf_event.addparametertolist (p_name => '<Parameter Name>'
, p_value => '<Parameter Value>'
, p_parameterlist => l_event_parameter_list
);
wf_event.addparametertolist (p_name => '<Parameter Name1>'
, p_value => '<Parameter Value1>'
, p_parameterlist => l_event_parameter_list
);
wf_event.addparametertolist (p_name => '<Parameter Name2>'
, p_value => '<Parameter Value2>'
, p_parameterlist => l_event_parameter_list
);
BEGIN
wf_event.RAISE (p_event_name => l_event_name, p_event_key => SYS_GUID (), p_parameters => l_event_parameter_list);
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line (' Unexpected Error : ' || SUBSTR (SQLERRM, 1, 250));
END;
l_event_parameter_list.DELETE;
EXCEPTION
WHEN OTHERS
THEN
NULL;
END;
/***************************************************************************/
OR use Below Script
/***************************************************************************/
DECLARE
l_error VARCHAR2 (2000);
l_event_parameter_list wf_parameter_list_t;
l_param wf_parameter_t;
l_event_name VARCHAR2 (100) := 'oracle.apps.ar.hz.Party.merge';
l_parameter_index NUMBER := 0;
l_error_msg VARCHAR2 (2000);
BEGIN
--1st parameter to the Event if exists
l_event_parameter_list := wf_parameter_list_t ();
l_param := wf_parameter_t (NULL, NULL);
l_event_parameter_list.EXTEND;
l_param.setname ('batch_id');
l_param.setvalue (132054);
l_parameter_index := l_parameter_index + 1;
l_event_parameter_list (l_parameter_index) := l_param;
--2nd parameter to the Event if exists
l_param := wf_parameter_t (NULL, NULL);
l_event_parameter_list.EXTEND;
l_param.setname ('PARMA_2');
l_param.setvalue ('VALUE_FOR_PARMA_2');
l_parameter_index := l_parameter_index + 1;
l_event_parameter_list (l_parameter_index) := l_param;
--3rd parameter to the Event if exists
l_param := wf_parameter_t (NULL, NULL);
l_event_parameter_list.EXTEND;
l_param.setname ('PARAM3');
l_param.setvalue ('VALUE_FOR_PARMA_3');
l_parameter_index := l_parameter_index + 1;
l_event_parameter_list (l_parameter_index) := l_param;
BEGIN
wf_event.RAISE (p_event_name => l_event_name
, p_event_key => 'oracle.apps.ar.hz.Party.merge132054'
, p_parameters => l_event_parameter_list
, p_send_date => SYSDATE
);
COMMIT;
EXCEPTION
WHEN OTHERS
THEN
l_error_msg := 'Unexpected Error : ' || SUBSTR (SQLERRM, 1, 250);
DBMS_OUTPUT.put_line (l_error_msg);
END;
EXCEPTION
WHEN OTHERS
THEN
l_error_msg := 'Unexpected Error In main : ' || SUBSTR (SQLERRM, 1, 250);
DBMS_OUTPUT.put_line (l_error_msg);
END;
/
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.