cancel
Showing results for 
Search instead for 
Did you mean: 

Find all unused Objects

foehl
Level 6

I am looking for a way to find all Objects that are not referenced by any processes. I assume the best way would be a SQL query on the BP database, but after a bit of searching around in the tables I couldn't find an obvious way to achieve this. Does anyone know which tables to query to get this result?



------------------------------
Felix Oehl
Belgium
------------------------------
1 BEST ANSWER

Helpful Answers

JanPiwowarski
Level 4

Hi Felix,

maybe try this:

SELECT
        p.name,
        p.description,
        p.createdate
FROM BPAProcess p
        left join BPAProcessIDDependency d on p.processid=d.processID
        left join BPAProcess p2 on p2.processid = d.refProcessID
where    p.ProcessType = 'O'
--retired objects are not taken into acount (AttributeID= 1)
and        p.AttributeID <> 1 
and        d.id is null
and        p.name not in (
        select refProcessName
        from BPAProcessActionDependency)
order by p.name

There will be probably better queries, but I am using them.

Best Regards
Jan



------------------------------
Jan Piwowarski
Development Lead
Commerzbank AG
Europe/London
------------------------------

View answer in original post

3 REPLIES 3

John__Carter
Staff
Staff

Hi Felix - the BPAProcessNameDependency table records relationships between processes and objects, so objects not in this table will be unreferenced.

This tool may also be of interest too you: https://digitalexchange.blueprism.com/dx/entry/3439/solution/business-object-library-snapshot-generator



------------------------------
John Carter
Blue Prism
------------------------------

JanPiwowarski
Level 4

Hi Felix,

maybe try this:

SELECT
        p.name,
        p.description,
        p.createdate
FROM BPAProcess p
        left join BPAProcessIDDependency d on p.processid=d.processID
        left join BPAProcess p2 on p2.processid = d.refProcessID
where    p.ProcessType = 'O'
--retired objects are not taken into acount (AttributeID= 1)
and        p.AttributeID <> 1 
and        d.id is null
and        p.name not in (
        select refProcessName
        from BPAProcessActionDependency)
order by p.name

There will be probably better queries, but I am using them.

Best Regards
Jan



------------------------------
Jan Piwowarski
Development Lead
Commerzbank AG
Europe/London
------------------------------

foehl
Level 6

@JanPiwowarski Thank you for your working solution, the query worked great!

@John__Carter Thanks for the tip on the snapshot creation tool. For this use case it looks a bit of a sledgehammer to crack a nut, but it looks very interesting. I can see possibilities for it on another use case already.