Quintiq file version 2.0
#parent: #root
Response OnDrop (
  structured[UnitNode] information,
  StockingPoint_MP target
) id:Response_ListStockingPoint_OnDrop_430
{
  #keys: '[11660.0.261427217]'
  Body:
  [*
    // Dropping unit nodes on stocking point, assign the stocking point as output stocking point
    // #9446: Added CTRL modifier to link in reverse direction
    feedback := '';
    units := selectset( information, Elements.Unit, unit, true, true );
    
    if( dropaction.IsLink()
        and not target.CanLinkToUnits( feedback, units, false ) ) //if shift+control is hold and can unlink
    {
      target.RemoveAsOutputFromUnits( units );
    }
    else //this intends to link (shift+control is not hold)
    {
      target.LinkToUnits( units, dropaction.IsControl() );
    }
  *]
  DefinitionID: 'Responsedef_GUIComponent_OnDrop'
  Precondition:
  [*
    ret_value := true;
    
    if( not dropaction.IsLink() ) //if shift+control not hold, means linking and need to check preconditions
    {
      units := selectset( information, Elements.Unit, unit, true, true );
      ret_value := target.CanLinkToUnits( feedback, units, dropaction.IsControl() );
    }
    
    return ret_value;
  *]
}
