| Quintiq file version 2.0 | 
| #parent: #root | 
| DeclarativeOwningNMRelation CalcDependentDemand | 
| { | 
|   #keys: '1[134266.1.45259260]' | 
|   Expression: | 
|   [* | 
|     set := construct( ProductInStockingPointInPeriodPlanningLeafs ); | 
|     startofdd := this.DependentDemandStart(); | 
|     if ( startofdd.IsFinite() ) | 
|     { | 
|       endofdd := Process_MP::GetDependentDemandEnd( startofdd, this.UnitPeriod().Period_MP(), this.Operation() ); //Process_MP::GetOperationEnd( this.UnitPeriod().Period_MP(), startofdd ); | 
|        | 
|       set := selectset( this, | 
|                         // Not using Process.ProcessInput as the relation has not been propagated. | 
|                         // This will result in DDIG not being created. | 
|                         Operation.OperationInput.ProductInStockingPoint_MP.ProductInStockingPointInPeriodPlanning.astype( ProductInStockingPointInPeriodPlanningLeaf ), | 
|                         pispip, | 
|                         // The period that the DD belongs to | 
|                         pispip.Period_MP().IsInPeriod( startofdd, endofdd ) ); | 
|     } | 
|     return &set; | 
|   *] | 
|   HelperRelation: ProductInStockingPointInPeriodPlanningLeaf | 
|   InstantiationType: DependentDemand | 
|   Relation: DependentDemand | 
| } |