| 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; | 
|   *] | 
| } |