陈清红
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
42
43
44
45
46
47
48
49
50
51
Quintiq file version 2.0
#parent: #root
Method SendSystemConfigurationToDM
{
  Description:
  [*
    Send System configuration to Data Manager
    (1) This method should only be triggered in a System
  *]
  TextBody:
  [*
    // Send System configuration to Data Manager
    // This method should only be triggered in a System
    if( not this.IsDataManager() )
    {
      systemName         := this.SystemName();
      systemQProductName := this.SystemQProductName();
    
      if( systemName.Length() > 0
          and systemQProductName.Length() > 0 )
      {
        // Gather System's configuration
        hostName     := OS::ComputerName();
        portNumber   := CommandLine::Instance().NumberArgument( 'webserverport' );
        channelNames := selectvalues( this, CommunicationChannel, channel, true, channel.Name() );
    
        // Retrieve DM configuration
        globalParam     := this.GlobalParameters();
        dmHost          := globalParam.DM_Host();
        dmPort          := globalParam.DM_Port();
        dmDatasetKind   := globalParam.DM_DatasetKind();
        dmDatasetFolder := globalParam.DM_DatasetFolder();
        dmDatasetName   := globalParam.DM_DatasetName();
    
        // Send System configuration to DataManager via SOAP
        this.SendSystemConfigurationToDMViaSOAP( systemName, systemQProductName, hostName, portNumber, channelNames, dmHost, dmPort, dmDatasetKind, dmDatasetFolder, dmDatasetName );
      }
      else
      {
        LibDMF_Util::Log( this.SystemShortName(),
                          "System name is empty! Aborting current operation of sending System's configuration to DataManager..."
                          + String::NewLine() + "Execute 'Synchronize DataManager with Systems' in DataManager first." );
      }
    }
    else
    {
      LibDMF_Util::LogError( this.SystemShortName(),
                             "LibDMF_CommunicationChannelRoot.SendSystemConfigurationtoDM() method should only be triggered in a System, not in the DataManager." );
    }
  *]
}