@Override public UpdateContainer doIt(Workspace workspace) throws CommandException { Worksheet worksheet = workspace.getWorksheet(worksheetId); RepFactory factory = workspace.getFactory(); SuperSelection superSel = getSuperSelection(worksheet); HTable hTable = factory.getHTable(factory.getHNode(hNodeId).getHTableId()); Selection currentSel = superSel.getSelection(hTable.getId()); if (currentSel != null) { currentSel.updateSelection(); } CommandHistory history = workspace.getCommandHistory(); List<Command> tmp = gatherAllOperateSelectionCommands( history.getCommandsFromWorksheetId(worksheetId), workspace); if (tmp.size() > 0) { JSONArray inputJSON = new JSONArray(); inputJSON.put( CommandInputJSONUtil.createJsonObject( "worksheetId", worksheetId, ParameterType.worksheetId)); inputJSON.put( CommandInputJSONUtil.createJsonObject("hNodeId", hNodeId, ParameterType.hNodeId)); inputJSON.put( CommandInputJSONUtil.createJsonObject( "operation", Operation.Intersect.name(), ParameterType.other)); inputJSON.put( CommandInputJSONUtil.createJsonObject( "pythonCode", SelectionManager.defaultCode, ParameterType.other)); inputJSON.put(CommandInputJSONUtil.createJsonObject("onError", "false", ParameterType.other)); inputJSON.put( CommandInputJSONUtil.createJsonObject( "selectionName", superSel.getName(), ParameterType.other)); Command t = null; try { t = new OperateSelectionCommandFactory().createCommand(inputJSON, workspace); } catch (Exception e) { } if (t != null) history._getHistory().add(t); history._getHistory().addAll(tmp); } UpdateContainer uc = WorksheetUpdateFactory.createWorksheetHierarchicalAndCleaningResultsUpdates( worksheetId, superSel); uc.add(new HistoryUpdate(history)); return uc; }