Cleaning Up Unused Entities
We’re doing some cleanup in our Decisions environment. We want to:
- Find entities not linked to any project
- Identify entities that have no dependencies
- Check backup history of folder resources associated with a project
Comments
-
To check for unused or orphaned resources directly from the DB, try these:
- Entities not associated with any project:
SELECT ehd.id, ehd.entity_name, ehd.created_by, ehd.deleted, ehd.entity_type_name FROM entity_header_data ehd LEFT JOIN module_resource mr ON mr.id = ehd.id WHERE mr.id IS NULL AND ehd.created_by <> 'SYSTEM' AND ehd.deleted = 0;
- Entities with no dependencies:
SELECT ehd.id, ehd.entity_name, ehd.entity_type_short_name FROM entity_header_data ehd WHERE ehd.deleted = 0 AND ehd.created_by <> 'SYSTEM' AND ehd.id NOT IN ( SELECT from_entity_id FROM module_resource_dependency UNION SELECT to_entity_id FROM module_resource_dependency );
To check the backup history folders, you can use the Fetch Entities step with the data source set to
EntityHeaderData
.Here’s how to configure it:
- Set the Fetch Criteria to
entityName StartsWith
and pass "History" (or whatever prefix your backup folders use). - Set the Parent Folder Id to the base project folder ID.
- Leave the rest as defaults unless you want to limit or sort the results.
This will give you all
History
folders directly under that project.Example setup:
Howdy, Stranger!
Categories
- 4.5K All Categories
- 86 General
- 13 Training
- 212 Installation / Setup
- 1.2K Flows
- 112 Rules
- 277 Administration
- 215 Portal
- 502 General Q & A
- 721 Forms
- 355 Reports
- 3 Designer Extensions
- 47 Example Flows
- 58 CSS Examples
- 1 Diagram Tile
- 8 Javascript Controls
- 189 Pages
- 5 Process Mining
- New Features
- 187 Datastructures
- 72 Repository
- 237 Integrations
- 30 Multi-Tenant
- 27 SDK
- 81 Modules
- 60 Settings
- 26 Active Directory
- 12 Version 7
- 36 Version 8
- 143 Lunch And Learn Questions