Thanks for the doco Lynn.
From this I have been able to create a MS SQLServer query for a particular AB using the PI Views.
The result is the same as what comes back from GuardIEn OL+ ... which means we can scrape another database to pass data to this query.
USE <your Gen Ency>;
WITH ParentList
AS (
SELECT ACTN_BLK_ID
,USED_ACTN_BLK_ID
FROM [dbo].[ACTN_BLK_USE](NOLOCK)
WHERE ACTN_BLK_ID IN (
SELECT ID
FROM [dbo].[ACTION_BLOCK](NOLOCK)
WHERE NAME LIKE '%foo%' -- put your AB to find parents here
AND MODEL_ID = <your model id>
)
UNION ALL
SELECT a.[ACTN_BLK_ID]
,a.[USED_ACTN_BLK_ID]
FROM [dbo].[ACTN_BLK_USE] a (NOLOCK)
INNER JOIN ParentList s ON a.USED_ACTN_BLK_ID = s.ACTN_BLK_ID
)
SELECT DISTINCT PStep.NAME
FROM ParentList
,[dbo].[BUS_PROC_STEP] PStep (NOLOCK)
WHERE ACTN_BLK_ID = PStep.ACTION_BLOCK_ID
AND PStep.MODEL_ID = <your model id>
ORDER BY PStep.NAME ASC