hongji.li
2023-11-03 aefafd2142478d4fb07d6b8b45c3047e247389e0
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Quintiq file version 2.0
#parent: #root
Method OnConstructed
{
  Description: 'On constructed of this dataset, this method will be called when the dataset is constructed and we are not running conversion'
  TextBody:
  [*
    // When a dataset is loaded, refresh the status of the scenari
    // associated with the dataset
    ScenarioManager::SetDatasetLoadedStatus( this.MDSID() );
    
    // DataExchangeFramework
    LibDEF_API::PlanningDatasetOnConstructed( this.MDSMacroPlan(), typeof( MacroPlan ).ShortName() );
    
    // Recreate wizard if we are doing conversion
    if( DMF_Utility::GetIsAutoConversion()
        and not isnull( this.WizardManager() ) )
    {
      this.CreateSupplyChainWizard();
    }
    
    // Update sizing parameter status
    this.UpdateSizingParameterStatus();
    
    // Refresh sizing parameters (in case global values changed while dataset is offline)
    opt := DatasetFindOptions::Construct( GlobalParameters_MP::GetDatasetScenarioManager() );
    sm := MDSScenarioManager::Find( opt );
    this->UpdateSizingParameters( sm );
    sm->( scenariomanager )
    {
      scenariomanager.CreateRetentionPeriodPolicy();  
    }
    
    // create optimizers
    this.InitializeOptimization();
    
    // Find create dtd mpsplan
    DataTransformationMP_Plan::Create( this.DataTransformationDefinition() );
    DataTransformationSC_MPSPlanParameters::Create( this.DataTransformationDefinition() );
    // advanced transformation true for sc plan because of the format of the data they sent
    // there will be multiple instances of headers objects, we want to process them all in one go
    // by default def process them one by one
    DataTransformationSC_Plan::Create( this.DataTransformationDefinition() ).AdvancedTransformationMode ( true );
    
    this.InitializeCalendarRegistry();
    
    // Create QI object for QI related integration logic
    QIntegration_MP::Create( this );
  *]
}