classdef DefaultRunStatusStrategy < fxptui.internal.runstatus.RunStatusStrategy
    %DefaultRunStatusStrategy get run status for iterative and
    %collection workflows
    
    % Copyright 2020 The MathWorks, Inc.
    
    methods(Access = {?fxptui.internal.runstatus.RunStatusStrategy})
        function allRunStatus = getAllRunStatusLocal(~, allRawReports)
            allRunStatus = cell(numel(allRawReports), 1);
            % Loop through all the runs and query for run status one by one
            runStatusFactory = fxptui.internal.runstatus.RunStatusFactory();
            for idx = 1:numel(allRawReports)
                report = allRawReports{idx};
                if ~isempty(report)
                    runStatus = runStatusFactory.getRunStatus(report);
                    allRunStatus{idx} = runStatus;
                end
            end
        end
    end
end

