| Quintiq file version 2.0 | 
| #parent: #root | 
| MethodOverride SyncSubsetProduct ( | 
|   OptimizerPuzzleBase target | 
| ) | 
| { | 
|   TextBody: | 
|   [* | 
|     // Copy all the subset product from OP to WIP | 
|     subsetWIP := target.astype( OptimizerPuzzleWIP ); | 
|     isfromdb := false; | 
|      | 
|     currentList := selectset( subsetWIP, SubsetProductInOptimizerPuzzleWip, sub , true ); | 
|     newList := construct( SubsetProductInOptimizerPuzzleWips ); | 
|      | 
|     traverse( this, SubsetProductInOptimizerPuzzle, subsource, subsource.IsValidData() ) | 
|     { | 
|       // No need check for subset as wip always starts on empty subset | 
|        | 
|       // Create a SubsetProductyWIP because WIP doesn't have it | 
|       targetSubset := SubsetProductInOptimizerPuzzleWip::Create( subsetWIP, subsource.Product_MP(), isfromdb ); | 
|        | 
|       // Update IsInclude and IsUserAction | 
|       targetSubset.IsIncluded( subsource.IsIncluded() ); | 
|       targetSubset.IsUserAction( subsource.IsUserAction() ); | 
|        | 
|       newList.Add( targetSubset ); | 
|     } | 
|      | 
|     toBeDeleted := currentList.Difference( newList ); | 
|     SubsetProductInOptimizerPuzzleWip::Delete( toBeDeleted ); | 
|   *] | 
| } |