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; 
 | 
      } 
 | 
    } 
 | 
  *] 
 | 
} 
 |