.. _hunt_group_management_workflows:

Hunt Group Management Workflows
-------------------------------

.. _19.1.1|EKB-943:

When adding a new hunt group, the following workflow is executed:

* A hunt list is added with the details input by the user.
* A hunt pilot is added with the details input by the user.
* One or more line groups are created with the specified directory
  numbers as members.

When modifying a hunt group, the following workflow is executed (depending
on what was modified):

* The line group details are modified.
* Added line groups are added.
  
  A removed line group is deleted *only* if it is the last instance. If a shared
  line group is removed, it is deleted from the specified hunt group *only*, but
  is still included in other hunt groups that are also using it. 

  If the hunt group uses existing line groups, then the existing line groups are
  updated when the hunt group is modified.
* The hunt list is modified.
* The hunt pilot is modified.

When deleting a hunt group, the following workflow is executed:

* The line groups that are members of the hunt list are deleted (if they
  are not used by any other hunt group in the system).
  
  If a shared line group is removed, it is deleted from the specified hunt group
  *only*, but is still included in other hunt groups that are also using it.
* The hunt pilot is deleted.
* The hunt list is deleted.