Skip to content

Event Handling#

Overview#

CAMX integration processes equipment events received through the IPC-2501 MIME message format over an HTTP broker. The controller automatically routes each event type to a dedicated automation workflow that coordinates DEE (Dynamic Execution Engine) actions and MES integration.

Supported Events:#

  • ItemTransferIn — Material enters equipment
  • ItemTransferOut — Material exits equipment
  • EquipmentChangeState — Equipment state transition, see Equipment State Change
  • EquipmentRecipeReady — Recipe ready for production, see Recipe Management

Event Processing Flow#

General Workflow Pattern#

All CAMX events follow a similar processing pattern:

Equipment sends message via HTTP broker
    ↓
CAMX driver polls GetMessage
    ↓
Driver receives MIME-formatted message
    ↓
Driver sends Acknowledge to broker
    ↓
Event type identified from message schema
    ↓
EquipmentEvent task extracts event properties
    ↓
Retrieve task gets resource context (ResourceName)
    ↓
Event-specific processing
    ↓
Custom DEE invoked (if configured)
    ↓
Result handling and logging
    ↓
Workflow completes

ItemTransferIn Event#

Overview#

Material transfer events (ItemTransferIn and ItemTransferOut) are triggered when material moves in or out of equipment. Both events are processed through dedicated workflows and invoke custom DEE (Dynamic Execution Engine) actions for business logic processing.

CAMX controller does NOT automatically track materials in/out of MES. The responsibility of material tracking is delegated entirely to the configured DEE. This allows flexible integration with custom business logic without enforcing a specific tracking model.

Configuration#

To enable custom DEE processing for ItemTransferIn events:

Feature Flags in IoTMetadataDefinition#

Configuration Key Type Value Description
CAMX_ItemTransferIn_useDEE String CustomComplexTrackIn DEE name to invoke for ItemTransferIn events (required to enable processing)
CAMX_ItemTransferIn_retries Integer 3 Max retry attempts for ItemTransferIn (default: 1)

DEE is Required

If CAMX_ItemTransferIn_useDEE is not configured, the ItemTransferIn event is logged but NOT processed. The DEE name must be explicitly configured for event processing to occur.


ItemTransferOut Event#

Overview#

ItemTransferOut is triggered when material exits equipment and follows the same processing pattern as ItemTransferIn.

Configuration#

To enable custom DEE processing for ItemTransferOut events:

Feature Flags in IoTMetadataDefinition#

Configuration Key Type Value Description
CAMX_ItemTransferOut_useDEE String CustomComplexTrackOut DEE name to invoke for ItemTransferOut events (required to enable processing)
CAMX_ItemTransferOut_retries Integer Max retry attempts for ItemTransferOut (default: 1)

DEE is Required

If CAMX_ItemTransferOut_useDEE is not configured, the ItemTransferIn event is logged but NOT processed. The DEE name must be explicitly configured for event processing to occur.

Message Fields#

Field Type Description
itemInstanceId String Material identifier
laneId String Equipment lane/position
Extensions Object Optional custom data from equipment

Integration#

Workflow Processing#

Material entering equipment flows through:

Equipment Event (ItemTransferIn/ItemTransferOut)
    ↓
EquipmentEvent task → Parse itemInstanceId, laneId, Extensions
    ↓
doCommonLogic subworkflow → Execute custom DEE
    ↓
Result handling → Log success or error

Detailed Steps#

  1. Message Reception: CAMX driver receives ItemTransferIn message from broker
  2. Property Extraction: equipmentEvent task extracts:
  3. itemInstanceId: Material identifier
  4. laneId: Equipment lane/position
  5. Extensions: Optional custom data
  6. Resource Resolution: retrieve task retrieves ResourceName from context
  7. Configuration Check: codeExecution task:
  8. Validates itemInstanceId is not null/empty
  9. Checks CAMX_ItemTransferIn_useDEE or CAMX_ItemTransferOut_useDEE configuration
  10. Extracts DEE name and retry settings
  11. DEE Invocation: doCommonLogic subworkflow calls the configured custom DEE with:
  12. ResourceName: MES resource name
  13. Content: itemInstanceId (material identifier)
  14. EventType: "ItemTransferIn"
  15. Attributes: Additional material properties (laneId, etc.)
  16. Extensions: Custom data from equipment
  17. Error Handling: If DEE fails:
  18. Retriable errors (deadlock, data changed): Retry up to configured attempts
  19. Non-retriable errors (validation, permission): Fail immediately
  20. Result Logging: Workflow logs completion status

DEE Input Parameters#

When ItemTransferIn or ItemTransferOut is processed, the configured DEE expects:

Input Source Example Value Description
ResourceName Automation context "SMT_SPI_1" MES resource processing the event
Content Equipment message "PANEL-001" Material identifier (itemInstanceId)
EventType Equipment event type "ItemTransferIn/Out" Type of transfer event
Attributes Parsed event data { laneId: "Lane-1" } Material attributes from event
Extensions Equipment extension data { "recipe": "recipe01" } Custom data within the event

Attributes is a property containing all event attributes

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

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

Error Handling#

Retriable Errors#

These errors trigger automatic retry (up to configured max retries):

Error Type Cause
Deadlock Database concurrency conflict
Data Changed Referenced object modified
MES Bug Service returned unexpected error
Host Down Temporary service unavailability

Non-Retriable Errors#

These errors fail immediately without retry:

Error Type Cause
Validation Failed null/empty itemInstanceId
DEE Not Found Configured DEE doesn't exist
Resource Not Found LinkedEntityName missing

Error Logging#

  • EventType: ItemTransferIn
  • itemInstanceId: Material identifier
  • ResourceName: MES resource
  • Error Details: Error message and cause
  • Retry Count: Number of attempts (if retriable error)
  • Timestamp: When error occurred

Troubleshooting#

Material Transfer Events Not Processed#

Equipment sends ItemTransferIn but no DEE invocation occurs

Root Causes and Solutions:

  1. DEE Configuration Missing
  2. Verify CAMX_ItemTransferIn_useDEE is configured
  3. Check value is not empty/null
  4. Restart Automation Controller after adding configuration

  5. Resource Name Mismatch

  6. Verify resource linked to controller matches IoTMetadataDefinition resource

  7. DEE Not Found

  8. Verify DEE exists in MES with exact name from configuration
  9. Check DEE name spelling and case sensitivity
  10. Confirm DEE is published and available

DEE Processing Fails#

DEE called but returns error

Diagnosis and Resolution:

  1. Check Error Type
  2. Look in controller logs for error classification (retriable vs non-retriable)
  3. Retriable errors show "Retrying..." messages
  4. Non-retriable errors show "Failed without retry"

  5. For Retriable Errors

  6. Review MES system logs for deadlocks/data conflicts
  7. Check database concurrency issues
  8. May retry automatically up to configured max attempts

  9. For Non-Retriable Errors

  10. Check DEE implementation for validation errors

Configuration Not Taking Effect#

Configuration changes made but DEE not invoked

Solutions:

  1. Restart Controller - Configuration cache refreshed on startup
  2. Verify configuration saved to IoTMetadataDefinition table
  3. Check resource name matches exactly (case sensitive)
  4. Confirm value field is not empty (must contain DEE name)

Need to process another event?

doCommonLogic is a generic dispatcher — the same one described for ItemTransferIn/ItemTransferOut. The driver can also handle additional standard events that aren't wired to an MES workflow yet. See Controller Extensibility to connect any of them to doCommonLogic without further development.