--- alias: user-guide-automation-task-mes-materialtrackinrequest tags: - automation tasks description: "Trigger task that listens for Material Track In requests from the MES and starts the equipment-side handling for the operation" --- # On Material Track In Request :iot-system-event-lg: This **trigger** task listens for Material Track In requests coming from the MES and lets a workflow perform the equipment-side handling when an operator tracks a **Material** in at a **Resource**. It belongs to the `System / MES` category, under `Triggers`, and is available in both Data Flow and Control Flow workflows. In a Control Flow workflow it appears as a `Start` trigger named `When a Resource performs Material Track In`. ![On Material Track In Request - Data Flow Task](./images/on_material_track_in_request-task.png) ## Details | Fields | Details | | ----------------- | ---------------------------------------------------------------------------------- | | Scope | Connect IoT
Data Platform
Enterprise Integration
Factory Automation | | Workflow | Data flow
Control flow | | `IsProtocol` flag | :material-close:{style="color:#EF5350"} | ## Behavior When an operator performs [[user-guide-track-in-material]], the MES sends a request on the `ConnectIoT.TrackIn.RequestReply` subject and waits for a reply. This task receives that request, emits the `resource` and the `material` involved in the operation, and emits `Success`. The MES sends the request only when the **Resource** involved in the operation has the Enable Automation Scenarios and Material Track-In Interlocking properties enabled. The request is handled by the Automation Controller instance associated with the Resource or, when defined, with its Automation Scenarios Owner Entity. The MES stays blocked until a reply is sent. If none is sent within the `Reply Timeout`, the task emits `Error` and the track in fails on the MES side. The reply is produced differently depending on the workflow type: - **Control Flow** - the reply is the result of the trigger's handler branch. - **Data Flow** - a downstream [Send Material Track In Reply](task_material_track_in_reply.md) task sends the reply. ## Inputs | Name | Data Type | Description | | -------------- | --------- | ---------------------------------------------------------------------------------------------------------------------- | | Enable/Disable | `Boolean` | Enables (`true`) or disables (`false`) the message listener at runtime. Works together with the `Auto Enable` setting. | Table: On Material Track In Request task inputs ## Outputs | Name | Data Type | Description | | ------------ | ------------ | ------------------------------------------------------ | | resource | `Resource` | The Resource where the operation is being performed. | | material | `Material` | The Material being tracked in. | | Success | `Boolean` | Triggered when a request is received and processed. | | Error | `Error` | Triggered when the task fails or the reply times out. | Table: On Material Track In Request task outputs ## Settings On the `General` tab, you have the usual settings and the following settings: | Name | Data Type | Values | Default | Description | | ------------------------ | --------- | ------ | ------------------------------ | ----------------------------------------------------------------------------------------------- | | Auto Enable | `Boolean` | | `true` | Automatically enables the message listener when the task starts. | | Reply Timeout | `Integer` | ms | `60000` | Amount of time allowed to wait for a reply before issuing a timeout. This setting is mandatory. | | Material Track In Request Subject | `String` | | `ConnectIoT.TrackIn.RequestReply` | Subject used to communicate with the MES. This setting is read-only. | Table: On Material Track In Request task settings ![Settings Wizard for On Material Track In Request Task](./images/on_material_track_in_request-task_settings.png) ## Remarks This task pairs with the [Send Material Track In Reply](task_material_track_in_reply.md) task, which sends the reply back to the originating request. This task uses a specific structure of context-based data called `zone`. More information on this topic can be read in the [Zones](../zones.md) page.