> For the complete documentation index, see [llms.txt](https://docs.pentaho.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pentaho.com/pdc-admin/pdc-manage-rules-cp-ag/pdc-manage-metadata-rules-cp/pdc-rule-definitions.md).

# Metadata Rule definitions

Rule definitions specify the criteria and actions performed by a rule.

On the left navigation menu, click **Data Operations**. On the **Metadata Rules** card, click **Definitions** to open the **Rule Definitions** table on the Manage Metadata Rules page.

<figure><img src="/files/r5e8oA3vkTog9PNmYLvd" alt=""><figcaption></figcaption></figure>

The information in the **Rule Definitions** table is described below.

<table><thead><tr><th width="140.66656494140625" align="center">Column</th><th>Description</th></tr></thead><tbody><tr><td align="center"><strong>Definition Name</strong></td><td>The name of the rule definition.</td></tr><tr><td align="center"><strong>Type</strong></td><td>The type of rule definition.</td></tr><tr><td align="center"><strong>Owner</strong></td><td>The creator of the rule definition.</td></tr><tr><td align="center"><strong>Date Created</strong></td><td>Created date of the rule defintion.</td></tr><tr><td align="center"><strong>Used by Rules</strong></td><td>Shows the count of number of Rules using the definition.</td></tr><tr><td align="center"><strong>Status</strong></td><td><p>Controls the state of the rule definition:</p><ul><li>Click <strong>Enable</strong> to enable the rule definition for use.</li><li>Click <strong>Disable</strong> to disable the rule definition.</li></ul></td></tr><tr><td align="center"><strong>Actions</strong></td><td>Click to view the rule definition.</td></tr><tr><td align="center"><p><img src="/files/hGwQBDRObmQCjozyhXJ2" alt="" width="9"></p></td><td><p>The <strong>More options</strong> icon:</p><ul><li>Click and choose <strong>Edit</strong> to edit the rule definition.</li><li>Click and choose <strong>Delete</strong> to delete the rule definition.</li></ul></td></tr><tr><td align="center"><p><img src="/files/qRCMWcQUNLhifsEjzIlN" alt="" width="18"></p></td><td>The <strong>Delete</strong> icon. Click to delete a rule definition.</td></tr></tbody></table>

Click **Import Rule Definition** or **Export Rule Definition**, respectively, to import or export a rule definition. See the following topics when importing or exporting rule definitions:

* [Import rule definitions](#import-rule-definitions)
* [Export rule definitions](#export-rule-definitions)

Click **Add Rule Definition** to add a new rule definition. See the following topics when working with rule definitions:

* [Create a rule definition](#create-a-rule-definition)
* [Edit a rule definition](#edit-a-rule-definition)
* [Delete a rule definition](#delete-a-rule-definition)

## Create a rule definition

You create rule definitions to specify the criteria used and actions performed by a rule.

Perform the following steps to create a metadata rule definition:

1. In the left navigation menu, click **Data Operations**.

   The Manage Data Operations page opens.
2. On the **Metadata Rules** card, click **Add New**, and then select **Add Rule Definition** from the menu.

   The Rule Definition page opens.
3. In the **Name** field, enter a name for the rule definition.
4. (Optional) In the **Description** field, enter a description for the rule definition and click **Create Rule Definition and Configure**.
5. Navigate to **Configuration Tab** to configure the Rule definition.
6. Under **Rule Criteria**, select one of the classification from Classifications drop down and select the **Object** type from Object drop down.

   For example, Choosing Classification as **Entities** and object as **File** applies the rule definition at the file level. Choosing Classification as **Glossary** and object as **Term** applies the rule definition at the Term level.
7. Click **Create a condition** to define the rule’s conditions.
   * Choose **OR** to identify when any condition is satisfied.
   * Choose **AND** to identify when all conditions are satisfied.
   * For **Attribute**, select the metadata attribute that you want to use to target the action.

     When you are querying on metadata attributes like business terms or custom properties, you would be able to see only those that have been already created in Data Catalog.
   * For **Operator**, select the operator that you want to use.

     Available operators depend on the selected **Attribute**.&#x20;
   * For the text type attributes, you can choose **Equals Ignore Case** operator to avoid the actions not applying only due to case mismatches.
   * For **Value**, select the value you want to use.

     Available values vary based on the chosen **Operator**.
   * (Optional) Click **Add Group** to nest a query when performing multiple **AND** operations on the same attribute, or to create other complex queries.
8. For **Add Action**, select an action. Depending on the action you select, you might see additional fields.

   For example, if you select **Start Process**, you must select the process to start.

   **Important:** The **Move**, **Delete**, and **Rehydrate** options for **Start Process** are available only if you have a license for Data Optimizer and permission to use it. In addition, all involved data sources must have the **Available for Migration** setting **Enabled**. The **Rehydrate** operation is only supported for HDFS data sources when using metadata rules.

   **Note:** The order of the actions does not matter. For example, on the Rule Definition page, an action to apply a tag can be located below an action that moves the data. However, if there is a delete action, other actions on the same data are skipped and an error message displays.
9. When you are finished defining the action, click **Save Definition**.

   The rule definition is saved, and a status message appears in the upper corner of the page.

## Edit a rule definition

You can edit an existing rule definition if necessary.

Perform the following steps to edit a rule definition:

1. In the left navigation menu, click **Data Operations**.

   The Manage Data Operations page opens.
2. On the **Metadata Rules** card, click **Definitions**.

   The Rule Definitions tab opens.
3. Locate the name of the rule definition that you want to edit, then in its row click **More options** (![](/files/hGwQBDRObmQCjozyhXJ2)) and select **Edit**.

   The rule definition opens.
4. Edit the fields as needed.
5. Click **Save**.

The rule definition is saved with your changes, and a status message appears in the upper corner of the page.

## Delete a rule definition

You can delete a rule definition that is no longer needed. You can only delete rule definitions that are not currently being used by a metadata rule.

Perform the following steps to delete a rule definition:

1. In the left navigation menu, click **Data Operations**.

   The Manage Data Operations page opens.
2. On the **Metadata Rules** card, click **Definitions**.

   The Rule Definitions tab opens.
3. Locate the name of the rule definition that you want to delete and select its check box.
4. Click **Delete**.

   If the rule definition you are trying to delete is attached to a metadata rule, the rule definition cannot be deleted, and you get a notification asking you to unlink the definition from all associated metadata rules before you can proceed.

The rule definition is deleted, and a confirmation message appears in the upper corner of the page.

## Import rule definitions

You can import rule definitions into the Data Catalog environment in JSON format.

By using the import rule definition feature, you can apply standard rule definitions across multiple Data Catalog environments or migrate rules from testing or staging to production without manually recreating each one, saving time and reducing errors.

Perform the following steps to import rule definitions.

Ensure you have a JSON file that contains all details of rule definitions. If you are migrating from different Data Catalog instances, you can export rule definitions in a JSON file containing. For more information, see [Export rule definitions](#export-rule-definitions).

1. In the left navigation menu, click **Data Operations**.

   The Manage Data Operations page opens.
2. On the **Metadata Rules** card, click **Definitions**.

   The **Rule Definitions** tab opens.
3. Click **Import Rule Definition**.

   The **Import Rule Definitions** dialog box opens.
4. Upload the JSON file containing the rule definition details and click **Upload**.

The rule definition is imported and appears in the Rule Definitions list.

## Export rule definitions

You can export existing rule definitions from Data Catalog in JSON format for backup purposes, to save the rule configurations and restore them if necessary.

Additionally, you can share metadata rule definitions across teams or environments.

Perform the following steps to export a rule definition:

1. In the left navigation menu, click **Data Operations**.

   The Manage Data Operations page opens.
2. On the **Metadata Rules** card, click **Definitions**.

   The **Rule Definitions** tab opens.
3. Click **Export Rule Definition**.

   This downloads the file containing the rule definition details in JSON format.

You have successfully exported the rule definitions.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.pentaho.com/pdc-admin/pdc-manage-rules-cp-ag/pdc-manage-metadata-rules-cp/pdc-rule-definitions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
