function mpc_reviewcallback(blkh)
% Internal use
%

% Author:  R. Chen
% Copyright 2013-2014 The MathWorks, Inc.

%% If no mpc object is specified, design from scratch
fullblockname = getfullname(blkh);   
mpcobjname = get_param(blkh,'mpcobj');
if isempty(mpcobjname)
    uiwait(errordlg(ctrlMsgUtils.message('MPC:designtool:MPCObjectNotFoundinWorkspace',mpcobjname),...
        ctrlMsgUtils.message('MPC:designtool:DialogTitleError'),'modal'));
else
    % check whether it's a valid variable
    try
        mpcobj = slResolve(mpcobjname, blkh);
    catch ME
        uiwait(errordlg(ctrlMsgUtils.message('MPC:designtool:MPCObjectNotFoundinWorkspace',mpcobjname),...
            ctrlMsgUtils.message('MPC:designtool:DialogTitleError'),'modal'));
        return
    end
    % check whether it's a valid MPC object
    if ~isa(mpcobj,'mpc')
        uiwait(errordlg(ctrlMsgUtils.message('MPC:designtool:InvalidMPCObject',fullblockname),...
            ctrlMsgUtils.message('MPC:designtool:DialogTitleError'),'modal'));
        return
    end        
    % check whether it's an empty MPC
    if isempty(mpcobj)
        uiwait(errordlg(ctrlMsgUtils.message('MPC:designtool:EmptyMPCObject',fullblockname),...
            ctrlMsgUtils.message('MPC:designtool:DialogTitleError'),'modal'));
        return
    end
    review(mpcobj);
end
