class VnfAdapterCreateTasks {

    public void createVfModule(BuildingBlockExecution execution) {
        try {
            GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();

            ServiceInstance serviceInstance =
                    gBBInput.getCustomer().getServiceSubscription().getServiceInstances().get(0);
            VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
            GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
            VolumeGroup volumeGroup = null;
            try {
                volumeGroup = extractPojosForBB.extractByKey(execution, ResourceKey.VOLUME_GROUP_ID);
            } catch (BBObjectNotFoundException bbException) {
                logger.error("Exception occurred if bb object not found in VnfAdapterCreateTasks createVfModule ",
                        bbException);
            }
            CloudRegion cloudRegion = gBBInput.getCloudRegion();
            RequestContext requestContext = gBBInput.getRequestContext();
            OrchestrationContext orchestrationContext = gBBInput.getOrchContext();
            String sdncVfModuleQueryResponse = execution.getVariable(SDNCQUERY_RESPONSE + vfModule.getVfModuleId());
            String sdncVnfQueryResponse = execution.getVariable(SDNCQUERY_RESPONSE + genericVnf.getVnfId());

            CreateVfModuleRequest createVfModuleRequest = vnfAdapterVfModuleResources.createVfModuleRequest(
                    requestContext, cloudRegion, orchestrationContext, serviceInstance, genericVnf, vfModule,
                    volumeGroup, sdncVnfQueryResponse, sdncVfModuleQueryResponse);
            execution.setVariable(VNFREST_REQUEST, createVfModuleRequest.toXmlString());
        } catch (Exception ex) {
            logger.error("Exception occurred", ex);
            exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
        }
    }

}