---
title: Rule Conditions
description: "A rule's conditions determine to which portions of your document a rule applies, allowing you to set the right annotations at the right spots. ## Overview The condition is the most complex part of a rule. The trick to a…"
url: "https://www.stilo.com/docs/migrate/getting-started-rules/rule-conditions/"
updated: "2021-04-17"
category: Rules / Getting Started
tags:
  - Rules
---

# Rule Conditions

A rule's conditions determine to which portions of your document a rule applies, allowing you to set the right annotations at the right spots.

## Overview

The condition is the most complex part of a rule. The trick to a successful conversion with Migrate is to apply the correct annotations at the right places. Conditions allow you to identify these *right places*. In the end, a condition will evaluate to either *true* or *false*. The rule's annotations will be applied if, and only if, the condition evaluates to *true*.

To provide agility and precision, Migrate supports several types of tests which can be used in conditions:

- style test
- property test
- logical group test
- content test
- context test
- contains element test

Migrate also provides mechanisms that allow you to consolidate what might have been several rules into one so that you don't have to repeat yourself. This also keeps rule sets simpler and easier to understand.

- case construct
- for each construct

## Case Construct

## For Each Construct

#### Supporting Reference Material

- [Style Test](https://www.stilo.com/docs/migrate/types-of-tests-used-in-rules/style-test/)
- [Property Test](https://www.stilo.com/docs/migrate/types-of-tests-used-in-rules/property-test/)
- [Logical Group Test](https://www.stilo.com/docs/migrate/types-of-tests-used-in-rules/logical-group-test/)
- [Content Test](https://www.stilo.com/docs/migrate/types-of-tests-used-in-rules/content-test/)
- [Context Test](https://www.stilo.com/docs/migrate/types-of-tests-used-in-rules/context-test/)
- [Contains Element Test](https://www.stilo.com/docs/migrate/types-of-tests-used-in-rules/contains-element-test/)
- [Patterns](https://www.stilo.com/docs/migrate/types-of-tests-used-in-rules/patterns/)
