Topic
  • 3 replies
  • Latest Post - ‏2014-02-12T22:49:32Z by BráulioSilva
SureshU
SureshU
80 Posts

Pinned topic "Where Used" API IBM BPM 8

‏2013-08-06T22:00:06Z |

Hi All,

 

We are migrating our process from 6.1 to IBM BPM 8.0.1.

Since we are optimizing our business process, so many of the artifcats are now orphaned specially business objects and services. Is there any API(REST/JS) same as "Where Used" funcionality , which can be used to get the list fo these orphaned artifacts.

 

Thanks,

Suresh

 

 

Updated on 2013-08-08T19:27:25Z at 2013-08-08T19:27:25Z by SureshU
  • AndrewPaier
    AndrewPaier
    832 Posts

    Re: "Where Used" API IBM BPM 8

    ‏2013-08-07T16:04:10Z  

    Unfortunately "Where Used" is not exposed in an API.  Internally we have built our own tools capable of performing this sort of analysis base on the TWX export file.

    Andrew Paier  |  Director  |  BP3 Global, Inc.
    BP3 Global's Website  |  Twitter  |  Linkedin  |  Google+  |  Blogs

  • syampol
    syampol
    5 Posts

    Re: "Where Used" API IBM BPM 8

    ‏2013-08-08T15:17:42Z  

    Unfortunately "Where Used" is not exposed in an API.  Internally we have built our own tools capable of performing this sort of analysis base on the TWX export file.

    Andrew Paier  |  Director  |  BP3 Global, Inc.
    BP3 Global's Website  |  Twitter  |  Linkedin  |  Google+  |  Blogs

    I've wrote a query to get the data similar to what 'Where Used' return. So you can try to use it and see if it would be useful. The query was written for the 801 env, and it worked across all the PA\Toolkits and shows all the snapshots.

    select distinct p.name projectName, p.is_toolkit isToolkit, b.name branchName, snp.name snapshotName, snp.acronym snapshotAcronym,  
    po.po_name whereUsed, dep.source_location whereUsedLocation, po.po_type itemType, snp.last_modified lastModified
    from lsw_po_dependency dep -- select all WhereUsed dependencies
    inner join lsw_po_reference refer on dep.target_ref = refer.reference_id
                                        and refer.target_id in (select pv.po_id from lsw_po_versions pv where pv.po_name = 'YOUR_ITEM_NAME')
                                        and refer.end_seq_num is null --  leave only items matched to the specified WhatUsed
    inner join (
            select snp.branch_id branch_id, snp.name name, snp.acronym acronym, snp.seq_num, snp.project_id project_id, snp.last_modified last_modified
            from lsw_snapshot snp join (
                SELECT tSnp.branch_id, max(tSnp.seq_num) snum
                from lsw_snapshot tSnp group by tSnp.branch_id
                UNION
                SELECT tSnp.branch_id, tSnp.seq_num snum
                from lsw_snapshot tSnp where tSnp.NAME is not null ) snpSelected on snp.branch_id = snpSelected.branch_id
                                                                                and snp.seq_num = snpSelected.snum ) --  selection for all named snapshots plus TIP per each branch
                snp on dep.branch_id = snp.branch_id -- add snapshot info
    inner join lsw_po_versions po on po.po_id = dep.source_id -- add artifacts info
    inner join lsw_project p on (snp.project_id = p.project_id) -- add project info
    inner join lsw_branch b on (b.branch_id = po.branch_id)  -- add branch info
    where
    (dep.start_seq_num <= snp.seq_num and (dep.end_seq_num > snp.seq_num or dep.end_seq_num is null))
    order by projectName, snapshotName, lastModified desc;

    in case you don't need the information per each snapshot you need to modify the highlighted part to something like

    SELECT tSnp.branch_id, max(tSnp.seq_num) snum
                from lsw_snapshot tSnp where tSnp.NAME is not null
                group by tSnp.branch_id

    this will get the data for the latest named snapshot per each PA\Toolkit

    or to the

    SELECT tSnp.branch_id, max(tSnp.seq_num) snum
                from lsw_snapshot tSnp
                group by tSnp.branch_id

    this will get data for the latest snapshot per each PA\Toolkit. Empty snapshotname means that this is TIP.

     

    Can't guarantee that this is 100% correct. It works correct based on my testing, but I certainly didn't cover all possible cases.

    Also note that this was done for the 801 env, so this may not work for the other versions.

    Hope this helps.

    Sergii

  • BráulioSilva
    BráulioSilva
    21 Posts

    Re: "Where Used" API IBM BPM 8

    ‏2014-02-12T22:49:32Z  
    • syampol
    • ‏2013-08-08T15:17:42Z

    I've wrote a query to get the data similar to what 'Where Used' return. So you can try to use it and see if it would be useful. The query was written for the 801 env, and it worked across all the PA\Toolkits and shows all the snapshots.

    select distinct p.name projectName, p.is_toolkit isToolkit, b.name branchName, snp.name snapshotName, snp.acronym snapshotAcronym,  
    po.po_name whereUsed, dep.source_location whereUsedLocation, po.po_type itemType, snp.last_modified lastModified
    from lsw_po_dependency dep -- select all WhereUsed dependencies
    inner join lsw_po_reference refer on dep.target_ref = refer.reference_id
                                        and refer.target_id in (select pv.po_id from lsw_po_versions pv where pv.po_name = 'YOUR_ITEM_NAME')
                                        and refer.end_seq_num is null --  leave only items matched to the specified WhatUsed
    inner join (
            select snp.branch_id branch_id, snp.name name, snp.acronym acronym, snp.seq_num, snp.project_id project_id, snp.last_modified last_modified
            from lsw_snapshot snp join (
                SELECT tSnp.branch_id, max(tSnp.seq_num) snum
                from lsw_snapshot tSnp group by tSnp.branch_id
                UNION
                SELECT tSnp.branch_id, tSnp.seq_num snum
                from lsw_snapshot tSnp where tSnp.NAME is not null ) snpSelected on snp.branch_id = snpSelected.branch_id
                                                                                and snp.seq_num = snpSelected.snum ) --  selection for all named snapshots plus TIP per each branch
                snp on dep.branch_id = snp.branch_id -- add snapshot info
    inner join lsw_po_versions po on po.po_id = dep.source_id -- add artifacts info
    inner join lsw_project p on (snp.project_id = p.project_id) -- add project info
    inner join lsw_branch b on (b.branch_id = po.branch_id)  -- add branch info
    where
    (dep.start_seq_num <= snp.seq_num and (dep.end_seq_num > snp.seq_num or dep.end_seq_num is null))
    order by projectName, snapshotName, lastModified desc;

    in case you don't need the information per each snapshot you need to modify the highlighted part to something like

    SELECT tSnp.branch_id, max(tSnp.seq_num) snum
                from lsw_snapshot tSnp where tSnp.NAME is not null
                group by tSnp.branch_id

    this will get the data for the latest named snapshot per each PA\Toolkit

    or to the

    SELECT tSnp.branch_id, max(tSnp.seq_num) snum
                from lsw_snapshot tSnp
                group by tSnp.branch_id

    this will get data for the latest snapshot per each PA\Toolkit. Empty snapshotname means that this is TIP.

     

    Can't guarantee that this is 100% correct. It works correct based on my testing, but I certainly didn't cover all possible cases.

    Also note that this was done for the 801 env, so this may not work for the other versions.

    Hope this helps.

    Sergii

    Sergii,

     

    Thank you very much! ;)