Monday, October 23, 2017

Query to get errorneous Workflow Notifications

SELECT DISTINCT
       itm.item_type item_type,
       itm.item_key item_key,
       PRA.PROCESS_NAME || ':' || PRA.INSTANCE_LABEL
          ERROR_PROCESS_ACTIVITY_LABEL,
       WF_ENGINE.GetItemAttrText ('WFERROR', itm.item_key, 'ERROR_ITEM_TYPE')
          errant_item_type,
       WF_ENGINE.GetItemAttrText ('WFERROR', itm.item_key, 'ERROR_ITEM_KEY')
          errant_item_key
  FROM wf_items itm,
       wf_item_activity_statuses sta,
       wf_item_activity_statuses errsta,
       wf_process_activities pra
 WHERE     itm.item_type = 'WFERROR'
       AND itm.end_date IS NULL
       AND TO_NUMBER (
              WF_ENGINE.GetItemAttrText ('WFERROR',
                                         itm.item_key,
                                         'ERROR_ACTIVITY_ID')) =
              sta.process_activity
       AND WF_ENGINE.GetItemAttrText ('WFERROR',
                                      itm.item_key,
                                      'ERROR_ITEM_TYPE') = sta.item_type(+)
       AND WF_ENGINE.GetItemAttrText ('WFERROR',
                                      itm.item_key,
                                      'ERROR_ITEM_KEY') = sta.item_key(+)
       AND sta.activity_status(+) <> 'ERROR'
       AND errsta.item_type = itm.item_type
       AND errsta.item_key = itm.item_key
       AND errsta.end_date IS NULL
       AND errsta.notification_id IS NOT NULL
       AND errsta.process_activity = pra.instance_id;

No comments:

Post a Comment

SupplierAddressImportTemplate.xlsm South Africa Suburb Field mapping in POZ_SUPPLIER_ADDRESSES_INT

Suburb mpping in Supplier Address Import Template will be mapped to Address Element Attribute2 (HZ_LOCATIONS. ADDR_ELEMENT_ATTRIBUTE2)