function outData = ampcblock_ForwardingTable(inData)
% Use the Forwarding Table to define the mapping from old "mpclib" blocks
% to new blocks.  Any links to old library blocks will be updated when you
% open a model containing links to the library with this Forwarding Table.
% If you select identical old and new library block names and paths, the
% Forwarding Table automatically populates library version numbers.  You
% can optionally define a transformation function to update old links
% parameter data using a MATLAB file on the path. Transforming old links
% parameter data for the new library block enables you to load old links
% and preserve parameter data.    

% Author(s): Rong Chen
% Copyright 2018 The MathWorks, Inc. 

outData.NewBlockPath = ''; % No change in the library block path
outData.NewInstanceData = [];
instanceData = inData.InstanceData;

% Replace "lims_inport" with 4 "umin/umax/ymin/ymax" inports
[HasLims, Index] = ismember('lims_inport',{instanceData.Name});
if HasLims
    LimsValue = instanceData(Index).Value;
    instanceData(end+1).Name = 'umin_inport';
    instanceData(end).Value = LimsValue;
    instanceData(end+1).Name = 'umax_inport';
    instanceData(end).Value = LimsValue;
    instanceData(end+1).Name = 'ymin_inport';
    instanceData(end).Value = LimsValue;
    instanceData(end+1).Name = 'ymax_inport';
    instanceData(end).Value = LimsValue;
    instanceData(Index) = [];
end

% Forward "cost_outport" to "return_cost"
[HasCost, Index] = ismember('cost_outport',{instanceData.Name});
if HasCost
    CostValue = instanceData(Index).Value;
    instanceData(end+1).Name = 'return_cost';
    instanceData(end).Value = CostValue;
    instanceData(Index) = [];
end

% Forward "return_sequence" to "return_mvseq"
[HasSequence, Index] = ismember('return_sequence',{instanceData.Name});
if HasSequence
    SequenceValue = instanceData(Index).Value;
    instanceData(end+1).Name = 'return_mvseq';
    instanceData(end).Value = SequenceValue;
    instanceData(Index) = [];
end

outData.NewInstanceData = instanceData;