# Recipe Validation ## Overview MES shall block, at interlocking, any Panel whose Product is different than the one the Equipment is configured to produce. ### Relevant Artifacts The table below describes the objects for this feature: | Name | Type | Is Mandatory | Data Type | Description | | --------------------- | ---------- | ------------ | ----------------------------------------------------------------------------- | -------------------------------- | | IoTMetadataDefinition | SmartTable | Yes | | Table to define setup parameters | | RecipeContext | SmartTable | Yes | Table to define the Recipe to be used at a given Resource context and Product | | ### How it works - Set `UseRecipeNameValidation` key in the `IoTMetadataDefinition` table to `True` to activate the Feature. - `UseUpdateRecipeByLane` if set with value **true** we will validate for the Conveyor Lane received in the event. - `UseRecipeFullPathAsRecipeName` if set the Recipe Full Path will be used as MES Recipe name, as received from event `RecipeDownload` or the response from `GetRecipeForStation` command. !!! Note "Recipe Name example" ``` json "RecipeName": "01234564567-0123_T", "RecipeFullPath": "Line1\\01234564567-0123_T", ``` - Configure the Recipes for each possible product in the `RecipeContext` table. When receiving a BoardRequest message, the panel product is used to query `RecipeContext` table and get the Recipe defined for that product. This recipe is then compared with the actual Equipment recipe. If successful: ![RecipeValidation Ok](./images/recipe/oib_recipevalidation_ok.png) If it is not possible to resolve the Product panel in the `RecipeContext` table (e.g. missing entry for that Product): ![RecipeValidation Error](./images/recipe/oib_recipevalidation_recipeerror.png) If the RecipeContext table references a different Recipe for the panel product: ![RecipeValidation Error](./images/recipe/oib_recipevalidation_materialmismatch.png) !!! note "Dual-Lane Equipments" For dual-lane equipments using different recipes per lane, set `useUpdateRecipeByLane` key to `True`. This way, both the Panel lane and the Recipe lane will be considered during comparison. Otherwise, the last RecipeDownload recipe context will be used or, if not available, the recipe sent by the Equipment (at GetRecipeForStation request) will be used for the comparison. ### Example Conditions RecipeContext table: ![RecipeContext](./images/recipe/oib_recipecontext.png) Siplace Console: ![Siplace](./images/recipe/oib_recipevalidation_siplace.png) ### Persistency Handling After the first successful validation of the Recipe, a key named **RecipeValidated_<Resource Name>_Lane_<Lane number>** will be stored in persistency with the value `true`. This allows subsequent requests to bypass validation until a new recipe is downloaded to the equipment.