Sunday, November 15, 2009

Re-try workflow

If you ship newer version of a PLSQL code which gets invoked from Workflow, and you forget to bounce Workflow Services, then all workflows using this PLSQL code would result in Invalid Package Error.

You can use following sample script to retry such error items.

BEGIN
   fnd_global.apps_initialize (0,0,0); -- Set correct values here
   FOR get_item_rec IN ( SELECT item_type
                               ,item_key
                           FROM apps.wf_item_activity_statuses wia
                          WHERE item_type          = 'REQAPPRV'
                            AND activity_status    = 'ERROR'
                            AND error_message like '%PACK%INVALID%'
                            AND activity_result_code <> '#EXCEPTION'
                            AND begin_date > SYSDATE-15
                            AND end_date IS NULL
                       )
   LOOP
      wf_engine.handleerror (get_item_rec.item_type
                            ,get_item_rec.item_key
                            ,'PO_REQ_APPROVE_SIMPLE'
                            ,'RETRY');
   END LOOP;
   COMMIT;
END;
/

.

With 11510, Application Manager UI facilitates retrying multiple workflow error items in one shot.

Cheers.

No comments: