function executeConstants(varargin)
  
  wb = varargin{1};
  
  if isa(wb, 'LTPDAworkbench')
    consts = awtinvoke(wb.mp, 'getAllConstants');
  elseif isa(wb, 'mpipeline.canvas.MCanvas')
    consts = wb.getAllConstants;
  else
    error('Unknown input object');
  end
  
  % Then execute all constants
  for kk=1:consts.size()
    
    c       = consts.get(kk-1);
    if ~c.isCommentedOut
      varname = char(c.getName());
      expr    = char(c.getExpression());
      
      if  exist(varname) > 1 || ~isvarname(varname)
        error('The constant block named "%s" is not a valid variable name. \nPlease rename it.', varname);
      end
      
      % can the expression be evaluated, or is it a string?
      try
        eval([expr ';']);
        cmd = [varname ' = ' expr ';'];
      catch
        cmd = [varname ' = ''' expr ''';'];
      end
      
      % evaluate
      disp(sprintf('++ preparing variable: %s', cmd));
      evalin('base', cmd);
    else
      varname = char(c.getName());
      cmd = ['clear ', varname];
      evalin('base', cmd);
    end
  end
  
end
