Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Function CalcPISPNodeInRoutingDisplayIndex 
 | 
{ 
 | 
  TextBody: 
 | 
  [* 
 | 
    // Get the sorted set of input PISPNodeInRoutings 
 | 
    input := selectsortedset( this, 
 | 
                              PISPNodeInRouting, 
 | 
                              node, 
 | 
                              not isnull( node.OperationInputForRCV() ), 
 | 
                              node.OperationInputForRCV().Operation().RoutingStep().SequenceNumber(), 
 | 
                              node.OperationInputForRCV().Operation().UnitDisplayIndex(), 
 | 
                              guard( node.OperationInputForRCV().OperationInputGroup().Index(), 9999 ), 
 | 
                              node.OperationInputForRCV().ProductDisplayIndex() ); 
 | 
     
 | 
    // Get the sorted set of output PISPNodeInRoutings 
 | 
    output := selectsortedset( this, 
 | 
                               PISPNodeInRouting, 
 | 
                               node, 
 | 
                               not isnull( node.OperationOutputForRCV() ), 
 | 
                               node.OperationOutputForRCV().Operation().RoutingStep().SequenceNumber(), 
 | 
                               node.OperationOutputForRCV().Operation().UnitDisplayIndex(), 
 | 
                               node.OperationOutputForRCV().ProductDisplayIndex() ); 
 | 
     
 | 
    // Initialize index 
 | 
    idx := 0; 
 | 
    // Set display index of all input PISPNodeInRoutings 
 | 
    traverse( input, Elements, e ) 
 | 
    { 
 | 
      e.DisplayIndex( idx ); 
 | 
      idx ++; 
 | 
    } 
 | 
     
 | 
    // Set display index of all output PISPNodeInRoutings 
 | 
    traverse( output, Elements, e ) 
 | 
    { 
 | 
      e.DisplayIndex( idx ); 
 | 
      idx ++; 
 | 
    } 
 | 
  *] 
 | 
} 
 |