---
url: /process-functions/validationreport.md
description: The result of validating a HierarchyBlueprint.
---

# &#x20;ValidationReport&#x20;

The result of validating a [HierarchyBlueprint](/process-functions/hierarchy-hierarchyblueprint).

```js
const report = blueprint.validate("Account", "Default");

if (!report.ok()) {
    script.fail("The blueprint has " + report.messages().length + " problems.");
}
```

## Constructor

Returned by [HierarchyBlueprint.validate()](/process-functions/hierarchy-hierarchyblueprint#validate). It can't be created directly.

## Overview

* **Errors vs warnings:** [ok()](#ok) only looks at errors. A report can be `ok()` and still have warnings or information worth reading in [messages()](#messages).
* **Strict publishing:** a blueprint in `"STRICT"` mode won't publish while `ok()` is `false`.

## Methods

### ok `ok()`  {#ok}

Returns `true` when there are no error-level messages.

### messages `messages()`  {#messages}

Returns every message the validation produced. Each message has:

* `severity`: `"ERROR"`, `"WARNING"` or `"INFO"`.
* `code`: a short code, such as `"CYCLE"`, `"SELF_PARENT"` or `"DUPLICATE_LINK"`.
* `message`: a readable description.

### elementCount `elementCount()`  {#elementcount}

Returns the number of distinct elements in the blueprint.

### linkCount `linkCount()`  {#linkcount}

Returns the number of parent-child links in the blueprint.

### rootCount `rootCount()`  {#rootcount}

Returns the number of top-level elements, those with no parent. A blueprint with no roots usually means there's a cycle.
