# Create a Rule

To create a Rule, click the **New** button on the top left corner and fill in these fields:

* **General Information**: assign a name to the Rule you are creating and optionally enter a description to ensure clarity and organization among multiple rules.
* **Listening folder (VFS)**: select or create a folder within the VFS where files will be monitored by the rule. To create a new folder, click the + button in the lower right corner of the **Choose folder** window.
* **Trigger**: rules can be activated by the arrival of a new file or executed on a **schedule** defined by a cron expression.
  * **New file**: select this option to apply the rule when a **new file arrives** in the folder.

    You will set file characteristics (for example, file name pattern, size, or extension) in the **Condition attributes** section below. \
    **Example:** Apply the rule when a new `.csv` file is added to the folder.&#x20;
  * **Schedule**: select this option to apply the rule according to a **cron expression**, which defines the seconds, minutes, hours, days, and months when the rule must run. You can configure the schedule using the graphical controls or enter the cron expression directly in the input field at the bottom of the section (the field with a grey background).\
    **Example**: Run the rule every Monday at 08:00: `0 0 8 * * 1`
  * **Period**: select this option to define the **time range** during which the rule is active. The rule is executed only if the trigger condition occurs **within the configured period**.\
    **Example:** Activate the rule from **01 March 2026** to **31 March 2026** to process files only during that month.
* **Condition attributes**: click the + button and select or create a Condition Attribute, which defines the criteria that must be met for the rule to be applied. Condition attributes can be based on specific file characteristics, such as file size, file name, or origin.\
  When using the **filename** attribute, you can choose one of the following matching options:&#x20;
  * **RegExp** to define the condition using a **regular expression**. This option allows advanced and precise pattern matching. The **Value** field accepts a valid regular expression. \
    **Example**: `.*\.txt` → matches all files with the .txt extension.&#x20;
  * **Wildcard** to define the condition using **simple wildcard characters**. \
    The **Value** field supports `*` to match any sequence of characters and `?` to match a single character. \
    **Example**: `report_*` → matches all files starting with report\_.
* **Actions**: select the task to be executed once the condition attribute is met. The complete list of actions is available on the [Actions](/data-mover-smart/rules/actions.md) page and subpages.&#x20;

When done, click the **Save** button. The Rule will be added to the list.

### Rule status and Timezone panel

When configuring the Rule, a panel on the left of the screen allows you to control the **rule status**, configure the **timezone used for rule execution**, and assign **tags**.

* **Enabled**: The **Enabled** toggle controls whether the rule is active. When enabled, the rule is executed according to its configured trigger and schedule. When disabled, the rule remains configured but is not executed.
* **Timezone**: this section defines the timezone used to evaluate **scheduled executions** (cron expressions).
  * **System timezone**\
    Displays the system default timezone (for example, *Europe/Rome (UTC +02:00)*).
  * **Override with**\
    Allows you to override the system timezone by selecting a different timezone from the drop‑down list.
    * The selected timezone (for example, *Etc/GMT+12 (UTC‑12:00)*) is applied only to the rule.
    * The **X** icon removes the override and restores the system timezone.
    * The **drop‑down arrow** opens the list of available timezones.
* **Tags**: allows you to assign one or more **tags** to the rule. Click the **+** icon to add a tag. Tags can be used to **classify**, **filter**, and **group** rules in the Rules list.

### Draft saving behavior

When creating a new **Rule**, Data Mover Smart automatically saves a **draft** as soon as you start typing in any field. The draft mechanism prevents accidental loss of work and allows you to safely pause configuration activities and resume them later without re‑entering information.

As soon as a draft is created, a \* **Draft saved** chip appears next to the **New** button. This indicates that the current configuration has been temporarily saved, even if the entity has not been explicitly saved.

<figure><img src="/files/dyXZoIEVVSnqrV7JBnTP" alt="" width="206"><figcaption></figcaption></figure>

If you leave the page **without saving** (for example, by returning to the File Event Listeners list), the draft is preserved. In this case, the **New** button in the list view displays a \* **Draft** chip.

<figure><img src="/files/AwE7loQXbOOnVLL63PEi" alt="" width="178"><figcaption></figcaption></figure>

When you click **New** again, the previously entered values are automatically restored and displayed in the configuration form, allowing you to continue where you left off.

<figure><img src="/files/OXDh86LwOKgmsse7UHxF" alt="" width="206"><figcaption></figcaption></figure>

The <img src="/files/fcKBZHPrjphefTsfVEqm" alt="" data-size="line"> **broom icon** allows you to reset all fields or remove the saved draft. After clearing the draft, clicking **New** opens a blank configuration form.


---

# Agent Instructions: 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:

```
GET https://docs.primeur.com/data-mover-smart/rules/create-a-rule.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
