# Plan Preventive Maintenance

Preventive maintenance (PM) happens on a regular interval. You plan it once with a **Recurring** template. Kanoa then
generates each work order on schedule, and technicians complete them as in
[Preventive Maintenance](../8-maintenance-technician/3-preventive-maintenance.md).

## Create the Recurring Template

For example, CoreForge's weekly PM for Machine 1.

1. Open **Configuration → Maintenance → Work Orders** and add a template on the **Work Orders** tab.
2. Fill in the details:

   | Field | Example |
   | --- | --- |
   | Title | `Machine 1 - Weekly PM` |
   | Asset | `CoreForge\Philadelphia\Machining\Machine 1` |
   | Maintenance type | Preventive |
   | Work type | `Lubrication` |
   | Priority | Medium |
   | Procedure | `Machine 1 Weekly PM` |
   | Schedule type | Recurring |

3. In the **Schedule** section, set the **Start Date**, **Generate Ahead** and how often to **Repeat every**, such as
   `1` `Week` on a chosen day. Leave **Ends** at **Never** for a PM that never stops.

![Recurrence options](https://docs.kanoa.ai/img/cmms/rruleOptions.png)

Schedule times follow the asset's site time zone, so a PM due at 06:00 stays at 06:00 at the plant when the clocks change.

## Choose Generate Ahead

**Generate Ahead** controls how far in advance work orders are created. With 7 days, next week's PM appears in the work
order list a week early. Planners and technicians see the workload coming, so check the **Due on** date and not just whether
the work order exists.

## Release the Template

1. Save the template, then set its version status to **Released**.

:::warning
Releasing a recurring template starts real work orders, and it keeps generating them on schedule. Technicians will see
them. Check the procedure, priority and schedule first. A template that is not Released is never scheduled.
:::

{/*
TODO: Confirm on a gateway how to stop or change a recurring template that is already released (for example setting its
version status back from Released, or ending it), and what happens to work orders already generated. The docs describe
only Released as the status that schedules work. Also confirm whether releasing generates the first work order at once or
only when it falls inside the Generate Ahead window.
*/}

::embed-section{src="../../kanoa-cmms/workOrderTemplate.md#schedule-types" collapsed="true" summary="Reference Materials: Schedule Types - One Time, Recurring and Condition."}

::embed-section{src="../../kanoa-cmms/workOrderTemplate.md#version-status" collapsed="true" summary="Reference Materials: Version Status - Why a template must be Released."}

## Worked Example

The CoreForge sample plant schedules Machine 1's weekly PM, with the procedure from Write a Procedure, the same as
Developer Training.

::embed-section{src="../../training/7-training-maintenance/02-work-orders/3-recurring-pm.md#create-the-recurring-template"}

## Check Your Understanding

1. Which schedule type do you use for a weekly PM?
2. What does **Generate Ahead** do?
3. When does a template start generating work orders?

<details>
<summary>Answers</summary>

1. **Recurring**.
2. It sets how far in advance work orders are created, so next week's PM appears early.
3. Once its version status is **Released**.

</details>
