Search from 700 + Posts

Feb 22, 2011

Script to Check if Workflow for Order line in Oracle Order Management is CLOSED or NOT

This is a simple script to check if Workflow for Sales order line in Oracle Order Management is CLOSED or NOT .

DECLARE
l_count     NUMBER;
l_line_id   NUMBER :=&Enter_line_id;
BEGIN
SELECT count(*)
  INTO l_count
  FROM wf_item_activity_statuses s,
       wf_process_activities p
 WHERE  s.process_activity = p.instance_id
   AND  s.item_type = 'OEOL'
   AND  s.item_key = to_char(l_line_id)
   AND  p.activity_name = 'CLOSE_LINE'
   AND  activity_result_code in ('NOT_ELIGIBLE','COMPLETE')
   AND  s.activity_status = 'COMPLETE';
  IF l_count >= 1 THEN

    dbms_output.put_line('Line workflow is closed');
  ELSE
    dbms_output.put_line('Line workflow is Still open');
  END IF;
EXCEPTION
  WHEN OTHERS THEN
  dbms_output.put_line('Error - '||sqlerrm);
END;

No comments:

Post a Comment