| Quintiq file version 2.0 | 
| #parent: #root | 
| StaticMethod CanCreateDemoScenarios ( | 
|   ScenarioManager owner, | 
|   String democategory, | 
|   String demoscenarioname, | 
|   output String feedback_o | 
| ) as Boolean | 
| { | 
|   Description: 'This method checks whether demo scenarios to be created is within the max nr of online scenario limit' | 
|   TextBody: | 
|   [* | 
|     if( owner.IsSizingParameterOn() ) | 
|     { | 
|       resourcemanager := owner.ResourceManager_SM(); | 
|       nrofscenarios := 1; | 
|      | 
|       if( demoscenarioname = Translations::Scenario_DemoScenario_All() ) | 
|       { | 
|         demoscenarios := owner.GetDemoScenario( democategory ); | 
|         nrofscenarios := demoscenarios.Tokenize( ';' ).Size() - 1; | 
|       } | 
|        | 
|       activeScenario := selectset( owner, ScenarioMP, scenario, true, scenario.IsLoaded() or scenario.IsLoadingInProgress() ); | 
|       selectedInactiveScenario :=  nrofscenarios; | 
|        | 
|       if ( activeScenario.Size() + selectedInactiveScenario > resourcemanager.MaxNrOfOnlineScenario() ) | 
|       { | 
|         feedback_o := Translations::Scenario_CanCreateDemoScenarios( resourcemanager.MaxNrOfOnlineScenario() ) | 
|       } | 
|        | 
|     } | 
|      | 
|     return feedback_o = ''; | 
|   *] | 
| } |