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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Quintiq file version 2.0
#parent: #root
Method GetSystemOnChannel (String datasetKind_i, String datasetName_i) as LibDMF_SystemOnChannel
{
  Description: 'Retrieve the SystemOnChannel based on dataset kind and name'
  TextBody:
  [*
    // Jacky C Aug-28-2015 (created)
    
    ccr := this.GetCommunicationChannelRoot();
    
    systemOnChannel := null( LibDMF_SystemOnChannel );
    
    // Retrieve IntegrationEvent.
    event := ccr.EventGetLast( datasetKind_i, datasetName_i );
    
    if( ccr.IsDataManager() )
    {
      systemOnChannel := select( this, SystemOnChannel, soc,
                                 soc.DatasetKind() = datasetKind_i and
                                 soc.DatasetName() = datasetName_i );
    
      // Error logging
      if( isnull( systemOnChannel ) )
      {
    
    
        ccr.EventLogActivityError( event,
                                   "SystemOnChannel not found",
                                   "SystemOnChannel not found; Channel = " + this.Name() + ", DatasetKind = " + datasetKind_i + ", DatasetName = " + datasetName_i );
      }
    }
    else
    {
      ccr.EventLogActivityError( event,
                                 "GetSystemOnChannel should only be called by the DataManager, not by a System",
                                 "GetSystemOnChannel should only be called by the DataManager, not by a System; Channel = " +
                                 this.Name() + ", DatasetKind = " + datasetKind_i + ", DatasetName = " + datasetName_i );
    }
    
    return systemOnChannel;
  *]
}