ExternalTaskExecutionInfo () { TreePath[] selectionPaths = getSelectionPaths(); if (selectionPaths == null || selectionPaths.length == 0) { return null; } Map<String, ExternalTaskExecutionInfo> map = new HashMap<>(); for (TreePath selectionPath : selectionPaths) { Object component = selectionPath.getLastPathComponent(); if (!(component instanceof ExternalSystemNode)) { continue; } Object element = ((ExternalSystemNode)component).getDescriptor().getElement(); if (element instanceof ExternalTaskExecutionInfo taskExecutionInfo) { ExternalSystemTaskExecutionSettings executionSettings = taskExecutionInfo.getSettings(); String key = executionSettings.getExternalSystemIdString() + executionSettings.getExternalProjectPath() + executionSettings.getVmOptions(); ExternalTaskExecutionInfo executionInfo = map.get(key); if(executionInfo == null) { ExternalSystemTaskExecutionSettings taskExecutionSettings = new ExternalSystemTaskExecutionSettings(); taskExecutionSettings.setExternalProjectPath(executionSettings.getExternalProjectPath()); taskExecutionSettings.setExternalSystemIdString(executionSettings.getExternalSystemIdString()); taskExecutionSettings.setVmOptions(executionSettings.getVmOptions()); taskExecutionSettings.setScriptParameters(executionSettings.getScriptParameters()); taskExecutionSettings.setExecutionName(executionSettings.getExecutionName()); executionInfo = new ExternalTaskExecutionInfo(taskExecutionSettings, taskExecutionInfo.getExecutorId()); map.put(key, executionInfo); } executionInfo.getSettings().getTaskNames().addAll(executionSettings.getTaskNames()); executionInfo.getSettings().getTaskDescriptions().addAll(executionSettings.getTaskDescriptions()); } } // Disable tasks execution if it comes from different projects if(map.values().size() != 1) return null; return map.values().iterator().next(); }