# Working with the HACCP Flow Diagram (HACCP)

Veeva HACCP provides a HACCP Flow Diagram to view and manage a _HACCP Plan_ as part of your food safety processes. The HACCP Flow Diagram lets you visualize a _HACCP Plan_ from start to finish, and [perform hazard analysis](/en/lr/991538/) for your _HACCP Plan_, in an easy-to-use visual interface.

Depending on your [Admin's configuration](/en/lr/991540/), object, field, and section labels may appear differently than the labels mentioned in this article.

<a href="https://platform.veevavault.help/assets/images/quality-haccp-hfd.png" data-lightbox="quality-haccp-hfd.png" data-title="" data-alt="HACCP Flow Diagram">
  <img class="docimage" src="https://platform.veevavault.help/assets/images/quality-haccp-hfd.png" alt="HACCP Flow Diagram" style=""  />
</a>

## Viewing the HACCP Flow Diagram {#view}

You can launch the HACCP Flow Diagram for a _HACCP Plan_ in the following ways:

* Navigating to the _HACCP Plan_ record and either selecting **Launch Process Flow Diagram** (<img class="inline" src="https://platform.veevavault.help/assets/images/cpc-icon-flow.png" alt="Launch Process Flow Diagram Icon" style="" />) from the record's **All Actions** menu, or clicking the **Launch Process Flow Diagram** icon on the record.
* Navigating to the list of _HACCP Plans_ in your Vault, opening the **Actions** menu next to a _HACCP Plan_ name, and selecting **Launch Process Flow Diagram**.

After launching the HACCP Flow Diagram, you can see and interact with the following elements:

* The diagram canvas at the center of the HACCP Flow Diagram displays steps, connections, and groups in a _HACCP Plan_. See [About HACCP Flow Diagram Symbols][5] for more information about the symbols on the canvas.
* You can view information about a selected diagram element and its related hazard analyses by clicking the **Additional Information** (<img class="inline" src="https://platform.veevavault.help/assets/images/cpc-icon-details.png" alt="Information Icon" style="" />) icon at the top of the diagram to open the [_Information_ panel][3].
* You can [add new steps][4] directly from this panel when the diagram is in edit mode by clicking the **Flowchart Shapes** (<img class="inline" src="https://platform.veevavault.help/assets/images/cpc-icon-shapes.png" alt="HACCP Diagram Symbols Icon" style="" />) icon at the top of the diagram.
* Click the **Gridlines** (<img class="inline" src="https://platform.veevavault.help/assets/images/cp-icon-grid.png" alt="Grid Icon" style="" />) icon at the top of the diagram to display the grid background view.
* Click the **Completeness Check** (<img class="inline" src="https://platform.veevavault.help/assets/images/cp-icon-qms-ha-completeness-check.png" alt="Hazard Analysis Completeness Check Icon" style="" />) icon at the top of the diagram to see the [hazard analysis completeness status](/en/lr/991538/#completeness) on all steps and groups on the canvas and all _Hazard Analyses_ displayed in the _Information_ panel.
* Click the **Search Diagram** (<i class="fa fa-search"></i>) icon at the top of the diagram to search for steps in your _HACCP Plan_ by display label. When you search for a step, Vault directs you to the first step that matches your search input.
* Click **Refresh** (<img class="inline" src="https://platform.veevavault.help/assets/images/cp-icon-hfd-refresh.png" alt="Refresh Icon" style="" />) at the top of the diagram to see any changes to data displayed on the diagram that were made in a separate tab or window without resetting your area of focus, zoom level, and other settings on the diagram canvas. Vault also preserves any open sections and applied filters within the _Information_ panel, excluding subsections for individual _Process Hazard Analyses_.
* Open the **Actions** menu at the top of the diagram to run the [_Auto-number Process Steps_][6] and [_Generate HACCP Plan Report_][7] actions.
* Click the fit view (<img class="inline" src="https://platform.veevavault.help/assets/images/cp-icon-fit-view.png" alt="Fit View Icon" style="" />) icon on the diagram to fit the symbols within the diagram canvas.
* Zoom in and out using the **+** and **-** symbols on the diagram.
* Click the name of the _HACCP Plan_ at the top of the diagram to open the _HACCP Plan_ record in a new browser tab.
* The larger structure of the HACCP Flow Diagram displays in a minimap at the bottom of the diagram canvas. Click and drag within the minimap to navigate to different sections of the _HACCP Plan_.

### About HACCP Flow Diagram Symbols {#symbols}

The canvas of the HACCP Flow Diagram displays various symbols that represent object records stored in Vault. Editing the information associated with symbols on the HACCP Flow Diagram updates the data in corresponding object records. For instance, clicking and dragging a new rectangle onto the HACCP Flow Diagram from the _Diagram Symbols_ panel creates a new corresponding _HACCP Plan Process Step_ object record of _Process Step_ type in Vault.

<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>: The term “steps” refers to <em>Process Step</em>, <em>Material Step</em>, and <em>Logistics Step</em> type <em>HACCP Plan Process Steps</em> displayed on the HACCP Flow Diagram. In some cases, <em>Connector</em> type <em>HACCP Plan Process Steps</em> have distinct functionality from other types of <em>HACCP Plan Process Steps</em>, and are only included where explicitly noted.</p>
    </div>
  </div>
</div>



#### HACCP Flow Diagram Legend {#legend}

Different shapes on the diagram represent different elements:

<table>
  <tr>
    <th><strong>Shape</strong></th>
    <th><strong>Description</strong></th>
  </tr>
  <tr>
    <td><img class="inline" src="https://platform.veevavault.help/assets/images/cp-haccp-process-step.png" alt="Rectangle labelled 'processing'" style=" width: 18rem;" /></td>
    <td>Rounded rectangles with record labels on the diagram canvas represent <em>Process Steps</em> in a <em>HACCP Plan</em>.</td>
  </tr>
  <tr>
    <td><img class="inline" src="https://platform.veevavault.help/assets/images/cp-haccp-material-step.png" alt="Rectangle labelled 'Materials'" style=" width: 18rem;" /></td>
    <td>A <em>Material Step</em> on the diagram canvas represents a step in which a material is introduced or processed. You can click on <em>Material Steps</em> to display a list of ingredients necessary for the step with a link to see more. The ingredient list also displays on steps in the HACCP Flow Diagram document generated by running the <a href="#haccp-docs"><em>Generate HACCP Plan Report</em> action</a>.</td>
  </tr>
  <tr>
    <td><img class="inline" src="https://platform.veevavault.help/assets/images/cp-qms-logistics.png" alt="Hexagon labelled 'logistics'" style=" width: 18rem;" /></td>
    <td>A <em>Logistics Step</em> on the diagram canvas represents a step in which a material is stored or distributed. These steps display a list of necessary materials for the step; hover over the step to see more materials.</td>
  </tr>
  <tr>
    <td><img class="inline" src="https://platform.veevavault.help/assets/images/cp-qms-connector.png" alt="Circle labelled 'Connector'" style=" width: 10rem;" /></td>
    <td><em>Connectors</em> start and end the flow, and connect two modular diagrams together.</td>
  </tr>
  <tr>
    <td><img class="inline" src="https://platform.veevavault.help/assets/images/cp-qms-hppsc.png" alt="Connection Arrow" style=" width: 15rem;" /></td>
    <td>Lines between steps on the diagram canvas represent the connections between steps in a structured process. The arrow at the end of a connection points to an output step.</td>
  </tr>
  <tr>
    <td><img class="inline" src="https://platform.veevavault.help/assets/images/cp-haccp-group.png" alt="Group of process steps enclosed by a gray dotted line" style=" width: 18rem;" /></td>
    <td>A border with a label enclosing at least one step represents a process step group. Clicking on a group's label or outline selects it and highlights its steps. Groups cannot be optional.</td>
  </tr>
  <tr>
    <td><img class="inline" src="https://platform.veevavault.help/assets/images/cp-haccp-optional-step.png" alt="Rectangle with dotted line border labelled 'process step 1'" style=" width: 18rem;" /></td>
    <td>A dotted line border on any type of step indicates it is optional.</td>
  </tr>
  <tr>
    <td><img class="inline" src="https://platform.veevavault.help/assets/images/cp-qms-optional-connection.png" alt="Dotted Line Connection Arrow" style=" width: 15rem;" /></td>
    <td>A dotted line connection indicates it is optional.</td>
  </tr>
</table>

#### About the Information Panel {#info-panel}

The _Information_ panel lets you view and update information about a selected symbol on the HACCP Flow Diagram.

To launch the _Information_ panel, click the **Additional Information** (<img class="inline" src="https://platform.veevavault.help/assets/images/cpc-icon-details.png" alt="Information Icon" style="" />) icon; when a diagram element is selected, the panel displays information about that element. Depending on the diagram element you select, the _Information_ panel displays the following sections:

* **General**: The _General_ section displays information for the selected step or group.
* **HACCP Plan Ingredients**: When you select a _Material Step_ on the diagram canvas, the _HACCP Plan Ingredients_ section displays up to 15 ingredients associated with the selected step. You can click on each ingredient to view and modify the corresponding _HACCP Plan Ingredient_ record in a new browser window. If there are more than 15 ingredients associated with a selected _Material Step_, you can click a link in the card that displays when you hover over the record count indicator at the top of the section to view more ingredients.
* **HACCP Plan Process Step Groups**: When a selected step is part of multiple groups, the _HACCP Plan Process Step Groups_ section displays up to five groups to which the step belongs.
* **HACCP Plan Process Steps**: When you select a group on the diagram canvas, the _HACCP Plan Process Steps_ section displays up to ten associated steps.
* **Hazard Analyses**: When expanded, the _Hazard Analyses_ section displays up to 15 _Process Hazard Analysis_ records for a selected step or group. You can scroll through up to 500 _Process Hazard Analyses_ in the _Information_ panel using the (**>**) and (**<**) icons and filter records by hazard significance, classification, and hazard analysis completeness status using the filter (<i class="far fa-filter"></i>) icon. Additionally, you can expand each _Process Hazard Analysis_ record to see information for hazards and control measures and perform hazard analysis for steps and groups.

Click the (<img class="inline" src="https://platform.veevavault.help/assets/images/cp-icon-new-window.png" alt="New Window Icon" style="" />) icon at the top of the _Information_ panel to open the object record for the selected diagram element in a new window. You can adjust the size of the _Information_ panel by clicking and dragging the edges.

## Editing the HACCP Flow Diagram {#edit}

To enter edit mode on a HACCP Flow Diagram, launch the diagram and click **Edit Mode**. You will stay in edit mode until you save your changes. While in edit mode, Vault periodically autosaves your changes in the diagram; the timestamp of when the diagram last autosaved displays on the diagram, if applicable. You must click **Save** when you are finished editing the diagram. 

### Creating & Editing Process Steps {#edit-steps}

When in edit mode, you can add, update, and delete steps. To do this:

1. Open the **Diagram Symbols** panel.
2. Click and drag a symbol from the _Diagram Symbols_ panel to the desired position in the HACCP Flow Diagram, or click inside an existing step on the diagram to select it. 
3. Do one of the following:
    * Click the **Actions** menu on a _Process Step_ or _Logistics Step_ and select **Edit**. Do one of the following:
        * Click on the label of the step to open a drop-down list that lets you select an existing reference _Process Step_ from the library or open a window to create a new reference _Process Step_.
        * Click the binoculars (<img class="inline" src="https://platform.veevavault.help/assets/images/cpc-icon-binoculars.png" alt="Binoculars Icon" style="" />) icon to open a new window that lets you search for an existing reference _Process Step_ or create a new reference _Process Step_.
    * On a _Material Step_:
        * Click and drag the edges of the step to resize it. When you resize a _Material Step_, users can click on it to see a list of up to 100 ingredients that fit within the step. 
        * Select **Edit** from the **Actions** menu or click <img class="inline" src="https://platform.veevavault.help/assets/images/cp-haccp-materials.png" alt="Add Materials Button" style=" width: 6rem;" /> to open a dialog from which you can select existing ingredients or create ingredients to add to the step.
        * Select the **Material Step** and click the binoculars (<img class="inline" src="https://platform.veevavault.help/assets/images/cpc-icon-binoculars.png" alt="Binoculars Icon" style="" />) icon in the _Information_ panel next to the _Ingredients_ section header to launch a new window from which you can select existing ingredients or create new ingredients.
    * Select **Edit** from the **Actions** menu on a _Connector_ to update the step's name.
    * Select **Optional** from the **Actions** menu on a required step of any type to make it optional. Select **Required** on an optional step to make it required.
    * Select **Delete** from the **Actions** menu on any type of step to delete the step and its related connections from the diagram and from Vault. This will not delete any related reference steps from the library.
    * Click the **Edit** (<img class="inline" src="https://platform.veevavault.help/assets/images/CPC-Icon-Edit.png" alt="Edit Icon" style="" />) icon in the _Information_ panel to update information about a selected step.
    * Click and drag a step to move it to a new position in the diagram.
4. Click out of the step when you are done editing to deselect it.
5. When you are done making changes to the diagram, click **Save**.

### Creating & Editing Connections {#edit-connections}

When in edit mode, you can add, update, and delete the connections between steps. To do this:

1. Click one of the connection handles on the border of the desired input step's node and drag your cursor to the connection handler of the desired output step, or click on an existing connection on the diagram to select it.
2. Do one of the following:
    * To update information about the connection, open the _Information_ panel. Click the **Edit** (<img class="inline" src="https://platform.veevavault.help/assets/images/CPC-Icon-Edit.png" alt="Edit Icon" style="" />) icon next to the _General_ section header, then save your changes.
    * To move the connection between two steps on the diagram, click and drag it.
    * To make a required connection optional, click the **Actions** menu on the connection and select **Optional**. To make it required, select **Required** on an optional connection.
    * To reposition the connection's line, click and drag a segment of the connection not attached to a step.
    * To delete a connection, click the **Actions** menu on the connection and select **Delete**.
3. To deselect the connection, click an empty space on the diagram canvas or select another diagram element.
4. When you are done making changes to the diagram, click **Save**.

### Creating & Editing Process Step Groups {#edit-groups}

When in edit mode, you can create groups of steps and update which steps belong to groups.

To create a new group or update group membership for a step:

1. On the HACCP Flow Diagram canvas, click a step's **Actions** menu.
2. Select **Manage Groups**.
3. In the dialog:
    * Select groups to add the step to.
    * Click **Create** to create a new group to add the step to. Fill out any required information and click **Save**, or click **Save + Create** to create another group.
4. Click **Save**. 

To update the steps that belong to a group:

1. On the HACCP Flow Diagram canvas, click a group's **Actions** menu.
2. Select **Manage Steps**.
3. In the dialog, select or deselect the steps you wish to add or remove.
4. Click **Save**.

Upon saving, the group's boundary reflects any added or removed steps.

To update information about a group:

1. Select a group on the diagram canvas by clicking on its label.
2. Open the _Information_ panel. Click the **Edit** (<img class="inline" src="https://platform.veevavault.help/assets/images/CPC-Icon-Edit.png" alt="Edit Icon" style="" />) icon next to the _General_ section of the _Information_ panel to update information about the group.
3. When you are done making changes to the diagram, click **Save**.

### Locking & Unlocking the HACCP Flow Diagram {#lock-unlock}

To prevent updates to the HACCP Flow Diagram, select the **Lock HACCP Flow Diagram** action from the **All Actions** menu of a _HACCP Plan_ record. Running this action will make the HACCP Flow Diagram available in view mode only. The _Unlock HACCP Flow Diagram_ action re-enables edit mode on the diagram.

## Automatically Renumbering Process Steps on the HACCP Flow Diagram {#auto-number}

If configured by your Admin, you can run an action that updates the numbering of the steps on the HACCP Flow Diagram. Once the custom action has been implemented, you can execute it to apply business rules tailored for your organization's business processes to update the numbering on steps, eliminating the need to manually renumber due to additions and removals.

To auto-number _HACCP Plan Process Steps_ on the HACCP Flow Diagram, do the following:

1. Navigate to the appropriate _HACCP_ tab or to **Business Admin > Objects > HACCP Plans**.
2. Select a _HACCP Plan_ and [launch the HACCP Flow Diagram][2].
3. Click the **Actions** menu at the top of the diagram.
4. Select **Auto-number Process Steps**. Depending on your organization's configuration, this action's label might differ.
5. Confirm in the dialog that you wish to run the action.
6. The diagram is locked while the action runs. When the auto-numbering is complete, Vault sends you a notification. You can then refresh the diagram to view the results.

<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>: Contact your Veeva Representative for more information about enabling this action.</p>
    </div>
  </div>
</div>



## Generating HACCP Documents {#haccp-docs}

You can generate a binder containing documents from a _HACCP Plan_ in your Vault. Run the _Generate HACCP Plan Report_ action from a _HACCP Plan's_ HACCP Flow Diagram to generate a source file and PDF rendition of the HACCP Flow Diagram, as well as a [Merge Fields](/en/lr/30965/) document with data from the _HACCP Plan_. When the action completes, both documents are available in a binder in your Vault Library. Each time you run the action, Vault generates a new binder and associated documents.

To generate HACCP documents, do the following:

1. Navigate to the appropriate _HACCP_ tab or to **Business Admin > Objects > HACCP Plans**.
2. Select a _HACCP Plan_ and [launch the HACCP Flow Diagram][2].
3. Open the **Actions** menu at the top of the diagram and click **Generate HACCP Plan Report**.
4. Select a **Template** in the dialog and click **Generate**.

Vault may take a few minutes to generate your documents. When your documents are ready, Vault displays a message with a link to a binder containing the generated documents.

## Limitations {#limitations}

* Vault does not save updates to the HACCP Flow Diagram if you attempt to reposition more than 500 steps simultaneously.
* Record counts displayed in the _Information_ panel may not be accurate if a user does not have access to all records due to missing field-level [Atomic Security](/en/lr/47850/) permissions. 
* Vault cannot display the HACCP Flow Diagram for _HACCP Plans_ that exceed the following limits:
  * 1,500 total _HACCP Plan Process Steps_, _HACCP Plan Process Step Connections_, and _HACCP Plan Process Step Groups_
  * 2,000 _Process Hazard Analysis_, _HPPSG - HPPS_,  _HPPS - PHA_, _PHA - HHC_, or _HACCP Hazard Control_ records
* When generating [HACCP documents][7]:
  * Up to 100 ingredients can display on a single step
  * Document generation fails for diagrams with more than 2,000 _Ingredient Involved_ records combined across all steps
  * Document generation fails if the file size of the HACCP Flow Diagram downloadable rendition is larger than 50 MB

[1]: #legend
[2]: #view
[3]: #info-panel
[4]: #edit-steps
[5]: #symbols
[6]: #auto-number
[7]: #haccp-docs