Thursday 5 September 2019

Cancel Workflow Process using WF_ENGINE.AbortProcess

1. Run the following query for the involved requisition. Substitute the requisition number and organization id when prompted:

select requisition_header_id
from po_requisition_headers_all
where segment1 = '&REQ_NUMBER'
and org_id = &ORG_ID;
2. Substitute the requisition_header_id returned by script 1 when prompted in script 2 below:

select item_type, Item_key
from wf_items
where item_key like '&REQ_HDR_ID'||'%'
and item_type='CREATEPO'
and root_activity = 'OVERALL_AUTOCREATE_PROCESS';

The results of this script will deliver an item_key and item_type for the CREATEPO workflow.

3. Then substitute the requisition_header_id returned by script 1 when prompted in script 2 below:

select item_type, Item_key, root_activity
from wf_items
where parent_item_key like '&REQ_HDR_ID'||'%'
and item_type='CREATEPO'
and root_activity in ('REQ_LINE_PROCESSING', 'CREATE_AND_APPROVE_DOC');

Refer Oracle doc ID:399298.1

Use following procedure to abort process 



BEGIN WF_ENGINE.AbortProcess(l_item_type, l_item_key, NULL, l_result);
bms_output.put_line(' Successfully aborted workflow'); dbms_output.put_line(' ----------------------------------------------------'); EXCEPTION WHEN OTHERS THEN dbms_output.put_line(' Exception occured while Aborting workflow for item_type: '||l_item_type|| ' item_key: '||l_item_key); dbms_output.put_line(' Error message : '||SQLERRM); dbms_output.put_line(' ----------------------------------------------------'); END;

No comments:

Post a Comment

Query to find submitted Concurrent requests

  Query to find Concurrent Requests SELECT      user_concurrent_program_name,      responsibility_name,      request_date,      argument_tex...