class SDNCAssignTasks extends AbstractSDNCTask {

    public void assignVfModule(BuildingBlockExecution execution) {
        try {
            GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
            RequestContext requestContext = gBBInput.getRequestContext();
            ServiceInstance serviceInstance =
                    extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
            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("No volume group was found.");
            }
            Customer customer = gBBInput.getCustomer();
            CloudRegion cloudRegion = gBBInput.getCloudRegion();
            SDNCRequest sdncRequest = new SDNCRequest();
            GenericResourceApiVfModuleOperationInformation req =
                    sdncVfModuleResources.assignVfModule(vfModule, volumeGroup, vnf, serviceInstance, customer,
                            cloudRegion, requestContext, buildCallbackURI(sdncRequest));
            sdncRequest.setSDNCPayload(req);
            sdncRequest.setTopology(SDNCTopology.VFMODULE);
            execution.setVariable(SDNC_REQUEST, sdncRequest);
        } catch (Exception ex) {
            logger.error("Exception occurred", ex);
            exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
        }
    }

}