- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-15-2014 06:09 PM
Hi All,
I have added a new field to cmdb_ci with a label of "Common Name". This is because we use Discovery, which populates the Name field in a way that does not always comply with our naming standards. Most of the time it is ok though, so I have a calculated field value on the Common Name field, along the lines of "current.u_common=current.name;". This means I can override it on any table class with a different new naming standard. This seems more efficient that using business rules to do the same thing because of the neatness of overrrides.
The issue I found was, what if the Name field has an override on it to perform it's own calculation (i.e. now there is a calculation based on another calculation). How do I ensure that it's calculation runs before that of the Common field? Unlike business rules, there is no obvious Order number to calculations. If there is no predicable order between calculated fields, then can I at least be assured that calculated fields all run before any business rule does (or visa versa). If that is at least known, then I may have other options.
Is there any advice our there in terms of best practice or healing battle scars from this sort of issue?
Thanks
Howard
Solved! Go to Solution.
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-15-2014 06:52 PM
Well, to quote a friend, Capa JC, Calculated Fields are evil!!!
Calculated fields are calculated every time a row is read, whereas the BR will only run when needed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-15-2014 06:37 PM
I just found part of the answer in relation to calculations versus business rules:
"Note: In relation to business rules, calculated fields are populated first before any business rule, even a before business rule, is run. Calculated fields are then populated again if necessary after any before business rules run."
I don't understand that the second sentence though, and it still does not explain the order of calculations relative to each other.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-15-2014 06:52 PM
Well, to quote a friend, Capa JC, Calculated Fields are evil!!!
Calculated fields are calculated every time a row is read, whereas the BR will only run when needed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-15-2014 06:59 PM
Jim,
Good advice. I just came to the same conclusion I realised I was about to go down a rabbit hole with that one.
My solution is to have one business rule running on the cmdb_ci table called "Apply CI naming standards", so I can have them all documented in one place.
Thanks for the sanity check.
Howard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-15-2014 07:05 PM
You are welcome.