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
Quintiq file version 2.0
#parent: #root
Method DataCollectBasedOnInterest (LibDMF_Interest interest_i, Boolean isNotificationOnly, output LibDMF_SetType setType_o, 
  output LibDMF_Set set_o, output DateTime lastUpdated) as owning structured_Object
{
  Description: 'Collect data based on interest (set or set type) passed. Also return last updated time stamp, and set and set type as output parameter'
  TextBody:
  [*
    // derred beh Nov-11-2015 (created)
    
    data := null( structured_Object, owning );
    
    // Collect data (if not notification only ) from either SetType or Set
    if( interest_i.Data().istype( LibDMF_SetType ) )
    {
      setType_o := interest_i.Data().astype( LibDMF_SetType );
    
      if( not isNotificationOnly )
      {
        setTypes := construct( LibDMF_SetTypes );
        setTypes.Add( setType_o );
        data := this.DataCollect( setTypes );
        lastUpdated := setType_o.TimestampLastUpdated();
      }
    }
    else
    {
      set_o := interest_i.Data().astype( LibDMF_Set);
      setType_o := set_o.SetType();
    
      if( not isNotificationOnly )
      {
        data := this.DataCollect( set_o );
        lastUpdated := set_o.TimestampLastUpdated();
      }
    }
    
    return &data;
  *]
}