CommodityEvent
Introduction
CommodityEvent is a bridge entity that associates tracking events with individual commodities. While tracking events are typically linked at the order level, CommodityEvent enables granular tracking at the commodity (freight item) level, which is essential for scenarios where individual items in a shipment have different tracking histories.
Entity Structure
Properties
| Property Name | Type | Required | Description |
|---|---|---|---|
| CommodityEventId | int | Yes | Primary key |
| CommodityId | int | Yes | Foreign key to Commodity |
| TrackingEventId | int | Yes | Foreign key to TrackingEvent |
| Created | DateTime | Yes | Creation timestamp |
| CreatedBy | string | Yes | User who created the record |
| LastModified | DateTime | Yes | Last modification timestamp |
| LastModifiedBy | string | Yes | User who last modified |
Relationships
| Relationship | Type | Description |
|---|---|---|
| Commodity | Commodity | The commodity this event relates to |
| TrackingEvent | TrackingEvent | The associated tracking event |
Usage
CommodityEvent is used extensively in Flow workflows to evaluate commodity-level conditions:
aggregations:
- name: "hasCommodityEvent"
parameter: "eventCode"
expression: "any([Commodity.CommodityEvents], [each.TrackingEvent.EventDefinition.EventCode] = [eventCode])"