Quintiq file version 2.0
|
#parent: #root
|
StaticMethod CreateFromMapping (
|
const GlobalOTDTable globalOTDTable,
|
MacroPlan macroPlan
|
)
|
{
|
TextBody:
|
[*
|
// Administrator Oct-31-2023 (created)
|
updates := construct( LaneLegs );
|
traverse( globalOTDTable, Global_MappingLaneLeg, gll, true )
|
{
|
processingtime := Duration::Zero();
|
hasprocessingtime := true;
|
userleadtime := gll.UserLeadTime();
|
if( userleadtime.Length() = 0 )
|
{
|
hasprocessingtime := false;
|
processingtime := Duration::Zero();
|
}
|
else
|
{
|
hasprocessingtime := true;
|
processingtime := Duration::Hours( [Number]userleadtime );
|
};
|
|
lane := Lane::FindById( macroPlan, gll.LaneID() );
|
a := LaneLeg::CreateLaneleg( macroPlan, lane, gll.LaneID(), gll.OriginStockingPointID(), gll.DestinationStockingPointID(), gll.Name(), hasprocessingtime, processingtime);
|
updates.Add( a );
|
}
|
origindataset := selectset( macroPlan, Unit.Lane.LaneLeg, ll, true );
|
obsoletes := origindataset.Difference( updates );
|
// delete obsoleted
|
difflength := obsoletes.Size();
|
for( j:=0; j<difflength; j++ )
|
{
|
obsolete := obsoletes.Element( j );
|
obsolete.Delete();
|
}
|
*]
|
}
|