Quintiq file version 2.0
|
#parent: #root
|
Method UpdateTypeIndex (
|
String unitid
|
)
|
{
|
Description: 'Update unit TypeIndex and the linked instances.'
|
TextBody:
|
[*
|
// Update unit TypeIndex and the linked instances if the new ID is not the same as the old ID
|
if( this.ID() <> unitid )
|
{
|
// Update type index of all linked UnitPeriods
|
traverse( this, UnitPeriod, up )
|
{
|
up.UpdateTypeIndex( unitid, up.Start(), up.End() );
|
}
|
|
// Update foreign key of all linked Children
|
traverse( this, Child, c )
|
{
|
c.UpdateForeignKey( c.CurrencyID(), c.GroupName(), unitid, c.UnitOfMeasureName() )
|
}
|
|
// Update type index of all linked CampaignType_MPs
|
traverse( this, CampaignType_MP, ct )
|
{
|
ct.UpdateTypeIndex( ct.Name(), unitid );
|
}
|
|
// Update foreign key of all linked Lanes
|
traverse( this, Lane, lane )
|
{
|
lane.UpdateForeignKey( unitid );
|
}
|
|
// Update foreign key of all linked Operations
|
traverse( this, Operation, operation )
|
{
|
operation.UpdateForeignKey( unitid, operation.RoutingID(), operation.RoutingStepName() );
|
}
|
|
// Update foreign key of all linked StockingPoint_MPs
|
traverse( this, StockingPoint_MP, sp )
|
{
|
sp.UpdateForeignKey( sp.UnitOfMeasureName(), sp.CurrencyID(), sp.GroupName(), unitid );
|
}
|
|
// Update type index of all linked StockingPointUnits
|
traverse( this, StockingPointUnit, spunit )
|
{
|
spunit.UpdateTypeIndex( spunit.StockingPointID(), unitid, spunit.IsInput() );
|
}
|
|
// Update type index of all linked SupplySpecifications
|
traverse( this, SupplySpecification, starget )
|
{
|
starget.UpdateTypeIndex( unitid, starget.ProductID(), starget.Start(), starget.End() );
|
}
|
|
// Update foreign key of all linked UnitAccounts
|
traverse( this, UnitAccount, uaccount )
|
{
|
uaccount.UpdateForeignKey( unitid );
|
}
|
|
// Update foreign key of all linked UnitCosts
|
traverse( this, UnitCost, ucost )
|
{
|
ucost.UpdateForeignKey( unitid );
|
}
|
|
// Update type index of all linked UnitAvailabilities
|
traverse( this, UnitAvailability, uavailability )
|
{
|
uavailability.UpdateTypeIndex( unitid, uavailability.Start() );
|
}
|
|
// Update type index of all linked UnitCalendarElements
|
traverse( this, UnitCalendarElement, ucelement )
|
{
|
ucelement.UpdateTypeIndex( unitid, ucelement.Start(), ucelement.End() );
|
}
|
|
// Update type index of all linked UnitCapacities
|
traverse( this, UnitCapacity, ucapacity )
|
{
|
ucapacity.UpdateTypeIndex( unitid, ucapacity.Start() );
|
}
|
|
// Update type index of all linked TransitionType_MPs
|
traverse( this, TransitionType_MP, transtype )
|
{
|
transtype.UpdateTypeIndex( transtype.Name(), unitid );
|
}
|
|
// Update type index of all linked TransportAvailabilities
|
traverse( this, TransportAvailability, transcap )
|
{
|
transcap.UpdateTypeIndex( unitid, transcap.Start() );
|
}
|
|
// Update EntityID of subsets for Unit
|
traverse( this, SubsetEntityInOptimizerPuzzleBase, subsets )
|
{
|
subsets.UpdateTypeIndex( subsets.OptimizerPuzzleName(), unitid, subsets.EntityType() );
|
}
|
|
// Update type index of all linked UnitShiftPatterns
|
traverse( this, UnitShiftPattern, unitshiftpattern )
|
{
|
unitshiftpattern.UpdateTypeIndex( unitid, unitshiftpattern.ShiftPatternName() );
|
}
|
|
// Update type index of this Unit
|
this.IsManuallyConfigured( true );
|
Unit::ChangeKeyUnitTypeIndex( this, unitid );
|
|
// Update ID of the calendar associate to this Unit
|
this.UnitCalendar().SetCalendarID();
|
}
|
*]
|
}
|