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
Quintiq file version 2.0
#parent: #root
Method ImportFromDB (String brokerID_i, String dataTransformationID_i, Boolean doSynchronize_i) as Boolean id:Method_LibDIF_GlobalState_ImportFromDB
{
  #keys: '[131092.1.1251594517]'
  Body:
  [*
    // Import data from a database.
    success   := false;
    pingFirst := false;  // Assume that pinging has already been done when necessary.
    
    // Make sure that the Integration-dataset is selected.
    if( this.EnsureIntegrationDataset() )
    {
      // Call the EDI-broker to import the data as integration objects.
      // Synchronize the data if applicable.
      api := this.GetIntegrationAPI();
      if( not isnull( api ) )
      {
        if( doSynchronize_i )
        {
          api.ImportFromDBAndSynchronize( brokerID_i, dataTransformationID_i, pingFirst );
        }
        else
        {
          api.ImportFromDB( brokerID_i, dataTransformationID_i, pingFirst );
        }
      
        success := true;
      }
    }
    
    return success;
  *]
}