Showing posts with label Re-trigger. Show all posts
Showing posts with label Re-trigger. Show all posts

30 October, 2017

How to Re-trigger Oracle Business events


1.       Go to responsibility: Workflow Administrator Web Applications.
2.       Navigate to: Administrator Workflow à Business Event
3.       Search for the event name: oracle.apps.wsh.delivery.gen.shipconfirmed


1.       Click on “Test” Button.
Note: If Test button is not visible on screen then this is the access issue.
In this case, run below command.
update wf_resources set text='*' where name like 'WF_ADMIN_ROLE';            
commit;              
Re-open application.
Now you can see the Test button.
2.       In this screen, give details as below.
Event Key : <Delivery Id which needs to retrigger eg. 17190692>
Event parameters,
Label: DELIVERY_ID
Value: <Delivery Id which needs to retrigger eg. 17190692>

Now click on button: Raise in PLSQL


Thus, Event is re-triggered for the given delivery ID.
You can check the entry in event tables with below queries.
   select DEQ_TIME, DEQ_TID, a.* from WF_DEFERRED a WHERE CORRID = 'APPS:oracle.apps.wsh.delivery.gen.shipconfirmed';


If DEQ_TIME, DEQ_TID is not null then, Data is been dequeued to BPEL Queue.

If DEQ_TIME, DEQ_TID is null then, we need to raise ticket to bounce the workflow manager “Workflow agent listener”.
Retest the process after bounce.

  Now check below query.
      
select CONSUMER_NAME, MSG_STATE ,DEQ_TIME , DEQ_TIMESTAMP,
tab.* from apps.AQ$WF_BPEL_QTAB tab 
where tab.user_data.event_name = 'oracle.apps.wsh.delivery.gen.shipconfirmed' order by ENQ_TIME DESC   ;


If MSG_STATE is ‘PROCESSED’ then the Data is received at SOA end.
If MSG_STATE is other than Processed then ask SOA to restart the process.

Query to check parameters passed to event:

SELECT wd.user_data.event_name,
       wd.user_data.event_key,
       rank() over(PARTITION BY wd.user_data.event_name, wd.user_data.event_key ORDER BY n.NAME) AS serial_no,
       n.NAME parameter_name,
       n.VALUE parameter_value,
       wd.user_data.error_message,
       wd.user_data.error_stack,
       wd.msgid,
       wd.delay
  FROM apps.wf_deferred wd, TABLE(wd.user_data.parameter_list) n
 WHERE  1=1
 AND wd.user_data.event_name LIKE '%shipconfirmed%'
 ORDER BY wd.user_data.send_date DESC,
          wd.user_data.event_name,
          wd.user_data.event_key,
          n.NAME;


If you wish to re-trigger the event from database then use below block.
give the required delivery id for p_value and p_event_key parameters.

   declare
  l_parameters wf_parameter_list_t := wf_parameter_list_t();
begin

  wf_log_pkg.init(1, null, 1, 'wf%');
  wf_event.addparametertolist(p_name          => 'DELIVERY_ID',
                              p_value         => '9169530',
                              p_parameterlist => l_parameters);
  wf_event.raise(p_event_name => 'oracle.apps.wsh.delivery.gen.shipconfirmed',
                 p_event_key  => '9169530',
                 p_event_data => NULL,
                 p_parameters => l_parameters,
                 p_send_date  => sysdate);
  commit;

end;