@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; }
final PositionDTO proposedPosition = requestProcessGroupDTO.getPosition(); if (proposedPosition != null) { if (proposedPosition.getX() == null || proposedPosition.getY() == null) {
@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; }
/** * Updates the process group corresponding to the specified DTO. Any field * in DTO that is <code>null</code> (with the exception of the required ID) * will be ignored. * * @throws IllegalStateException if no process group can be found with the * ID of DTO or with the ID of the DTO's parentGroupId, if the template ID * specified is invalid, or if the DTO's Parent Group ID changes but the * parent group has incoming or outgoing connections * * @throws NullPointerException if the DTO or its ID is null */ private void updateProcessGroup(final ProcessGroup group, final ProcessGroupDTO dto) { final String name = dto.getName(); final PositionDTO position = dto.getPosition(); final String comments = dto.getComments(); if (name != null) { group.setName(name); } if (position != null) { group.setPosition(toPosition(position)); } if (comments != null) { group.setComments(comments); } }
final PositionDTO proposedPosition = requestProcessGroupEntity.getComponent().getPosition(); if (proposedPosition != null) { if (proposedPosition.getX() == null || proposedPosition.getY() == null) {
processGroup.setComments(processGroupDTO.getComments()); processGroup.setVersionedComponentId(processGroupDTO.getVersionedComponentId()); processGroup.setPosition(toPosition(processGroupDTO.getPosition())); processGroup.setName(processGroupDTO.getName()); processGroup.setParent(parentGroup);
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.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())); childGroup.setComments(groupDTO.getComments()); childGroup.setName(groupDTO.getName());