# Prerequisite Training Requirements

Prerequisite Training Requirements allow Training Admins to establish rules on a _Training Requirement_ to ensure that Learners complete specific training assignments before other specified training assignments. This ensures that a Learner has proper knowledge in a training topic before they can complete training for another related topic. This logic can be used to accommodate several common training scenarios, such as:

* Completing training on documents to prepare for a live classroom training course
* Attending an in-house classroom training before attending an external training
* Completing training on equipment safety and maintenance procedures before completing training on equipment operation

Trainings with prerequisites are visible to Learners but are locked and inaccessible until they complete the prerequisite training. A _Training Requirement_ can have one prerequisite in each _Curriculum_ it is part of.



<div class="note-border alert-info">
  <div class="alert alert-info" role="alert">
    <div><i class="far fa-info-circle"></i></div>
    <div class="alert-text">
      <p><strong>Note</strong>: Prerequisite Training Requirements and Curriculum Prerequisites are independent features which can be used together or separately. See <a href="/en/lr/589032/">Curriculum Sequencing &amp; Prerequisites</a> for more information.</p>
    </div>
  </div>
</div>



## Terminology

Understanding the difference between prerequisite and dependent _Training Requirements_ or _Training Assignments_ is key to understanding Prerequisite Training Requirements:

* **Prerequisite**: A Learner must complete the assignment from a prerequisite _Training Requirement_ prior to beginning its dependent assignment. A prerequisite _Training Requirement_ is one referenced by a _Prerequisite Training Rule_ on another _Training Requirement_.
* **Dependent**: A Learner cannot begin training on a dependent *Training Requirement*'s issued assignment until they have completed its prerequisite assignment. A dependent _Training Requirement_ is one with a defined _Prerequisite Training Rule_.
* **Prerequisite Training Rule**: A _Training Rule_ that governs which _Training Assignments_ must be completed prior to completing another. You can define one (1) _Prerequisite Training Rule_ per _Curriculum_ on a _Training Requirement_.

## How Prerequisite Training Requirements Work

The following sections outline important points of Prerequisite Training Requirements as they relate to other key parts of the Training application.

### Training Requirements

* Each _Training Requirement_ can only have one _Prerequisite Training Rule_.
* A _Training Requirement_ and its prerequisite _Training Requirement_ must both be in the same _Curriculum_.
* If a _Training Requirement_ belongs to multiple _Curricula_, then the _Training Requirement_ can have multiple prerequisite training rules, one for each _Curriculum_.

### Training Assignments

* Vault considers a _Training Assignment_ as complete whenever it is in the _Completed_ lifecycle state.
* In most cases, completion of the prerequisite _Training Assignment_ immediately unlocks any dependent _Training Assignments_. Vault does not unlock dependent assignments when a prerequisite assignment is created via Direct Assignment, according to its _Creation Source_.
* If a Learner is assigned a dependent _Training Assignment_ that is part of multiple _Curricula_, completing its prerequisite _Training Assignment_ from any of those _Curricula_ unlocks the dependent _Training Assignment_. In other words, the logical operator between prerequisite training rules is considered an `OR`.

### Training Rule Enforcement

* Vault enforces prerequisite rules one time only. If a _Training Assignment_ is issued to a Learner again because of a [document revision or recurrence][4], Vault will not enforce the prerequisite rule again.
* [Changes][5] made to prerequisite training rule configuration are enforced in real time and can impact open _Training Assignments_, regardless of the _Training Requirement_ lifecycle state. For example, if a Training Admin deletes a prerequisite rule, the next time the Learner opens either the dependent or prerequisite _Training Assignment_, or views the Learner Homepage, the _Training Assignment_ reflects the current configuration status.
* Vault does not evaluate or enforce prerequisite rules for _Classroom Training Assignments_ that are already part of an active _Class Roster_.
* Vault does not enforce prerequisite training rules for _Training Assignments_ issued via Direct Assignment.

### Traceability

* The relationship between a prerequisite _Training Assignment_ and its dependents are captured in _Related Training Assignment_ object records.
* The _Update Training Assignments_ job log captures prerequisite rules evaluated by the job.
* The _Latest Automation Update_ field on a *Training Assignment*'s individual object record details the impact of prerequisite rules changes.

## Enabling Prerequisite Training Requirements

To enable Prerequisite Training Requirements, an Admin must perform the following configurations:

