# Recipe Management ## Overview The `EquipmentRecipeReady` event is triggered when CAMX equipment notifies that a recipe is ready for production. The integration automatically processes this event through the `EquipmentRecipeReady` automation workflow, which coordinates recipe processing through the `doRecipe` subworkflow. ### Message Fields | Field | Type | Description | |-------|------|-------------| | recipeId | String | Unique recipe identifier from equipment | | laneList | String | Comma-separated list of active lanes (e.g. "1-3,5,8-10") | | zoneList | String | Comma-separated list of active zones (e.g. "1-7") | | Extensions | Object | Optional custom data provided by equipment | ### Workflow Processing ```text Equipment sends recipe ready notification ↓ equipmentEvent task → Parse recipeId, laneList, zoneList ↓ doRecipe subworkflow → Recipe processing and validation ↓ IoTCreateNewRecipe DEE → Create/update recipe in MES ↓ Result logging ``` ### Detailed Steps 1. **Equipment sends recipe ready notification** with recipeId, lanes, and zones 2. **Controller receives via HTTP broker** 3. **equipmentEvent task** extracts recipe parameters 4. **doRecipe subworkflow** invoked with: - recipeId (recipe identifier) - laneList (lanes to activate) - zoneList (zones to activate) - Extensions (optional custom data) 5. **Recipe validation** ensures parameters are valid 6. **DEE invocation** (if configured) processes recipe with business logic 7. **Result logging** records recipe processing completion ### Configuration For state change processing, configure the following: #### 1. Feature Flag in `IoTMetadataDefinition` | Configuration Key | Type | Description | | ----------------------------- | ---- | ------------------------------------------------------------------ | | useCAMXToChangeRecipe | String | Enable recipe management processing, set to "EquipmentRecipeReady" to enable | !!! Warning "Resource Instantiation" An instantiated **MES resource** is required to properly assign the properties to it !!! info "EquipmentRecipeReady events trigger the `doRecipe` subworkflow which handles recipe creation and validation in MES." --- #### DEE Input Parameters When `EquipmentRecipeReady` is processed, the configured DEE expects: | Input | Source | Example Value | Description | |-------|--------|----------------|-------------| | ResourceName | Automation context | "SMT_SPI_1" | MES resource processing the event | | ResourceLane | Automation context | "LANE-01" | MES resource processing the event | | RecipeName | Equipment message | "recipe01" | Recipe identifier (recipeId) | | ResourceRecipeName | Equipment message | "recipe01" | Recipe Identifier (recipeId) | #### Expected DEE Output The DEE should return results indicating processing status: | Output | Type | Expected Values | Description | |--------|------|-----------------|-------------| | Result | Boolean/String | true, false, "Success", "Error" | Operation success indicator | | Message | String | Any | Error/status description | !!! note "Result Interpretation" - `Result = true` or `Result = "Success"`: Event processed successfully - `Result = false` or `Result = "Error"`: Processing failed, may trigger retry - Missing/null Result: Treated as processing error ### Troubleshooting #### Recipe Ready Events Not Processed Equipment sends EquipmentRecipeReady but no recipe appears in MES - Check controller logs for message reception: search for "EquipmentRecipeReady" - Verify recipe parameters (recipeId, laneList, zoneList) are valid and not empty - Confirm MES resource is configured to accept recipes #### Recipe Validation Failures Recipe processing fails with validation error - Verify recipeId is unique and properly formatted - Check laneList and zoneList are semicolon-separated and not empty - Confirm lanes referenced in message exist in equipment configuration #### Recipe Processing Errors Recipe created but DEE processing fails - Verify DEE for recipe processing is configured and available - Check DEE input parameters match expected format - Review MES service logs for business logic errors #### Message Reception Issues Recipe ready messages not received by controller - Verify broker connectivity and message queuing - Check broker logs for message delivery - Confirm equipment is sending messages to correct broker URL - Verify message schema