DECLARE
CURSOR wf_error IS
SELECT item_key
FROM wf_items
WHERE item_type = 'WFERROR'
AND end_date is null;
BEGIN
FOR i IN wf_error LOOP
WF_ENGINE.abortProcess('WFERROR', i.item_key);
END LOOP;
COMMIT;
END;