* Activate the _Prerequisite Training Rule Set_ object type in the _Training Rule Set_ object configuration.
* Activate the _Prerequisite Training Rule_ object type in the _Training Rule_ object configuration.
* Add the _Prerequisite Training Rule Set_ section to each applicable _Training Requirement_ [object type page layout](/en/lr/26387/).

### Enabling with Curriculum Prerequisites {#enabling-with-curriculum-prerequisites}

The [Curriculum Prerequisites](/en/lr/589032/) feature released in 24R1 allows you to apply an additional layer of prerequisite training to your training matrix, where Learners must complete all assignments for a prerequisite _Curriculum_ before moving on to assignments for another, dependent _Curriculum_.

If you Vault was created on or before 23R3 and your organization is using or will use Curriculum Prerequisites alongside Prerequisite Training Requirements, we recommend the following labeling updates to distinguish from Curriculum Prerequisites UI elements:

  1. Relabel the existing `training_rule__v` and `training_rule_set__v` objects to _Training Requirement Rule_ and _Training Requirement Rule Set_, respectively. We also recommend relabeling their related object types, `prerequisite_training_rule__v` and `prerequisite_training_rule_set__v` to _Prerequisite Training Requirement Rule_ and _Prerequisite Training Req Rule Set_, respectively.
  2. On the _Training Assignment_ object, relabel the existing `prerequisite_status__v` field to _Training Requirement Prerequisite Status_.

## Defining Prerequisite Training Rules for Training Requirements {#defining}

To define prerequisite training rules for a _Training Requirement_:

1. Navigate to **Business Admin > Training Requirements** or to a custom object tab and click into the _Training Requirement_ for which you want to add prerequisites.
2. In the _Prerequisite Training Rule Set_ section, click **Edit**.
3. Click **+ Rule**.
4. In the **In Curriculum** field, select a _Curriculum_. Note that both the prerequisite and dependent _Training Requirement_ must be in the same _Curriculum_.
5. In the **Training Requirement** field, select the prerequisite _Training Requirement_.
6. Optional: If the dependent _Training Requirement_ is in more than one _Curriculum_, you can continue adding prerequisites for each respective _Curricula_ by clicking **+ Rule**.
7. Click **Save**.

Once saved, Vault evaluates and applies prerequisite training rule changes when a Learner opens an affected _Training Assignment_.

## Example Use Case: Document Prerequisites for Classroom Training

A common need for prerequisites occurs when an organization requires employees to review and complete training on documents prior to receiving live classroom training. Suppose you are a Training Admin at an organization that has multiple lab areas with some differing equipment safety procedures, whose employees all need to review and sign-off on the relevant safety documentation prior to a hands-on demonstration in a classroom environment. You might have the following set of _Curricula_ and _Training Requirements_:

Curriculum "Lab Area Alpha", with the following _Training Requirements_:

* Document: Fume Hood Safety
* Classroom: Safe Operation of Lab Equipment

Curriculum "Lab Area Beta", with the following _Training Requirements_:

* Document: Airlock Safety
* Classroom: Safe Operation of Lab Equipment

In this simplified scenario, you could [define][1] two prerequisite training rules on the _Classroom: Safe Operation of Lab Equipment Training Requirement_ record:

`Rule 1: In Curriculum `**`Lab Area Alpha`**`, this training requirement has the following prerequisites: `**`Fume Hood Safety`**

`Rule 2: In Curriculum `**`Lab Area Beta`**`, this training requirement has the following prerequisites: `**`Airlock Safety`**

In this case, Vault would not allow a Learner to begin the _Classroom: Safe Operation of Lab Equipment_ training assignment until they had completed the safety document training specific to their lab area.

While this example is simplified, these prerequisite training requirements could include multiple documents, videos, e-learning courses, and a quiz to provide a large amount of preparation for the classroom session. In addition, you could further define [substitution][2] rules to, for example, allow lab employees to review the prerequisite training documents in different languages.

## About Prerequisite Training Rule Evaluation {#rule-evaluation}

_Prerequisite Training Rules_ do not result in the creation of _Training Assignments_ by themselves, they only determine whether Learners must complete one assignment before another. _Training Assignment_ creation is handled by the _Update Training Assignments_ job or by [Direct Assignment][3].

Anytime the _Update Training Assignments_ job processes a _Training Requirement_ with a prerequisite and creates, updates, or cancels a _Training Assignment_, it evaluates the requirement's prerequisite rules and creates the relationship between prerequisite and dependent _Training Assignments_ as a _Related Training Assignment_ record. Details of the evaluation are available in the [job log](/en/lr/50967/#vault-training-job-logs).

