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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
Quintiq file version 2.0
#parent: #root
Method GetSetOfInterest (LibDMF_SystemOnChannel soc_i, String setTypeName_i, String setName_i, 
  Boolean setFoundRequired_i, output String feedback_o) as LibDMF_Set
{
  Description: 'Retrieve the Set in the DataManager which the SOC is interested in, returns null if not used in DataManager.'
  TextBody:
  [*
    set  := null( LibDMF_Set );
    root := this.CommunicationChannelRoot();
    
    if( root.IsDataManager() )
    {
      set := LibDMF_Set::FindSet( setName_i );
    
      // Retrieve IntegrationEvent
      event := root.EventGetLast( soc_i.DatasetKind(), soc_i.DatasetName() );
      activityDetails := setName_i + " for System " + soc_i.SystemName() + "; Channel = " + this.Name();
    
      // 1. checks if set exists
      if( isnull( set ) )
      {
        // log the set not found
        feedback_o := "Non-existent Set " + activityDetails;
    
        // check whether to terminate the transaction
        if( setFoundRequired_i )
        {
          root.EventLogActivityError( event,
                                      "Finding Set " + activityDetails,
                                      feedback_o );
        }
        else
        {
          // log warning
          root.EventLogActivityWarning( event,
                                        feedback_o );
        }
      }
      else
      {
        // 2. checks if the SOC is interested
        if( not soc_i.ChecksForInterest( set ) )
        {
          // reset to null
          set := null( LibDMF_Set );
    
          // log the soc does not have interest on set or settype
          feedback_o := "No interest specified for Set " + activityDetails;
    
          // check whether to terminate the transaction
          if( setFoundRequired_i )
          {
            root.EventLogActivityError( event,
                                        "Matching interested Set " + activityDetails,
                                        feedback_o );
          }
          else
          {
            // log warning
            root.EventLogActivityWarning( event,
                                          feedback_o );
          }
        }
        else
        {
          // log successful
          root.EventLogActivity( event,
                                 "Found interested Set " + activityDetails );
        }
      }
    }
    
    return set;
  *]
}