cmdb_ci and task_ci
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2015 10:36 AM
I have a business rule on task_ci (Affected Cis) which upon deleting the CI from affected cis will throw a message saying you cannot delete if it a primary Ci as well.
But when I try to delete a CI from cmdb_ci, if that ci is a part of an INC, the above business rule is triggered. Why?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2015 10:53 AM
task_ci is a relationship between the CI and the Task. when you delete a CI it deletes the relationship record for the task and the CI. this will trigger your business rule on task_ci.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2015 11:48 AM
Got it Tyler. Thanks for the explanation. but "Prevent removal/update of primary CI" which is a OOB business rule, is triggered, but it does not prevent the CI to be deleted from cmdb_ci. That's the problem. It deletes the CI and then the BR is triggered.
How can we prevent that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2015 12:00 PM
That OOB script is checking to see if the cmdb_ci field on the task is populated with the CI that is on the task_ci record. if it is, then it should stop the delete. make sure this is the case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2015 12:38 PM
Yes I saw that condition, but when I delete the CI from the cmdb_ci table, that condition will fail,
current.ci_item == current.task.cmdb_ci, but even then it triggers this BR and show the error message but donnot abort the action ?