public void removeCommands(Workspace workspace, String worksheetId) {
List<ICommand> commandsToBeRemoved = new ArrayList<ICommand>();
ListIterator<ICommand> commandItr = history.listIterator(history.size());
while(commandItr.hasPrevious()) {
ICommand command = commandItr.previous();
if(command instanceof Command && command.isSavedInHistory() && (command.hasTag(CommandTag.Modeling)
|| command.hasTag(CommandTag.Transformation))) {
JSONArray json = new JSONArray(command.getInputParameterJson());
if (HistoryJsonUtil.getStringValue(HistoryArguments.worksheetId.name(), json).equals(worksheetId)) {
commandsToBeRemoved.add(command);
Command tmp = (Command)command;
if (tmp.getCommandType() == CommandType.undoable) {
try {