陈清红
2025-04-14 880f3c0257eeb8c37761d484258fdd102a369a19
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
Quintiq file version 2.0
#parent: #root
StaticMethod Create (
  PeriodTaskOperation owner,
  Real qty
) as DependentDemandInputGroup
{
  Description: "Create dependent demand based on operation's input product"
  TextBody:
  [*
    ddig := null( DependentDemandInputGroup );
    
    // Using the procedural relation (astypes) so that this can be executed without having
    // to call transaction propagate within the same transaction
    traverse( owner,
              Process_MP.astype( Operation ).OperationInputOutput.astype( OperationInput ).BaseOperationLink,
              bol,
              not isnull( bol.OperationInputGroup() ) )
    {
      ddig := select( owner, DependentDemandInputGroup, dig, dig.BaseOperationLink() = bol );
    
      if( isnull( ddig ) )
      {
        ddig := owner.DependentDemandInputGroup( relnew,
                                                 OptimizerFulfilledQuantity := qty,
                                                 BaseOperationLink := bol );
    
        // Propagate the operation input relation
        Transaction::Transaction().Propagate( relation( DependentDemandInputGroup, OperationInput ) );
      }
    }
    
    return ddig;
  *]
}