yanyuan
2023-11-10 143ef74e2eeee697ac8fda3d9032a790fbb4e146
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
Quintiq file version 2.0
#parent: #root
StaticMethod CreateOperationInputGroupMessage (
  MacroPlan macroplan
)
{
  Description: 'create sanity check message for operation input group'
  TextBody:
  [*
    // desmondt Nov-7-2014 (created)
    messagelimit := macroplan.GlobalParameters_MP().SanityCheckLimit();
    
    // collect the set of InvalidOperationInputGroup, sorted on the most severe violations
    invalidobjects := selectsortedset( macroplan, 
                                       SanityCheckGroupData.InvalidOperationInputGroup,
                                       invalidobject,
                                       true,
                                       invalidobject.SanityCheckDataMostSevere() );
    
    // continue checking the invalid objects untill we have reached the message limit                              
    objcount := 0;                                   
    traverse( invalidobjects,
              Elements,
              invalidobject,
              objcount <= messagelimit )
    {
      objcount := objcount + 1;
    
      feedbacks := construct( Strings );
      sanitycheckfeedbacks := construct( Strings );
      
      invalidobject.DoSanityCheckData( feedbacks, sanitycheckfeedbacks );
      
      i := 0;
      // for each invalid object, collect the sanity check feedback
      traverse( feedbacks, Elements, fb )
      {
        if( not exists( invalidobject, SanityCheckMessageData, msg, msg.Description() = fb ) )
        {
          //tokenize msg to retrieve category level and seperate the actual feedback
          sanitycheckmessage := SanityCheckMessageData::Create( invalidobject.SanityCheckGroupData(), 
                                                                fb, 
                                                                true,
                                                                sanitycheckfeedbacks.Element( i ) );
          // Operation input group is instatiated decleratively, the realation will set to OperationLink
          sanitycheckmessage.OperationInputGroup( relset, invalidobject );
        }
        i := i + 1;
      }
    }
  *]
}