2 Replies Latest reply: Aug 25, 2012 11:52 AM by 934835 RSS

    call business event from oracle workflow

    934835
      Hi,

      how to call business event from oracle workflow ?
      if possible, could you give any sample code.

      Thanks.
        • 1. Re: call business event from oracle workflow
          Alejandro Sosa-Oracle
          In short terms: assign values to the attributes that compose the payload of the event. Then raise it. Here a simple example of raising the Flex Field compilation event:

          declare
          l_application_id fnd_application.application_id%TYPE := &1;
          l_descriptive_flexfield_name varchar2(200) := '&2';
          l_application_short_name fnd_application.application_short_name%TYPE;
          l_parameters wf_parameter_list_t := wf_parameter_list_t();

          begin
          SELECT application_short_name
          INTO l_application_short_name
          FROM fnd_application
          WHERE application_id = l_application_id;

          wf_event.addparametertolist(p_name => 'APPLICATION_SHORT_NAME',
          p_value => l_application_short_name,
          p_parameterlist => l_parameters);

          wf_event.addparametertolist(p_name => 'APPLICATION_ID',
          p_value => l_application_id,
          p_parameterlist => l_parameters);

          wf_event.addparametertolist(p_name => 'DESCRIPTIVE_FLEXFIELD_NAME',
          p_value => l_descriptive_flexfield_name,
          p_parameterlist => l_parameters);

          wf_event.raise(p_event_name => 'oracle.apps.fnd.flex.dff.compiled',
          p_event_key => (l_application_short_name || '.' ||l_descriptive_flexfield_name),
          p_event_data => NULL,
          p_parameters => l_parameters,
          p_send_date => Sysdate);
          end;
          /

          Regards.