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.getProcessors()); if (contents.getFunnels() != null) { components.addAll(contents.getFunnels());
for (final FunnelDTO funnel : original.getFunnels()) { funnels.add(copy(funnel)); remoteProcessGroups.addAll(copy(original.getRemoteProcessGroups())); if (original.getFunnels() != null) { funnels.addAll(copy(original.getFunnels()));
dto.getFunnels().add(createFunnelDto(funnel));
if (originalSnippet.getFunnels() != null) { for (final FunnelDTO funnel : originalSnippet.getFunnels()) { copySnippet.getFunnels().add(copy(funnel));
fsDTO.controllerServices = this.orderedById(fsDTO.getControllerServices()); this.removeInstanceIdentifierIfNecessary(fsDTO.getFunnels()); fsDTO.funnels = this.orderedById(fsDTO.getFunnels());
for (final FunnelDTO snippetFunnel : snippet.getFunnels()) { final Funnel funnel = group.getFunnel(snippetFunnel.getId());
rollbackClonedPolicy(ResourceFactory.getComponentResource(ResourceType.ControllerService, controllerServiceDTO.getId(), controllerServiceDTO.getName())); }); snippet.getFunnels().forEach(funnelDTO -> { rollbackClonedPolicy(ResourceFactory.getComponentResource(ResourceType.Funnel, funnelDTO.getId(), funnelDTO.getId())); });
for (final FunnelDTO funnel : snippet.getFunnels()) { actions.add(generateAuditRecord(funnel.getId(), StringUtils.EMPTY, Component.Funnel, Operation.Add, timestamp));
if (snippetContents.getFunnels() != null) { for (final FunnelDTO funnelDTO : snippetContents.getFunnels()) { final FunnelDTO cp = dtoFactory.copy(funnelDTO); cp.setId(generateId(funnelDTO.getId(), idGenerationSeed, isCopy));
for (final FunnelDTO funnelDTO : dto.getFunnels()) { final Funnel funnel = flowManager.createFunnel(funnelDTO.getId()); funnel.setPosition(toPosition(funnelDTO.getPosition())); childTemplateDTO.setProcessGroups(contents.getProcessGroups()); childTemplateDTO.setProcessors(contents.getProcessors()); childTemplateDTO.setFunnels(contents.getFunnels()); childTemplateDTO.setRemoteProcessGroups(contents.getRemoteProcessGroups()); childTemplateDTO.setControllerServices(contents.getControllerServices());
.collect(Collectors.toList())); map.put(CommonPropertyKeys.FUNNELS_KEY, CollectionUtil.nullToEmpty(snippet.getFunnels()).stream() .map(funnelSchemaFunction) .sorted(Comparator.comparing(FunnelSchema::getId))
.collect(Collectors.toList())); map.put(CommonPropertyKeys.FUNNELS_KEY, CollectionUtil.nullToEmpty(snippet.getFunnels()).stream() .map(funnelSchemaFunction) .sorted(Comparator.comparing(FunnelSchema::getId))