| Quintiq file version 2.0 | 
| #parent: #root | 
| Method ResequenceOnTransition ( | 
|   Transition_MP transition, | 
|   output DateTime newcampaignstart, | 
|   output DateTime newcampaignend | 
| ) | 
| { | 
|   Description: "Resequence source campaign on start of a transition, push the transition's FromCampaign and its following campaigns back." | 
|   TextBody: | 
|   [* | 
|     newcampaignstart := this.Start(); | 
|     newcampaignend := this.End(); | 
|     sourceduration := this.End() - this.Start(); | 
|     target := transition.ToCampaign_Old(); | 
|     source := this; | 
|     if( transition.FromCampaign_Old() <> this and transition.ToCampaign_Old() <> this ) | 
|     { | 
|       transitionduration := Campaign_MP_DELETED_Q320::GetMinTransitionDuration( transition.FromCampaign_Old().CampaignType_MP(), this.CampaignType_MP() ); | 
|       newcampaignstart := transition.Start() + transitionduration; | 
|       newcampaignend := newcampaignstart + sourceduration; | 
|       this.UpdateTargetCampaignsStartEnd( newcampaignend, | 
|                                           source, | 
|                                           target, | 
|                                           transition.ToCampaign_Old() ); | 
|     } | 
|   *] | 
| } |