Quintiq file version 2.0
#parent: #root
Method HideNodeFromClient () id:Method_FormSupplyChainOverview_HideNodeFromClient
{
  #keys: '[136682.0.1908324168]'
  Body:
  [*
    //This method will manually hide the node from client when user click to hide without waiting the status to be updated in server
    nodes := DataHolderSelectedNode.Data();
    different := DataHolderNode.Data().Difference( nodes );
    DataHolderNode.Data( &different );
    
    //StockingpointEdge
    inputedge := selectset( nodes, Elements.InputStockingPointUnitEdge, edge, true, true );
    outputedge := selectset(  nodes, Elements.OutputStockingPointUnitEdge,edge, true, true );
    edges := inputedge.Union( outputedge );
    edgesdiff := DataHolderStockingPointUnitEdge.Data().Difference( edges );
    DataHolderStockingPointUnitEdge.Data( &edgesdiff );
    
    //Laneg edges (Stockingpointnode)
    stockingpointnods := selectset(  nodes, Elements.astype( StockingPointNode ), s, true, true );
    inputlaneleges := selectset(  stockingpointnods, Elements.AsDestinationStockingPoint, origin, true, true );
    outputlaneleges := selectset(  stockingpointnods, Elements.AsOriginStockingPoint, dest, true, true );
    stockingedge := inputlaneleges.Union( outputlaneleges );
    
    //Laneg edges (Unitnode)
    unitnodes := selectset(  nodes, Elements.astype( UnitNode ), s, true, true );
    unitdest := selectset(  unitnodes, Elements.AsDestinationUnit, origin, true, true );
    unitorigin := selectset( unitnodes, Elements.AsOriginUnit, dest, true, true );
    unitedge := unitorigin.Union( unitdest );
    
    nodelanelegeedges := stockingedge.Union( unitedge );
    
    newlanes := DataHolderLaneLegEdge.Data().Difference( nodelanelegeedges );
    DataHolderLaneLegEdge.Data( &newlanes );
  *]
}
