We are seeing few of the action items are in the 'Pending' tab of the workspace but there is no longer any process instance for those action items. Can you let us know how to clear this orphan records of action items
Clarity All Supported Versions
Action items associated with a process instance become orphaned when the process instance is deleted before the action item is completed, resulting in orphaned records.
SELECT USER_ID, id Action_Item_ID, OBJECT_TYPE_NAME, OBJECT_ID,SUB_OBJECT_TYPE, SUB_OBJECT_ID, PROCESS_HANDLER_ID
FROM CAL_ALL_ACTION_ITEMS_V
WHERE LANGUAGE_CODE = 'en'
AND USER_ID != 8
-- AND USER_ID = 1
AND ((STATUS_CODE != 'CAL_CLOSED' AND STATUS_CODE != 'CAL_DEFERRED' AND
STATUS_CODE != 'CAL_DONE' ) OR STATUS_CODE IS NULL )
AND not exists
(SELECT rp.id process_instance_id, rp.process_version_id, rs.step_id
FROM BPM_RUN_STEP_ACTION_RESULTS sar, BPM_RUN_STEPS rs, BPM_RUN_PROCESSES rp
WHERE sar.id = PROCESS_HANDLER_ID
AND sar.step_instance_id = rs.id
AND rp.id = rs.process_instance_id)
AND PROCESS_HANDLER_ID is not null;