陈清红
2025-04-14 880f3c0257eeb8c37761d484258fdd102a369a19
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
Quintiq file version 2.0
#parent: LibSOPImpExp_ContextMenuExport/MenuExportFromSCIExtend
Response OnClick () inherited id:Response_MacroPlanner_LibSOPImpExp_ContextMenuExport_MenuExportFromSCIExtend_OnClick
{
  #keys: '[146140.3.52476396]'
  BaseType: 'Response_MenuExportFromSCI_OnClick'
  DefinitionID: 'Responsedef_WebMenu_OnClick'
  Precondition:
  [*
    return MacroPlan::HasMacroPlan( MacroPlan, feedback );
  *]
  QuillAction
  {
    Body:
    [*
      // Synchronize LibSCIScenarios with ScenarioMP then open the dialog
      // Create 2 lists of Strings to stock Names and DatasetNames
      scenarionames := construct( Strings );
      scenariodatasetnames := construct( Strings );
      assumptions := construct( Strings );
      
      // Traverse non IsDeleted Scenario_MP in order to get names and datasetname
      // These values are needed for the synchronization
      traverse( ScenarioManager, ScenarioMP, scenario, not scenario.IsDeleted() )
      {
        scenarionames.Add( scenario.Name() );
        scenariodatasetnames.Add( scenario.DatasetName() );
        concatenatedassumption := selectuniquevalues( scenario, Assumption, assmption, assmption.ID() ).ToString( LibSCIIntegration_Utility::Delimiter() )
        // Add empty space if no assumption for the Scenario, so that number of elements tally with Scenario
        assumptions.Add( ifexpr( concatenatedassumption.Length() >0, concatenatedassumption, " " ) );
      }
      
      // Synchronize LibSCIScenario with Scenario_MP
      LibSCIIntegrationInterface.SynchronizeLibSCIScenarioWithScenarioMP( scenariodatasetnames, scenarionames, assumptions );
      
      dlg := construct( DialogSCIExportReports );
      dlg.Initialize();
    *]
    GroupServerCalls: false
  }
}