function updateModelHierarchy(~, data, fptInstance)
    % UPDATEMODELHIERARCHY updates the model hierarchy when unsupported
    % blocks are wrapped with DTCs in a subsystem
    
    % Copyright 2019 The MathWorks, Inc.    
      
    % get the status and results of unsupported construct step to
    % check if the model is changed, hierarchy is updated only if 
    % preparation changes the model
    
    
    % find the index for the unsupported check entry using enum value
    checkEnum = DataTypeWorkflow.Advisor.internal.utils.ReportCheckCategory.UnsupportedConstruct;
    checkStr = string(checkEnum);  
    index = find(strcmp(data.CheckList, checkStr));
    
    % if index is invalid, return
    if(isempty(index))
        return;
    end
   
    % get the status and detailed results
    checkStatus = data.SummaryChecks{index}.Status;
    unsupportedConstructResults = data.DetailedChecks{index};
    
    % if the check status is 'Pass' and detailed 'Info' does not have an
    % empty struct, the model is changed
    isSuccess = strcmp(checkStatus, "Pass");
    infoExists = ~isempty(unsupportedConstructResults.Info{1});
    
    if(isSuccess && infoExists)
        modelHierarchy = fptInstance.getModelHierarchy;
        modelHierarchy.captureHierarchy;
        
        % update the main tree hierarchy
        treeController = fptInstance.getTreeController;
        treeData = struct('treeDepth', 2);
        treeController.sendModelHierarchy(treeData);
        
        % update the SUD tree hierarchy
        startupController = fptInstance.getStartupController;
        startupController.publishHierarchy(treeData);
        
        % update the current selection after the main tree refresh
        startupController.publishSUD;
    end    
end
