Quintiq file version 2.0 
 | 
#parent: #root 
 | 
StaticMethod CanCreate ( 
 | 
  ProductInStockingPointInPeriods pispips, 
 | 
  output String feedback_o, 
 | 
  output String sanitycheckfeedback_o 
 | 
) declarative remote as Boolean 
 | 
{ 
 | 
  Description: 'Given PISPIP return true if the PISPIP have a valid leg to create trip.' 
 | 
  TextBody: 
 | 
  [* 
 | 
    // desmondt May-14-2015 (created) 
 | 
     
 | 
    cancreate := true 
 | 
     
 | 
    traverse( pispips, Elements, pispip, cancreate ) 
 | 
    { 
 | 
      cancreate := pispip.ProductInStockingPoint_MP().GetIsTransportedByLaneLeg(); 
 | 
     
 | 
      if( not cancreate ) 
 | 
      { 
 | 
        pispname := MacroPlan::GetSubstituteName( pispip.ProductInStockingPoint_MP().Name() ); 
 | 
        feedback_o := Translations::MP_Trip_CanCreate_IsNullLaneLeg( pispname ); 
 | 
      } 
 | 
      else 
 | 
      { 
 | 
        laneleg := select( pispip, ProductInStockingPoint_MP.LaneLegOutput.LaneLeg, leg, leg.GetIsEnabled() ); 
 | 
        cancreate := Trip::ValidateInput( feedback_o, sanitycheckfeedback_o, laneleg, pispip.Period_MP() ); 
 | 
      } 
 | 
    } 
 | 
     
 | 
    return cancreate; 
 | 
  *] 
 | 
} 
 |