Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Method DoStartSituation ( 
 | 
  MacroPlan macroplan 
 | 
) 
 | 
{ 
 | 
  Description: 
 | 
  [* 
 | 
    ADSO-10937 Test case precondition: Add additional parameters for blending test. 
 | 
    1. Create Product Apple under Flavoring 
 | 
    2. Create Product Orange under Flavoring 
 | 
    3. Create Product Apple & Orange 12pk under Greek 
 | 
    4. Create Routing sourcing Apple 
 | 
    5. Create Routing sourcing Orange 
 | 
    6. Create Routing product Apple & Orange 12pk from Apple and Orange. 
 | 
  *] 
 | 
  TextBody: 
 | 
  [* 
 | 
    // Routing for copying 
 | 
    routingDEPurchaseBlueberry := select( macroplan, Routing, r, r.ID() = 'DE Purchase Blueberry' ); 
 | 
    // Unit and stocking points involved 
 | 
    rawMaterialWarehouse := macroplan.FindStockingPoint( 'DE Warehouse Raw Material' ); 
 | 
    finishedGoodsWarehouse := macroplan.FindStockingPoint( 'DE Warehouse' ); 
 | 
    productionUnit := macroplan.FindUnit( 'DE Finishing' ); 
 | 
    routingName := 'Apple & Orange 12pk - UTF' 
 | 
    this 
 | 
    // Create Apple under Flavoring 
 | 
    ->CreateProduct( macroplan, 'Apple', 'Flavoring' ) 
 | 
    // Create Orange under Flavoring 
 | 
    ->CreateProduct( macroplan, 'Orange', 'Flavoring' ) 
 | 
    // Create Apple & Orange under Finished goods - Greek 
 | 
    ->CreateProduct( macroplan, 'Apple & Orange 12pk', 'Greek' ) 
 | 
    // Copy DE Purchase Blueberry, edit output sourcing Routing for Apple 
 | 
    ->CopyThenCreateSourcingRouting( macroplan, routingDEPurchaseBlueberry, 'A DE Purchase Apple', 'Apple', 'DE Warehouse Raw Material' ) 
 | 
    // Copy DE Purchase Blueberry, edit output sourcing Routing for Orange 
 | 
    ->CopyThenCreateSourcingRouting( macroplan, routingDEPurchaseBlueberry, 'A DE Purchase Orange', 'Orange', 'DE Warehouse Raw Material' ) 
 | 
    // Create routing DE Apple & Orange 12pk 
 | 
    // Operation: DE Finishing 
 | 
    ->( this ) 
 | 
    { 
 | 
      apple := macroplan.FindProduct( 'Apple' ); 
 | 
      orange := macroplan.FindProduct( 'Orange' ); 
 | 
      finishedGood := macroplan.FindProduct( 'Apple & Orange 12pk' ); 
 | 
      rawMaterials := construct( Product_MPs ).Union( apple ).Union( orange ); 
 | 
      this.CreateProductionRoutingWithCost( productionUnit,  
 | 
                                            routingName,  
 | 
                                            100.0,  
 | 
                                            rawMaterials, // Raw materials 
 | 
                                            rawMaterialWarehouse,  
 | 
                                            finishedGood, // Finish goods 
 | 
                                            finishedGoodsWarehouse ) 
 | 
    } 
 | 
    ->Exception() 
 | 
    ->( e ) 
 | 
    { 
 | 
      this.Run().RegisterFailure( e.Message() ) 
 | 
    } 
 | 
  *] 
 | 
  InterfaceProperties { Accessibility: 'Module' } 
 | 
} 
 |