haorenhui
2023-10-30 6d6cc10d9e8e242661da7fd655dec155a09d676c
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
Quintiq file version 2.0
#parent: #root
Method DoFinalize (LibOpt_Task task) as stream[JSON]
{
  Description:
  [*
    This method calls a second `DoFinalize` method. This second `DoFinalize` handles the deletion of dataset copies and deletes the task.
    The second `DoFinalize` method uses an output variable. This output variable prevents us from calling `DoFinalize` reactively.
    
    This method is not supposed to be overridden.
  *]
  TextBody:
  [*
    returnstream := stream[JSON]::Success();
    
    if( not this.Run().IsFailed() )
    {
       hascreatedstream := false;
       returnstream := this.DoFinalize( task,
                                        hascreatedstream // hascreatedstream is an output variable, so we cannot pass 'false' directly.
                                        );
    }
    
    return returnstream;
  *]
  InterfaceProperties { Accessibility: 'Module' }
}