CA Identity Manager: How to programmatically get the workitem/job ID associated with an approval task

Document ID : KB000072689
Last Modified Date : 07/03/2018
Show Technical Document Details
Introduction:
The following will demonstrate how to retrieve the work item/job ID from the Workpoint database, that is associated with an Approval task in CA Identity Manager runtime database Task Persistence.
Instructions:

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:
Get TasksessionID

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>
Get Proci_ID

3. SELECT ACTI_ID FROM WP_WORK_ITEM WHERE PROCI_ID = <proci_id from step 2>

Get Acti_id

1. Get the tasksessionid of the approval task (this can be retrieved via BLTH or PX task session attribute)