Optimize BR Logic for CMDB Relationship Validation and Creation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
Hi Team,
I have a requirement where I need to check if the following CMDB relationships exist:
- Oracle Instance – Uses::Used by – Database
- Oracle Instance – Runs on::Runs – (Linux) Server
- (Linux) Server – Virtualized by::Virtualizes – Virtual Machine Instance
- Mapped Application Service – Depends on::Used by – Virtual Machine Instance
If all of the above relationships exist, then I need to create a new relationship between Mapped Application Service and Database.
Currently:
- We already have an existing Business Rule for one relationship.
- For the other three, I created system properties to store the sys_id of the cmdb_rel_type.
Challenge:
If I go with class-hopping and iterate part by part in the same BR, the code becomes unnecessarily lengthy.
Alternative Approach:
I was thinking of using an encoded query like:
Type contains (Used::Used by) and parent.class = linux and then another query.
However, I’m concerned about the accuracy of this approach.
Additional Requirement:
We also need to validate that the CIs involved are operational (check status and substatus).
Attaching a sample of the existing code for reference.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
