How policies are evaluated
Understand how policy logic selects resource inputs, evaluates conditions, and handles related records and missing data.
Resources and Record Types
Logic declares the CMDB object type through inputType, such as CA10__CaAwsInstance__c. Optional recordTypes restricts evaluation to specified record types. These inputs describe the records the logic evaluates.
Ordered Conditions and Fallback
The engine checks conditions in order. The first matching condition determines the resource's status and explanatory message. If none matches, the required otherwise fallback supplies the outcome. Ordering therefore matters: an earlier match prevents later conditions from deciding the result.
Related-Resource Evaluation
relatedLists evaluates connected objects through relationshipName, including relationship chains. Related logic uses conditions, a fallback, and optional nested lists. Parent logic can use aggregates such as RELATED_LIST_HAS or RELATED_LIST_COUNT. Related objects are tested with their parent rather than separate test fixtures.
Missing-Data Behavior
Required fields can be unavailable because of collection permissions, API limits, or incomplete inventory. Logic should explicitly handle insufficient evidence with UNDETERMINED; an absent value alone does not establish compliance or a violation.
From Logic to Runtime Results
Evaluation produces a status for each resource:
| Status | Meaning |
|---|---|
COMPLIANT | The resource satisfies the requirement. |
INCOMPLIANT | The resource violates the requirement. |
INAPPLICABLE | The requirement does not apply to this resource. |
UNDETERMINED | Available evidence does not establish an outcome. |
DISAPPEARED | The resource was deleted at its source but remains in CMDB. |
Use Policy statuses for status details and Compliance results for execution context and resource evidence. A resource's compliance status and an execution's completion state answer different questions.
For authoring instructions, continue to Write policy logic. Operation syntax belongs in the Policy logic reference.