If a Training Admin creates, edits, or deletes a prerequisite training rule for a Training Requirements, Vault reevaluates the assignment's _Prerequisite Training Rules_ every time a Learner accesses the _Training Assignment_ to determine if any changes have been made or if the prerequisite has been satisfied. Changes to the _Training Assignment_ are captured in the _Latest Automation Update_ text field.

Vault captures the _Training Assignment_'s locked status in the _Prerequisite Status_ field and in the _Related Training Assignment_ object's _Training Assignment Fulfillment Status_ field.

### Changes to Prerequisite Training Rules {#changes}

If the _Prerequisite Training Rules_ for the _Training Requirement_ are updated or deleted, or if new rules are created, Vault evaluates and applies the rules the next time a Learner accesses the applicable _Training Assignment_, either by viewing the Learner Homepage or clicking into a _Training Assignment_ task. This can result in locking the assignment if new unfilled prerequisites have been added, unlocking if its prerequisites have been removed, or maintaining its current locked or unlocked status.

While the _Update Training Assignments_ job evaluates and applies prerequisite training rules when creating assignments, it does not handle any changes to prerequisite training rules on previously existing Training Assignments.

### Document Revisions, Recurrence & Prerequisites {#document-revision-recurrence}

If an open document _Training Assignment_ is either a prerequisite or a dependent, and a new revision to the training document triggers a new document _Training Assignment_, then the new document _Training Assignment_ is linked to the open prerequisite or dependent _Training Assignments_. As the logical operator between prerequisite training rules is 'OR', the Learner is only required to complete one of the open prerequisites before starting the dependent assignment.

For example, suppose _Safety SOP_ is a prerequisite for _Production SOP_. A Learner has an open assignment for _Safety SOP **v1.0**_, which is a prerequisite for _Production SOP **v2.0**_. Later, when _Safety SOP **v2.0**_ is made effective and re-issued for training, Vault will make _Safety SOP **v2.0**_ a prerequisite to _Production SOP_. Now, _Production SOP_ has two (2) prerequisites: _Safety SOP **v1.0**_ and _Safety SOP **v2.0**_. The Learner is only required to complete one of these _Safety SOP_ assignments before being allowed to complete the _Production SOP_ assignment.

Vault applies the same behavior for recurrence-based training.

### Retiring or Removing a Training Requirement or Curriculum Used In a Prerequisite Training Rule

You cannot retire a _Training Requirement_ or _Curriculum_ if it is currently referenced in a prerequisite training rule. Furthermore, you cannot remove a _Training Requirement_ from a _Curriculum_ or a _Curriculum_ from a _Training Requirement_ if either object record is currently referenced in a prerequisite training rule.

To resolve this conflict, you must delete the rule first, then remove or retire the _Training Requirement_ or _Curriculum_.

## Prerequisites & Training Requirement Impact Assessments

A _Training Requirement_ that is either a prerequisite or a dependent, when updated, triggers a [_Training Requirement Impact Assessment_](/en/lr/57229/). An Admin can add the _In Use Prerequisite Training Rule Set_ section to the _Training Requirement Impact Assessment_ object page layout to allow for easier evaluation of Prerequisite Training Rules during impact assessment workflows.

While you cannot modify _Prerequisite Training Rules_ in a _Training Requirement Impact Assessment_ process, the section displays the current *Training Requirement*'s rule definitions. All rule definition changes must be made on the _Training Requirement_.

## Editing Prerequisite Rules in Training-Eligible Records

The _Prerequisite Training Rule Set_ section of the _Training Requirement_ record displays an informational alert when you click **Edit** on the record. Vault displays the alert only if the _Training Requirement_ has at least one open _Training Assignment_, and it displays the maximum number of open _Training Assignments_ that could be impacted by a change. Clicking the number takes you to a record list view filtered to the impacted _Training Assignment_ records.

Once you make a change to prerequisites, the next time a Learner loads the Learner Homepage or clicks on this _Training Assignment_, they will see any updated prerequisite rules reflected on the affected assignments.

## Loading Records with Vault Loader {#loading}

You can load _Training Rule Set_ and _Training Rule_ records for the _Prerequisite Training Rule_ object types using [Vault Loader](/en/lr/26597/) or create them using the <a class="external-link " href="https://developer.veevavault.com/" target="_blank" rel="noopener">Vault API<i class="fa fa-external-link" aria-hidden="true"></i></a>, with the following guidelines:

