Skip to main content

Policy Language & Expressions

Compliance Engine policies are implemented using a Java-like Salesforce version of policy language that lets you express conditions over CMDB objects.

This page provides a high‑level view; consult Cloudaware’s developer documentation for full syntax and examples.

Concepts

Policy code typically includes:

  • A declaration of input and output object types.
  • A query that selects in‑scope objects.
  • A process block that evaluates each object and sets the result.
  • A lifecycle configuration that controls when findings are created, updated, or closed.

Within the process block, you can:

  • Inspect fields on the input object (for example, configuration flags, tags).
  • Traverse relationships to related objects (for example, owners, applications).
  • Call helper methods in utility classes.

Expressions and Operators

Expressions support:

  • Comparisons (for example, equality, inequality, greater than/less than).
  • Logical operators (AND, OR, NOT) to combine conditions.
  • String and collection operations where supported by the platform.

Policies can be as simple as “field must equal X” or as complex as multi‑step checks that aggregate related objects.

Lifecycle Methods

A policy’s lifecycle configuration determines how output objects behave over time. At a high level you can:

  • Decide when findings are created (for example, only when incompliant, or in all cases).
  • Control when findings are closed (for example, when compliant, when inapplicable, or when out of scope).
  • Configure retention for long‑closed findings.

Lifecycle behavior is key to accurate MTTR and historical reporting. See State Model for context.