Identity Manager 14.5
An Approval Task exists in the Task Persistence database in the tasksession12_5 table, similarly to any other Administrative Task.
A workitem/job exists in the WPDS database (installed together with the other IM DBs) in the WP_PROCI table.
The are links between the TP DB and the WPDS DB as follows:
The unique identifier of the Approval Task is tasksession12_5.tasksessionid, which will have a match in WP_PROCI.name column.
Therefore, the flow of retrieval will go as follows:
1. Determine the TasksessionID. The tasks 'Task ID'
This can be gathered programmatically, for example with a TEWS6 call, or a direct database query, or manually found in the task View, see KB 16923 Search a submitted IM task by Task ID on View Submitted Tasks for details on how to configure VST to show Task ID values.
2. Get the proci_id of the job associated to the Approval Task:
SELECT PROCI_ID FROM WP_PROCI WHERE NAME = <tasksessionid from step 1>
3. SELECT ACTI_ID FROM WP_WORK_ITEM WHERE PROCI_ID = <proci_id from step 2>