classdef ExploreHandler < fxptui.Web.CallbackService.ActionsHandler
    % Class to handle the work for Explore Callback in FPT.
    
    % Copyright 2019 The MathWorks, Inc.

    properties(Constant)
        ActionID = fxptui.internal.ActionFactory.ApplyID;
    end
    
    methods
        
        function prepare(~, varargin)
            workflowSetting = varargin{2};
            clientData = varargin{3};
            
            exploreSetting = workflowSetting.getSettingValue('ExploreSetting');
            exploreSetting.SolutionIndex = clientData.SolutionIdx;
            exploreSetting.ScenarioIndex = clientData.ScenarioIdx;
            
        end
        
        function handleSuccess(~, varargin)
            fptInstance = varargin{1};
            
            resultSummaryController = fptInstance.getResultSummaryController();
            resultSummaryController.updateAppliedSolution;
            
        end
        
        function handleError(~, varargin)
            % ToDo: Show warning dialog when explore action errors
            % g2089125
        end
        
        function cleanup(~, varargin)
            %no op
        end
        
    end
end
