| Quintiq file version 2.0 | 
| #parent: #root | 
| StaticMethod CanAddStockingPoint ( | 
|   output String feedback_o, | 
|   StockingPoint_MPs stockingpoints, | 
|   Lane lane, | 
|   Boolean isorigin | 
| ) declarative remote as Boolean | 
| { | 
|   Description: 'Indicates if the stocking point(s) can be added to the lane.' | 
|   TextBody: | 
|   [* | 
|     isvalid := true; | 
|      | 
|     // Check if any of the selected stocking point(s) is already added to the specific lane | 
|     traverse( stockingpoints, Elements, stockingpoint ) | 
|     { | 
|       // Check if the stocking point(s) can be added as origin of the lane | 
|       if( isorigin ) | 
|       { | 
|         if( exists( lane, Origin.StockingPoint_MP, sp, sp = stockingpoint ) ) | 
|         { | 
|           isvalid := false; | 
|           feedback_o := Translations::MP_StockingPointInLane_CanAdd(); | 
|         } | 
|       } | 
|       // Check if the stocking point(s) can be added as destination of the lane | 
|       else  | 
|       { | 
|         if( exists( lane, Destination.StockingPoint_MP, sp, sp = stockingpoint ) ) | 
|         { | 
|           isvalid := false; | 
|           feedback_o := Translations::MP_StockingPointInLane_CanAdd(); | 
|         } | 
|       } | 
|     } | 
|      | 
|     return isvalid; | 
|   *] | 
| } |