@Override public ResolvedReference resolve(final CommandOption option, final Integer position) { final ProcessGroupDTO pg = backRefs.get(position); if (pg != null) { return new ResolvedReference(option, position, pg.getName(), pg.getId()); } else { return null; } }
@Override public void verifyUpdateProcessGroup(ProcessGroupDTO processGroupDTO) { if (processGroupDAO.hasProcessGroup(processGroupDTO.getId())) { processGroupDAO.verifyUpdate(processGroupDTO); } }
.forEach(id -> identifiers.add(id)); snippet.getProcessGroups().stream() .map(group -> group.getId()) .forEach(id -> identifiers.add(id)); snippet.getRemoteProcessGroups().stream()
@Override protected void writeSimpleResult(final PrintStream output) { final Table table = new Table.Builder() .column("#", 3, 3, false) .column("Name", 20, 36, true) .column("Id", 36, 36, false) .column("Running", 7, 7, false) .column("Stopped", 7, 7, false) .column("Disabled", 8, 8, false) .column("Invalid", 7, 7, false) .build(); for (int i=0; i < processGroups.size(); i++) { final ProcessGroupDTO dto = processGroups.get(i); table.addRow( String.valueOf(i+1), dto.getName(), dto.getId(), String.valueOf(dto.getRunningCount()), String.valueOf(dto.getStoppedCount()), String.valueOf(dto.getDisabledCount()), String.valueOf(dto.getInvalidCount()) ); } final TableWriter tableWriter = new DynamicTableWriter(); tableWriter.write(table, output); }
@Override public ProcessGroupEntity updateProcessGroup(final Revision revision, final ProcessGroupDTO processGroupDTO) { final ProcessGroup processGroupNode = processGroupDAO.getProcessGroup(processGroupDTO.getId()); final RevisionUpdate<ProcessGroupDTO> snapshot = updateComponent(revision, processGroupNode, () -> processGroupDAO.updateProcessGroup(processGroupDTO), processGroup -> dtoFactory.createProcessGroupDto(processGroup)); final PermissionsDTO permissions = dtoFactory.createPermissionsDto(processGroupNode); final RevisionDTO updatedRevision = dtoFactory.createRevisionDTO(snapshot.getLastModification()); final ProcessGroupStatusDTO status = dtoFactory.createConciseProcessGroupStatusDto(controllerFacade.getProcessGroupStatus(processGroupNode.getIdentifier())); final List<BulletinDTO> bulletins = dtoFactory.createBulletinDtos(bulletinRepository.findBulletinsForSource(processGroupNode.getIdentifier())); final List<BulletinEntity> bulletinEntities = bulletins.stream().map(bulletin -> entityFactory.createBulletinEntity(bulletin, permissions.getCanRead())).collect(Collectors.toList()); return entityFactory.createProcessGroupEntity(snapshot.getComponent(), updatedRevision, permissions, status, bulletinEntities); }
@Override public ProcessGroupEntity createProcessGroup(final Revision revision, final String parentGroupId, final ProcessGroupDTO processGroupDTO) { final RevisionUpdate<ProcessGroupDTO> snapshot = createComponent( revision, processGroupDTO, () -> processGroupDAO.createProcessGroup(parentGroupId, processGroupDTO), processGroup -> dtoFactory.createProcessGroupDto(processGroup)); final ProcessGroup processGroup = processGroupDAO.getProcessGroup(processGroupDTO.getId()); final PermissionsDTO permissions = dtoFactory.createPermissionsDto(processGroup); final ProcessGroupStatusDTO status = dtoFactory.createConciseProcessGroupStatusDto(controllerFacade.getProcessGroupStatus(processGroup.getIdentifier())); final List<BulletinDTO> bulletins = dtoFactory.createBulletinDtos(bulletinRepository.findBulletinsForSource(processGroup.getIdentifier())); final List<BulletinEntity> bulletinEntities = bulletins.stream().map(bulletin -> entityFactory.createBulletinEntity(bulletin, permissions.getCanRead())).collect(Collectors.toList()); return entityFactory.createProcessGroupEntity(snapshot.getComponent(), dtoFactory.createRevisionDTO(snapshot.getLastModification()), permissions, status, bulletinEntities); }
public ProcessGroup updateProcessGroupAdvice(ProceedingJoinPoint proceedingJoinPoint, ProcessGroupDTO processGroupDTO) throws Throwable { ProcessGroupDAO processGroupDAO = getProcessGroupDAO(); ProcessGroup processGroup = processGroupDAO.getProcessGroup(processGroupDTO.getId());
final ProcessGroup processGroup = group.getProcessGroup(snippetProcessGroup.getId());
if (requestProcessGroupEntity.getComponent().getId() != null) { throw new IllegalArgumentException("Process group ID cannot be specified."); final Revision revision = getRevision(processGroupEntity, processGroup.getId()); ProcessGroupEntity entity = serviceFacade.createProcessGroup(revision, groupId, processGroup); final String newGroupId = entity.getComponent().getId(); final Revision newGroupRevision = new Revision(revisionDto.getVersion(), revisionDto.getClientId(), newGroupId);
}); snippet.getProcessGroups().forEach(processGroupDTO -> { rollbackClonedPolicy(ResourceFactory.getComponentResource(ResourceType.ProcessGroup, processGroupDTO.getId(), processGroupDTO.getName()));
actions.add(generateAuditRecord(processGroup.getId(), processGroup.getName(), Component.ProcessGroup, Operation.Add, timestamp));
@Override public ProcessGroup createProcessGroup(String parentGroupId, ProcessGroupDTO processGroup) { final FlowManager flowManager = flowController.getFlowManager(); if (processGroup.getParentGroupId() != null && !flowManager.areGroupsSame(processGroup.getParentGroupId(), parentGroupId)) { throw new IllegalArgumentException("Cannot specify a different Parent Group ID than the Group to which the Process Group is being added."); } // get the parent group ProcessGroup parentGroup = locateProcessGroup(flowController, parentGroupId); // create the process group ProcessGroup group = flowManager.createProcessGroup(processGroup.getId()); if (processGroup.getName() != null) { group.setName(processGroup.getName()); } if (processGroup.getPosition() != null) { group.setPosition(new Position(processGroup.getPosition().getX(), processGroup.getPosition().getY())); } // add the process group group.setParent(parentGroup); parentGroup.addProcessGroup(group); return group; }
@Override public ProcessGroup updateProcessGroup(ProcessGroupDTO processGroupDTO) { final ProcessGroup group = locateProcessGroup(flowController, processGroupDTO.getId()); final String name = processGroupDTO.getName(); final String comments = processGroupDTO.getComments(); if (isNotNull(name)) { group.setName(name); } if (isNotNull(processGroupDTO.getPosition())) { group.setPosition(new Position(processGroupDTO.getPosition().getX(), processGroupDTO.getPosition().getY())); final ProcessGroup parent = group.getParent(); if (parent != null) { parent.onComponentModified(); } } if (isNotNull(comments)) { group.setComments(comments); } group.onComponentModified(); return group; }
for (final ProcessGroupDTO groupDTO : snippetContents.getProcessGroups()) { final ProcessGroupDTO cp = dtoFactory.copy(groupDTO, false); cp.setId(generateId(groupDTO.getId(), idGenerationSeed, isCopy)); cp.setParentGroupId(groupId); final FlowSnippetDTO contentsCopy = copyContentsForGroup(groupDTO.getContents(), cp.getId(), connectableMap, serviceIdMap, idGenerationSeed, isCopy); cp.setContents(contentsCopy); groups.add(cp); ResourceFactory.getComponentResource(ResourceType.ProcessGroup, groupDTO.getId(), groupDTO.getName()), ResourceFactory.getComponentResource(ResourceType.ProcessGroup, cp.getId(), cp.getName()), idGenerationSeed);
public ProcessGroupDTO copy(final ProcessGroupDTO original, final boolean deep) { final ProcessGroupDTO copy = new ProcessGroupDTO(); copy.setComments(original.getComments()); copy.setContents(copy(original.getContents(), deep)); copy.setPosition(original.getPosition()); copy.setId(original.getId()); copy.setInputPortCount(original.getInputPortCount()); copy.setInvalidCount(original.getInvalidCount()); copy.setName(original.getName()); copy.setVersionControlInformation(copy(original.getVersionControlInformation())); copy.setOutputPortCount(original.getOutputPortCount()); copy.setParentGroupId(original.getParentGroupId()); copy.setVersionedComponentId(original.getVersionedComponentId()); copy.setRunningCount(original.getRunningCount()); copy.setStoppedCount(original.getStoppedCount()); copy.setDisabledCount(original.getDisabledCount()); copy.setActiveRemotePortCount(original.getActiveRemotePortCount()); copy.setInactiveRemotePortCount(original.getInactiveRemotePortCount()); copy.setUpToDateCount(original.getUpToDateCount()); copy.setLocallyModifiedCount(original.getLocallyModifiedCount()); copy.setStaleCount(original.getStaleCount()); copy.setLocallyModifiedAndStaleCount(original.getLocallyModifiedAndStaleCount()); copy.setSyncFailureCount(original.getSyncFailureCount()); if (original.getVariables() != null) { copy.setVariables(new HashMap<>(original.getVariables())); } return copy; }
entity.setPermissions(permissions); entity.setStatus(status); entity.setId(dto.getId()); entity.setPosition(dto.getPosition());
final ProcessGroup childGroup = flowManager.createProcessGroup(groupDTO.getId()); childGroup.setParent(group); childGroup.setPosition(toPosition(groupDTO.getPosition()));