class StandardFDProcessGroupFlowService implements FDProcessGroupFlowService {

    @Override
    public FDProcessGroupFlow get(final String flowId, final String processGroupId, final boolean includeChildren) {
        // Locate the flow where the process group is located
        final Optional<FDFlow> flowOptional = flowManager.getFlow(flowId);
        if (!flowOptional.isPresent()) {
            throw new ResourceNotFoundException("A flow does not exist with the given id");
        }

        final FDFlow flow = flowOptional.get();
        final FDFlowMetadata flowMetadata = flow.getFlowMetadata();
        final VersionedProcessGroup flowContents = flow.getFlowContent();
        final FDVersionInfo versionInfo = flow.getVersionInfo();
        final BigInteger localFlowRevision = flow.getLocalFlowRevision();

        // Locate the requested process group with in the flow, or throw an exception
        final VersionedProcessGroup versionedProcessGroup = ROOT_GROUP_ID.equals(processGroupId)
                ? flowContents : ComponentUtils.getProcessGroupOrNotFound(processGroupId, flowContents);

        // Convert the VersionedProcessGroup to an FDProcessGroupFlowContent object
        final FDProcessGroupFlowContent processGroupFlowConfig = createProcessGroupFlowConfig(flow, versionedProcessGroup, includeChildren);

        // Create the overall process group flow to wrap metadata and content
        final FDProcessGroupFlow processGroupFlow = new FDProcessGroupFlow();
        processGroupFlow.setFlowContent(processGroupFlowConfig);
        processGroupFlow.setFlowMetadata(flowMetadata);
        processGroupFlow.setVersionInfo(versionInfo);
        processGroupFlow.setLocalFlowRevision(localFlowRevision);
        return  processGroupFlow;
    }

    @Autowired public  StandardFDProcessGroupFlowService(final FDFlowManager flowManager,
                                             final FDProcessorService processorService,
                                             final FDControllerServiceService controllerServiceService,
                                             final ValidationService validationService,
                                             final ControllerServiceLookup serviceLookup);

}