Events scripts

Event scripts are triggered by certain activities during a simulation run. They are accessed at any time the event occurs. It is up to you to decide in code if there are other conditions (location of the event, timing of the event, cause of the event) that determine whether to continue processing the script. Event scripts give you the opportunity to review the state of certain attributes in the model or to set attributes based on conditions, although no action is required.

For example, the On Shipment Arrival event is triggered for any shipment that arrives at a site or a customer. You may only be interested in arrivals at customers, or even a subset of customers. The script is triggered regardless of arrival location so your first few lines of code should check the type of the arrival location and exit if the arrival location is not a customer type.

Model.OnSimulationBegin/End Event

This event script is triggered at the very beginning and very end of a simulation run. Typical uses include looping through all the sites in a model to set a particular attribute, initializing the data in a global array, and reporting certain information at the end of a simulation run that may not be captured by the standard output. There is no expected return from the script.

Sites.OnReceiveOrderBegin/End Event

This event script is triggered any time a site receives an order for product after being chosen as the source. This can come from downstream customers through demand or downstream sites through replenishment calls, as well as from pushed shipments in the Shipments table. The Begin event triggers when the order initially arrives. The End event triggers after the source site inventory review of the product on order and various statistics are calculated. There is no expected return from the script.

Attributes: (<Order Object> object, <Site Object> object, <Site Object> object OR <Customer Object> object)

Returns the order that triggered the event, the site chosen to fulfill the order and the site or customer that created the order.

Sites.OnReceiveShipmentBegin/End Event

This event script is triggered any time a site receives a shipment. The Begin event triggers when the shipment initially arrives. The End event triggers after completing the receive action and various statistics are calculated. If there are multiple items on a shipment, this event will trigger for each shipping item. There is no expected return from the script.

Attributes: (<ShippingItem Object> object, <Site Object> object, <Site Object> object)

Returns shipping item, the source of the shipment and the customer destination.

Customers.OnReceiveShipmentBegin/End Event

This event script is triggered any time a customer receives a shipment. The Begin event triggers when the shipment initially arrives. The End event triggers after completing the receive action and various statistics are calculated. If there are multiple items on a shipment, this event will trigger for each shipping item. There is no expected return from the script.

Attributes: (<ShippingItem Object> object, <Site Object> object, <Customer Object> object)

Returns shipping item received, the source of the shipment and the customer destination.

Lanes.OnShipmentDeparture Event

This event script is triggered any time a shipment departs a source on a lane. By examining attributes of the returned objects, you can determine products and quantities on the shipment, the source, the destination, etc. There is no expected return from the script.

Attributes: (<Shipment Object> object, <TransportationMode Object> object)

Returns the shipment and transportation mode of the shipment.

Lanes.OnShipmentArrival Event

This event script is triggered any time a shipment arrives at a destination, whether site or customer. By examining attributes of the returned objects, you can determine products and quantities on the shipment, the source, the destination, etc. There is no expected return from the script.

Attributes: (<Shipment Object> object, <TransportationMode Object> object)

Returns the shipment and transportation mode of the shipment.

Lanes.OnShipmentLoadBegin/End Event

This event script is triggered any time a shipment is loaded at a site. The Begin event occurs as the shipment begins loading. The End event occurs after the shipment load time expires and various statistics have been calculated. By examining attributes of the returned objects, you can determine products and quantities on the shipment, the source, the destination, etc. There is no expected return from the script.

Attributes: (<Shipment Object> object, <TransportationMode Object> object)

Returns the shipment and transportation mode of the shipment.

Lanes.OnShipmentUnloadBegin/End Event

This event script is triggered any time a shipment is unloaded at a site or customer. The Begin event occurs as the shipment begins unload. The End event occurs after the shipment unload time expires and various statistics have been calculated. By examining attributes of the returned objects, you can determine products and quantities on the shipment, the source, the destination, etc. There is no expected return from the script.

Attributes: (<Shipment Object> object, <TransportationMode Object> object)

Returns the shipment and transportation mode of the shipment.

Asset OnAvailable Event

This event script is triggered when an asset with a defined On Available event changes state to Available. You can apply an Asset OnAvailable event to an asset in the On Available Event Handler field in the Transportation Assets table. There is no expected return from the script.

Arguments: (<Asset Object> object, <AssetUnit Object> object, <SiteLocation Object> object)

Returns the current asset, asset unit and current location of the asset unit under review.

Process Complete

This event script is triggered when a process completes. There is no expected return.

Arguments: (<Site Object> object, <Product Object>object, <ProcessLot Object> object)

Process Step Enter

This event script is triggered upon entering a process step. It executes prior to any logic happening at the step itself. There is no expected return.

Arguments: (<Site Object> object, <Product Object>object, <ProcessLot Object>object, <WorkStep Object> object)

Process Step Exit

This event script is triggered upon exiting a process step. It executes after all logic within the step is completed. There is no expected return.

Arguments: (<Site Object> object, <Product Object>object, <ProcessLot Object> object, <WorkStep Object> object)

Last modified: Wednesday May 15, 2024

Is this useful?