Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Method IncludeExcludeEntity ( 
 | 
  Entity entity, 
 | 
  Boolean isinclude, 
 | 
  Boolean isuseraction 
 | 
) 
 | 
{ 
 | 
  Description: 'Include or exclude entity and its descendants.' 
 | 
  TextBody: 
 | 
  [* 
 | 
    // Include or exclude entity 
 | 
     
 | 
    // Select associated subset 
 | 
    subEntity := select( this, 
 | 
                         SubsetEntityInOptimizerPuzzleWip, 
 | 
                         seiop, 
 | 
                         seiop.Entity() = entity ); 
 | 
     
 | 
    // Change isInclude for given entity 
 | 
    subEntity.Update( isinclude, isuseraction ); 
 | 
     
 | 
    // Traverse child 
 | 
    traverse( entity, ChildEntity, ce, not ce.GetIsSystem() ) 
 | 
    { 
 | 
      // Include / Exclude descendants. 
 | 
      // Put IsUserAction false for descendants because parents is overriding childs 
 | 
      this.IncludeExcludeEntity( ce, isinclude, false ); 
 | 
    } 
 | 
  *] 
 | 
} 
 |