String commandName = (String)historyJSON.getJSONObject(i).get(HistoryArguments.commandName.name()); JSONArray commandTag = (JSONArray)historyJSON.getJSONObject(i).get(HistoryArguments.tags.name()); if (isCommandTag(commandTag, CommandTag.Transformation)) { if(commandName.equals("OrganizeColumnsCommand")) { organizeCommand = historyJSON.get(i);
HistoryJSONEditor editor = new HistoryJSONEditor(new JSONArray(historyJson.toString()), workspace, worksheetId); if (null == historyJson || historyJson.length() == 0) { return new UpdateContainer(new ErrorUpdate("No history found in R2RML Model!")); editor.updateModelUrlInCommands(r2rmlModelFile.toString()); WorksheetCommandHistoryExecutor histExecutor = new WorksheetCommandHistoryExecutor( worksheetId, workspace); alignMgr.removeAlignment(alignmentId); alignMgr.createAlignment(workspace.getId(), worksheetId,workspace.getOntologyManager()); editor.deleteExistingTransformationCommands(); historyJson = editor.getHistoryJSON(); editor.deleteExistingTransformationAndModelingCommands(); historyJson = editor.getHistoryJSON(); logger.info(editor.getHistoryJSON().toString(4)); UpdateContainer hc = histExecutor.executeAllCommands(historyJson); if(hc != null) {
if (isCommandTag(commandTag, CommandTag.Transformation)) { if(CommandInputJSONUtil.getStringValue("orderedColumns", inputParamArr) != null) { newHistoryJSON.put(historyJSON.get(i)); } else if (!isCommandTag(commandTag, CommandTag.Modeling)) { for(Object orderedColCommand : orderedColumnCommands) newHistoryJSON.put(orderedColCommand);