hongji.li
2023-11-07 1a1ba3ad5ed9e4380185aa1ccad20204a0e5f115
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
Quintiq file version 2.0
#parent: #root
StaticMethod Test (
  MacroPlan this
)
{
  TextBody:
  [*
    pispnames := construct( Strings );
    
    traverse( this, SalesDemand.ProductInStockingPoint_MP, pisp )
    {
      if( not exists( pisp, ProcessOutput.AsProcessOutput.ProcessInput, processinput, true ) )
      {
        pispnames.Add( pisp.Name() );
      }
      else
      {
        dummyprocesses := selectset( pisp, ProcessOutput.AsProcessOutput, process, true );
        index := 0;
        limit := 10000;
        
        while( index < dummyprocesses.Size()
               and index < limit )
        {
          dummyprocess := dummyprocesses.Element( index );
          index++;
          
          pisps := construct( ProductInStockingPoint_MPs );
          
          if( dummyprocess.istype( Operation ) )
          {
            pisps := selectset( dummyprocess, astype( Operation ).RoutingStep.Routing.InputPISPNodeInRouting.ProductInStockingPoint_MP, pisp2,
                                not pisp2.IsSystem() );
          }
          else if( dummyprocess.istype( LaneLeg ) )
          {
            pisps := selectset( dummyprocess, astype( LaneLeg ).LaneLegInput.ProductInStockingPoint_MP, pisp2,
                                pisp2.Product_MP() = pisp.Product_MP() );
          }
          
          traverse( pisps, Elements, pisp2 )
          {
            if( not exists( pisp2, ProcessOutput.AsProcessOutput.ProcessInput, processinput, true ) )
            {
              pispnames.Add( pisp2.Name() );
            }
            else
            {
              dummyprocesses2 := selectset( pisp2, ProcessOutput.AsProcessOutput, process, true );
              dummyprocesses.AddInPlace( dummyprocesses2 );
            }
          }
        }
      }
    }
    
    pispnames := pispnames.Unique().Sort();
    info( pispnames.ToString( String::NewLine() ) );
  *]
}