When a specific BPM user application needs to be cleaned up, we will need to identify all application versions and all deployed versions of that application.
There might be some other requests to list all versions or all deployed versions of user application(s) or platform application(s).
A) To list template versions of a particular user application:
You may access the "viewdata.jsp" page in your web browser:
http://<admin_host>:<port>/amxadministrator/viewdata.jsp
here <admin_host> is the SystemNode machine's hostname, and <port> is the external HTTP Connector port (by default 8120).
Then click the "Adhoc HQL Query Interface" button at the upper right corner.
Provide the following HQL query and click the 'Execute' button:
select appTemplateId
from ApplicationArtifact aa
where aa.appTemplateId LIKE '%<applicationName>%'
order by aa.appTemplateId desc
To list template versions for user applications whose names start with 'com.tibco', you may use the query clause
LIKE 'com.tibco.%'
To list template versions for all user applications, you may use
Like '%%'
B) To list all deployed versions of a particular application (may be user application or platform application), you may run the following queries:
HQL query:
select distinct dc.application.name, dc.application.applicationTemplateVersion
from DeployedComponentInstance dc
where dc.uri LIKE '%<applicationName>%'
order by dc.application.name, dc.application.applicationTemplateVersion asc
Again we can use the 'LIKE' clause to list all deployed versions of all applications.
C) To list all applications and their versions:
Use SQL client to run against AMX Admin DB (this is not an HQL query)
select distinct application.name, application.e_id, application.APPLICATIONTEMPLATEVERSION
from application
inner join componentinstance ON application.e_id=componentinstance.application_application_e_id
order by application.name, application.e_id asc;
Reference
https://support.tibco.com/s/article/Steps-to-cleanup-BPM-Application-using-nodeutil-and-bpm-db-cleanup