During the first stage of applying evidence changes, the evidence controller validates the pending evidence changes by following these steps:
- The evidence controller calls out to a hook which checks for evidence requirements at the case level such as the minimum set of evidence records that must exist for a case. This hook provides the ability to call custom validations that apply at the case level rather than at the evidence type level.
- The evidence controller then calls all validations associated with applying evidence changes for the specific evidence type.
- If any of the validations fail, an exception will be thrown and the user will be forced to make the appropriate updates before trying to apply the changes again.