* Create records of the _Prerequisite Training Rule_ object type for the _Training Rule Set_ and _Training Rule_ objects.
* When a child _Training Rule_ is created for a parent _Training Rule Set_, Vault automatically populates the `training_rule_set_expression_tr_ids__v` field on the _Training Rule Set_ object record. This field holds the _ID_ value for the prerequisite _Training Requirement_.
* You do not need to populate the `training_rule_set_expression_tr_ext_ids__v` or `training_rule_set_expression_tr_ids__v` fields on the _Training Rule Set_ object record. These fields support future functionality.

See [Limitations & Data Validation][6] for additional information on how Vault assesses records created in bulk.


### Prerequisites & Direct Assignment {#direct-assignment}

_Training Assignments_ created via Direct Assignment cannot have prerequisites. Such assignments do not adhere to any prerequisite training rules in that assignment's _Training Requirement_. However, a _Training Assignment_ completed after being issued by Direct Assignment can satisfy a prerequisite training rule on another, dependent, _Training Assignment_.

## Limitations & Data Validation {#limitations}

Rules created via Vault Loader and Vault API, as well as within Vault, are subject to the below data validation, logic, and feature limitations.

### Rule Data Validation Restrictions {#rule-data-validation}

Rules created via Vault Loader and Vault API, as well as within Vault, are subject to the following data validation restrictions:

* A _Training Rule Set_ object record must have one (1) child _Training Rule_ object record and cannot have more than one (1) child _Training Rule_ object record. If the child _Training Rule_ record is not created or imported, then Vault will display an error message in the _Prerequisite Training Rules_ section on the _Training Requirement_ and will not evaluate or enforce any prerequisite rules.
* If a *Training Rule Set*'s object type is `prerequisite_training_rule_set__v`, then its child *Training Rule*'s object type must be `prerequisite_training_rule__v`.
* You cannot update the _Is A Substitute Training Requirement_ field value on a _Training Requirement_ if the requirement is referenced in a _Training Rule Set_ or _Training Rule_ object record.

#### Training Rule Set Object Data Validation

* A _Training Rule Set_ record can only reference a _Training Requirement_ record in a lifecycle state that is not _Retired_ or _Inactive_.
* A _Training Rule Set_ record cannot reference a _Training Requirement_ with the _Is A Substitute Requirement_ field value of _Yes_.
* A _Training Requirement-Curriculum_ object record must join the associated _Training Requirement_ and _Curriculum_ object records.
* The _Training Requirement-Curriculum_ join object record cannot be in the _Retired_ or _Inactive_ lifecycle states.

#### Training Rule Object Data Validation

* A _Training Rule_ record can only reference a _Related Training Requirement_ record in a lifecycle state that is not _Retired_ or _Inactive_.
* A _Training Rule_ record's referenced _Training Requirement_ and _Related Training Requirement_ must share the same _Curriculum_.

### Prerequisites & Direct Assignment {#direct-assignment}

_Training Assignments_ created via Direct Assignment cannot have prerequisites. Such assignments do not adhere to any prerequisite training rules in that assignment's _Training Requirement_. However, a _Training Assignment_ completed after being issued by Direct Assignment can satisfy a prerequisite training rule on another, dependent, _Training Assignment_.

### Prerequisites & Substitutes {#substitute}

The following limitations apply to combinations of [Substitute Training Rules](/en/lr/62206/) and Prerequisite Training Rules:

* You cannot define prerequisite rules on _Training Requirements_ which have the **Is a Substitute** checkbox selected.
* While a substitute assignment can be completed in place of a primary prerequisite assignment, the substitute itself cannot have prerequisites.
* Vault does not allow a substitute rule that references primary _Training Requirements_ and one or more of the primary _Training Requirements_ have a prerequisite. For example, suppose _External-CPR Training_ is a substitute for _CPR Classroom Training_ and _CPR Document Training_. _CPR Classroom Training_ and _CPR Document Training_ cannot themselves have prerequisites. This may cause circular references and therefore Vault prevents this rule configuration.

### Logic Limitations

Vault does not allow the following rule definition scenarios:

* Circular prerequisite logic: A _Training Requirement_ with a prerequisite cannot be a prerequisite for a _Training Requirement_ it is dependent on. For example, if _TR A_ was a prerequisite for _TR B_, and _TR B_ was a prerequisite for _TR C_, then _TR C_ could not be defined as the prerequisite for either _TR A_ or _TR B_.
* Self-requirement: A _Training Requirement_ cannot be its own prerequisite.

 [1]: #defining
 [2]: #substitute
 [3]: #direct-assignment
 [4]: #document-revision-recurrence
 [5]: #changes
 [6]: #limitations
