| Quintiq file version 2.0 | 
| #parent: #root | 
| StaticMethod ValidateInput ( | 
|   String name, | 
|   ScenarioManager sm, | 
|   Strategy strategy, | 
|   Real massscalingfactor, | 
|   Real monetaryscalingfactor, | 
|   Real timescalingfactor, | 
|   Real timeaccountscalingfactor, | 
|   Real inventoryholdingscalingfactor, | 
|   Number defaultnumberofperiodsavgdemand, | 
|   Number numberofperiodssmartplan, | 
|   Boolean isslidinghorizon, | 
|   Number numberofperiodsinwindow, | 
|   Number numberofperiodsperslide, | 
|   Boolean ismetaoptimizer, | 
|   Boolean isfirstleveloverride, | 
|   Boolean islastleveloverride, | 
|   Number firstfocuslevel, | 
|   Number lastfocuslevel, | 
|   Number maxtimealliterations, | 
|   Number maxnumberelecampaigncombi, | 
|   Boolean iscollapse, | 
|   Real collapselevelweight | 
| ) declarative remote as String | 
| { | 
|   Description: 'Called by designer' | 
|   TextBody: | 
|   [* | 
|     // Validate input for Strategy | 
|     feedback := ''; | 
|      | 
|     // Check if name is entered | 
|     if( name = '' ) | 
|     { | 
|       feedback := Translations::Strategy_ValidateInput_IsNameEmpty(); | 
|     } | 
|     // Check if the name is unique | 
|     else if( exists( sm, Strategy, s, | 
|                      s <> strategy and s.Name() = name ) ) | 
|     { | 
|       feedback := Translations::Strategy_ValidateInput_IsNameExists( name ); | 
|     } | 
|     // Check if mass scaling factor not less than zero | 
|     else if( massscalingfactor <= 0.0 ) | 
|     { | 
|       feedback := Translations::Strategy_ValidateInput_InvalidMassScalingFactor(); | 
|     } | 
|     // Check if monetory scaling factor not less than zero | 
|     else if( monetaryscalingfactor <= 0.0 ) | 
|     { | 
|       feedback := Translations::Strategy_ValidateInput_InvalidMonetaryScalingFactor(); | 
|     } | 
|     // Check if time scaling factor not less than zero | 
|     else if( timescalingfactor <= 0.0 ) | 
|     { | 
|       feedback := Translations::Strategy_ValidateInput_InvalidTimeScalingFactor(); | 
|     } | 
|     // Check if time account scaling factor not less than zero | 
|     else if( timeaccountscalingfactor <= 0.0 ) | 
|     { | 
|       feedback := Translations::Strategy_ValidateInput_InvalidTimeAccountScalingFactor(); | 
|     } | 
|     // Check if inventory holding scaling factor not less than zero | 
|     else if( inventoryholdingscalingfactor <= 0.0 ) | 
|     { | 
|       feedback := Translations::Strategy_ValidateInput_InvalidInventoryHoldingScalingFactor(); | 
|     } | 
|     //default number of periods average demand | 
|     else if( defaultnumberofperiodsavgdemand <= 0 ) | 
|     { | 
|       feedback := Translations::MP_GlobalParameters_MP_ValidateInput_InvalidNumberOfPeriodsForAvgSD( defaultnumberofperiodsavgdemand ); | 
|     } | 
|     else if( numberofperiodssmartplan <= 0 ) | 
|     { | 
|       feedback := Translations::MP_GlobalParameters_MP_ValidateInput_InsufficientPeriods( numberofperiodssmartplan ); | 
|     } | 
|     else if( isslidinghorizon and numberofperiodsinwindow <= 0 ) | 
|     { | 
|       feedback := Translations::MP_GlobalParameters_MP_ValidateInput_InsufficientPeriodsInWindow( numberofperiodsinwindow ); | 
|     } | 
|     else if( isslidinghorizon and numberofperiodsperslide <= 0 ) | 
|     { | 
|       feedback := Translations::MP_GlobalParameters_MP_ValidateInput_InsufficientPeriodsPerSlide( numberofperiodsperslide ); | 
|     } | 
|     else if( isslidinghorizon and numberofperiodsinwindow < numberofperiodsperslide ) | 
|     { | 
|       feedback := Translations::MP_GlobalParameters_MP_ValidateInput_TooManyPeriodsInSlide( numberofperiodsinwindow, numberofperiodsperslide ); | 
|     } | 
|     // Check MetaOptimizer inputs | 
|      | 
|     // Check if first level focus is not less than 0 | 
|     if( ismetaoptimizer and isfirstleveloverride and firstfocuslevel < 0.0 ) | 
|     { | 
|       feedback := ifexpr( firstfocuslevel.IsFinite(), | 
|                           Translations::Strategy_ValidateInput_InvalidFirstFocusLevel( firstfocuslevel ), | 
|                           Translations::Strategy_ValidateInput_IsEmptyInput( Translations::Strategy_Input_FirstFocusLevel() ) ); | 
|     } | 
|      | 
|     // Check if first level focus is not less than 1 | 
|     else if( ismetaoptimizer and islastleveloverride and lastfocuslevel <= 0.0 ) | 
|     { | 
|       feedback := ifexpr( lastfocuslevel.IsFinite(), | 
|                           Translations::Strategy_ValidateInput_InvalidLastFocusLevel( lastfocuslevel ), | 
|                           Translations::Strategy_ValidateInput_IsEmptyInput( Translations::Strategy_Input_LastFocusLevel() ) ); | 
|     } | 
|      | 
|     // Check if first level focus > last level focus | 
|     else if( ismetaoptimizer and isfirstleveloverride and islastleveloverride and firstfocuslevel > lastfocuslevel ) | 
|     { | 
|       feedback := Translations::Strategy_ValidateInput_InvalidLastFocusLevelGreaterThanFirstFocusLevel( firstfocuslevel, lastfocuslevel ); | 
|     } | 
|      | 
|     // Check if maximum time for all iterations is not less than 1 | 
|     else if( ismetaoptimizer and maxtimealliterations <= 0.0 ) | 
|     { | 
|       feedback := ifexpr( maxtimealliterations.IsFinite(), | 
|                           Translations::Strategy_ValidateInput_InvalidMaximumTimeAllIterations( maxtimealliterations ), | 
|                           Translations::Strategy_ValidateInput_IsEmptyInput( Translations::Strategy_Input_MaximumTimeAllIterations() ) ); | 
|     } | 
|     else if ( ismetaoptimizer and iscollapse and collapselevelweight <= 0.0 )  | 
|     { | 
|       feedback := ifexpr( collapselevelweight.IsFinite(),  | 
|                           Translations::Strategy_ValidateInput_InvalidCollapseLevelWeight( collapselevelweight ),  | 
|                           Translations::Strategy_ValidateInput_IsEmptyInput( Translations::Strategy_Input_CollapseWeight() ) );  | 
|                             | 
|     } | 
|      | 
|     // Check if maximum number of elements in campaign combi is not less than 1 | 
|     else if( maxnumberelecampaigncombi <= 0.0 ) | 
|     { | 
|       feedback := ifexpr( maxnumberelecampaigncombi.IsFinite(), | 
|                           Translations::Strategy_ValidateInput_InvalidMaximumNumberElementsCampaignCombi( maxnumberelecampaigncombi ), | 
|                           Translations::Strategy_ValidateInput_IsEmptyInput( Translations::Strategy_Input_MaximumNumberOfElementInCampaignCombi() ) ); | 
|     } | 
|      | 
|     return feedback; | 
|   *] | 
| } |