classdef DeleteRunStrategy < fxptds.WorkflowTopology.Strategy
    %% DELETERUNSTRATEGY handles run deletion events
    
    % Copyright 2018-2019 The MathWorks, Inc.
    
    methods (Access = {?fxptds.WorkflowTopology.Strategy, ?fxptds.WorkflowTopology.Facade, ?WorkflowTopologyTestCase})
        function execute(this)
            
            % declare the target node Name
            targetName = this.FPTRunID;
            
            % get the node
            exists = this.Store.doesNodeExist(targetName);
            if exists
                
                % get the nodes that are successors to the target (run or
                % model) that is being deleted
                nodesToInvalidate = this.getNodesToInvalidate(targetName);
                
                % invalidate those nodes since the run is no longer
                % available
                this.invalidateNodes(nodesToInvalidate);
                
            end
                
        end
    end
    
end

