yanweiyuan3
2023-08-09 588bc7829387dfc761cc25f06f77d4c81818bd10
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
Quintiq file version 2.0
#parent: #root
Method OnFinished
{
  Description: 'Post finish run step'
  TextBody:
  [*
    // Once the step is done, update its status according to the feedback from other datasets upgrade job
    status := DMF_Utility::ID_Finished();
    this.UpdateStatus( status );
    this.UpdateEnd( DateTime::Now() );
    this.UpdateMessage( DMF_Utility::ID_DisplayFinished() );
    
    // If it is finished, it means successful, we then have to check if
    // there are any more steps to run for this dataset, if there is, 
    // we continue running them, otherwise, report back to dataset
    // If this is success and there isn't anymore step, we have succeeded
    allRunStepFinished := isnull( this.Next() )
    
    if( allRunStepFinished )
    {
      this.DatasetInConvertorVersion().OnFinished();
      
      // Update also the dataset version
      this.DatasetInConvertorVersion().Dataset().UpdateConvertedVersion( this.DatasetInConvertorVersion().ConvertorVersion() );
    }
    else
    {
      // Start next step conversion if there's any
      this.Next().InitializeConversion();
    }
  *]
}