Shipment/EventListener/AbstractShipmentItemListener.php
public function onInsert(ResourceEventInterface $event)
    {
        $item = $this->getShipmentItemFromEvent($event);
        $shipment = $item->getShipment();

        $this->scheduleShipmentContentChangeEvent($shipment);

        // If shipment state is stockable
        if (Model\ShipmentStates::isStockableState($shipment->getState())) {
            // Assign shipment item to stock units
            $this->stockUnitAssigner->assignShipmentItem($item);
        }
    }
public function onInsert(ResourceEventInterface $event)
    {
        $item = $this->getShipmentItemFromEvent($event);
        $shipment = $item->getShipment();

        $this->scheduleShipmentContentChangeEvent($shipment);

        // If shipment state is stockable
        if (Model\ShipmentStates::isStockableState($shipment->getState())) {
            // Assign shipment item to stock units
            $this->stockUnitAssigner->assignShipmentItem($item);
        }
    }
Insert event handler.

@param ResourceEventInterface $event