hongji.li
2023-11-07 192c736b8ac4b2d84cb823ac71f17e507948a5e8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Quintiq file version 2.0
#parent: #root
Method SelectScenario (
  Scenario scenario
) as Boolean id:Method_ApplicationLibMacroPlanner_SelectScenario
{
  #keys: '[11660.0.683114355]'
  Body:
  [*
    // Select the active MacroPlan based on passed in scenario
    // Set active MacroPlan to the application
    // ComponentMDS::Create( Application ) is not available in Editor -- still finding, if exist, all this code will be moved.
    status := false;
    
    if( not isnull( scenario ) )
    {
      editor := ExternalMDSEditor::Editor();
      allinfo := editor.ObjectInfos();
    
      mdsInfo := select ( allinfo, Elements, oinfo,
                          oinfo.MDSID().MDSKey() = scenario.DatasetMDSID()
                          or oinfo.Name() = scenario.DatasetName());
    
    
      if( not mdsInfo.IsLoaded() )
      {
        scenario.SetAvailable( '' );
      }
    
      status := this.SelectScenarioReadOnly( scenario );
    }
    
    return status;
  *]
}