class AAICreateTasks {

    public void connectVfModuleToVolumeGroup(BuildingBlockExecution execution) {
        try {
            GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
            VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
            VolumeGroup volumeGroup = null;
            try {
                volumeGroup = extractPojosForBB.extractByKey(execution, ResourceKey.VOLUME_GROUP_ID);
            } catch (BBObjectNotFoundException e) {
                logger.info("VolumeGroup not found. Skipping Connect between VfModule and VolumeGroup");
            }
            if (volumeGroup != null) {
                logger.debug("Connecting VfModule to VolumGroup");
                aaiVfModuleResources.connectVfModuleToVolumeGroup(vnf, vfModule, volumeGroup,
                        execution.getGeneralBuildingBlock().getCloudRegion());
            }
        } catch (Exception ex) {
            exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
        }
    }

}