private static boolean isEmpty(final ProcessGroupDTO dto) { if (dto == null) { return true; } final FlowSnippetDTO contents = dto.getContents(); if (contents == null) { return true; } return CollectionUtils.isEmpty(contents.getProcessors()) && CollectionUtils.isEmpty(contents.getConnections()) && CollectionUtils.isEmpty(contents.getFunnels()) && CollectionUtils.isEmpty(contents.getLabels()) && CollectionUtils.isEmpty(contents.getOutputPorts()) && CollectionUtils.isEmpty(contents.getProcessGroups()) && CollectionUtils.isEmpty(contents.getProcessors()) && CollectionUtils.isEmpty(contents.getRemoteProcessGroups()); }
components.addAll(contents.getLabels()); if (contents.getOutputPorts() != null) { components.addAll(contents.getOutputPorts());
.map(port -> port.getId()) .forEach(id -> identifiers.add(id)); snippet.getOutputPorts().stream() .map(port -> port.getId()) .forEach(id -> identifiers.add(id));
public void validate(final ProcessGroup group) { // validate the names of Input Ports for (final PortDTO port : dto.getInputPorts()) { if (group.getInputPortByName(port.getName()) != null) { throw new IllegalStateException("One or more of the proposed Port names is not available in the process group"); } } // validate the names of Output Ports for (final PortDTO port : dto.getOutputPorts()) { if (group.getOutputPortByName(port.getName()) != null) { throw new IllegalStateException("One or more of the proposed Port names is not available in the process group"); } } verifyComponentTypesInSnippet(); SnippetUtils.verifyNoVersionControlConflicts(dto, group); }
if (snippetContents.getOutputPorts() != null) { for (final PortDTO portDTO : snippetContents.getOutputPorts()) { String portName = portDTO.getName(); while (existingPortNames.contains(portName)) {
for (final PortDTO port : original.getOutputPorts()) { outputPorts.add(copy(port)); inputPorts.addAll(copy(original.getInputPorts())); if (original.getOutputPorts() != null) { outputPorts.addAll(copy(original.getOutputPorts()));
if (flow.getOutputPorts() != null) { for (final PortDTO portDTO : flow.getOutputPorts()) { final Port port = outputPortDAO.getPort(portDTO.getId()); final Collection<ValidationResult> validationErrors = port.getValidationErrors();
dto.getOutputPorts().add(createPortDto(outputPort));
if (originalSnippet.getOutputPorts() != null) { for (final PortDTO port : originalSnippet.getOutputPorts()) { copySnippet.getOutputPorts().add(copy(port));
fsDTO.labels = this.orderedById(fsDTO.getLabels()); this.removeInstanceIdentifierIfNecessary(fsDTO.getOutputPorts()); fsDTO.outputPorts = this.orderedById(fsDTO.getOutputPorts());
for (final PortDTO snippetOutputPort : snippet.getOutputPorts()) { final Port outputPort = group.getOutputPort(snippetOutputPort.getId());
rollbackClonedPolicy(ResourceFactory.getComponentResource(ResourceType.Label, labelDTO.getId(), labelDTO.getLabel())); }); snippet.getOutputPorts().forEach(outputPortDTO -> { rollbackClonedPolicy(ResourceFactory.getComponentResource(ResourceType.OutputPort, outputPortDTO.getId(), outputPortDTO.getName())); });
for (final PortDTO outputPort : snippet.getOutputPorts()) { actions.add(generateAuditRecord(outputPort.getId(), outputPort.getName(), Component.OutputPort, Operation.Add, timestamp));
if (snippetContents.getOutputPorts() != null) { for (final PortDTO portDTO : snippetContents.getOutputPorts()) { final PortDTO cp = dtoFactory.copy(portDTO); cp.setId(generateId(portDTO.getId(), idGenerationSeed, isCopy));
for (final PortDTO portDTO : dto.getOutputPorts()) { final Port outputPort; if (group.isRootGroup()) { childTemplateDTO.setInputPorts(contents.getInputPorts()); childTemplateDTO.setLabels(contents.getLabels()); childTemplateDTO.setOutputPorts(contents.getOutputPorts()); childTemplateDTO.setProcessGroups(contents.getProcessGroups()); childTemplateDTO.setProcessors(contents.getProcessors());
.collect(Collectors.toList())); map.put(OUTPUT_PORTS_KEY, nullToEmpty(snippet.getOutputPorts()).stream() .map(outputPortSchemaFunction) .sorted(Comparator.comparing(PortSchema::getName))
.collect(Collectors.toList())); map.put(OUTPUT_PORTS_KEY, nullToEmpty(snippet.getOutputPorts()).stream() .map(outputPortSchemaFunction) .sorted(Comparator.comparing(PortSchema::getName))