lazhen
2025-01-09 8afe90b633046db39042aada36b88193062f8cff
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
Quintiq file version 2.0
#parent: #root
Method LoadDatasetSnapshotReplannable (
  LibOpt_SnapshotReplannableCopyDataset snapshot
) id:Method_LibOpt_GlobalState_LoadDatasetSnapshotReplannable
{
  #keys: '[141860.2.526521079]'
  Body:
  [*
    // Loads the dataset that is attached to the LibOpt_SnapshotReplannableCopyDataset. 
    
    editor := ExternalMDSEditor::Editor();
    infos := editor.ObjectInfos();
    datasetinfo := infos.Find( snapshot.DatasetName() );
    
    if( not isnull( datasetinfo ) )
    {
      LibOpt_GlobalState.LoadDataset( datasetinfo );
      snapshot.IsDatasetLoaded( true );
    }
    else
    {
      // The dataset that is attached to the replannable snapshot is already deleted. 
      // The below method will update all LibOpt_SnapshotReplannableCopyDataset snapshots to prevent further mismatches and show a warning to explain this to the AE. 
      LibOpt_GlobalState.LoadDatasetSnapshotReplannableAlreadyDeleted( snapshot )
    }
  *]
}