| Quintiq file version 2.0 | 
| #parent: #root | 
| Method SynchronizePeriodTaskInTransitionQuantity ( | 
|   PeriodTaskInCampaigns periodtaskincampaigns | 
| ) | 
| { | 
|   Description: 'Plan minimum duration or quantity for the from and to transition' | 
|   TextBody: | 
|   [* | 
|     // Plan from and to transition | 
|     transitions:= selectsortedset( periodtaskincampaigns, Elements.OperationInCampaign.Campaign_MP.FromTransition, from, true, from.Start() ) | 
|     nextransitions := selectsortedset( periodtaskincampaigns, Elements.OperationInCampaign.Campaign_MP.ToTransition, to, true, to.Start() ); | 
|     transitions := transitions.Union( nextransitions ); | 
|      | 
|     // These attributes are used in GetIsPlannedGreaterThanMinRequired therefore need to propagate before PlanMinimum | 
|     Transaction::Transaction().Propagate( attribute( Transition_MP, FulfilledQuantity ) ) | 
|     Transaction::Transaction().Propagate( attribute( Transition_MP, UtilizationDuration ) ) | 
|      | 
|     feedback := construct( Strings ); | 
|     feedback_o := construct( Strings ); | 
|     checkLastTransition := true; | 
|      | 
|     traverse( transitions, Elements, transition, not transition.GetIsPlannedGreaterThanMinRequired( feedback, feedback_o, checkLastTransition ) ) | 
|     { | 
|       transition.PlanMinimum(); | 
|     } | 
|   *] | 
|   InterfaceProperties { Accessibility: 'Module' } | 
| } |