| Quintiq file version 2.0 | 
| #parent: #root | 
| StaticMethod ValidateInput ( | 
|   output String feedback_o, | 
|   PISPNodeInRouting pispnodeinrouting, | 
|   Boolean isinput, | 
|   Product_MP product, | 
|   StockingPoint_MP stockingpoint, | 
|   Operation operation | 
| ) declarative remote as Boolean | 
| { | 
|   Description: 'ValidateInput for PISPNodeInRouting' | 
|   TextBody: | 
|   [* | 
|     // Adhi Apr-8-2016 (created) | 
|     feedback_o := ''; | 
|      | 
|      | 
|     existsinoperation := exists( operation, OperationInputOutput, oio, | 
|                                  ifexpr( isinput, | 
|                                          guard( pispnodeinrouting.OperationInputForRCV() <> oio, true ) and oio.istype( OperationInput ), | 
|                                          guard( pispnodeinrouting.OperationOutputForRCV() <> oio, true ) and oio.istype( OperationOutput ) ), | 
|                                  guard( oio.ProductInStockingPoint_MP().StockingPoint_MP() = stockingpoint, false ) | 
|                                  and guard( oio.ProductInStockingPoint_MP().Product_MP() = product, false) ); | 
|      | 
|     // Existing operation BOM | 
|     existsinoperationbom := exists( pispnodeinrouting, OperationBOM.Operation.OperationBOM.PISPNodeInRouting, pispnir, | 
|                                     pispnir <> pispnodeinrouting | 
|                                     and ifexpr( isinput, | 
|                                                 isnull( pispnir.OperationOutputForRCV() ), | 
|                                                 isnull( pispnir.OperationInputForRCV() ) ), | 
|                                     pispnir.ProductInStockingPoint_MP().Product_MP() = product | 
|                                     and pispnir.ProductInStockingPoint_MP().StockingPoint_MP() = stockingpoint ); | 
|      | 
|     if( existsinoperationbom or existsinoperation ) | 
|     { | 
|       feedback_o := Translations::MP_PISPNodeInRouting_CanAssignToStockingPoint(); | 
|     } | 
|     // Null product | 
|     else if( isnull( product ) ) | 
|     { | 
|       feedback_o := Translations::MP_PISPNodeInRouting_ValidateInput_InvalidProduct(); | 
|     } | 
|     // Null stocking point | 
|     else if( isnull( stockingpoint ) and not isnull( pispnodeinrouting ) )  | 
|     { | 
|       feedback_o := Translations::MP_PISPNodeInRouting_ValidateInput_InvalidStockingPoint(); | 
|     } | 
|      | 
|     return feedback_o = ''; | 
|   *] | 
| } |