class BBInputSetup implements JavaDelegate {

    protected GeneralBuildingBlock populateGBBWithSIAndAdditionalInfo(BBInputSetupParameter parameter)
            throws Exception {
        GeneralBuildingBlock outputBB = new GeneralBuildingBlock();
        OrchestrationContext orchContext = mapperLayer.mapOrchestrationContext(parameter.getRequestDetails());
        RequestContext requestContext = mapperLayer.mapRequestContext(parameter.getRequestDetails());
        requestContext.setAction(parameter.getRequestAction());
        requestContext.setMsoRequestId(parameter.getExecuteBB().getRequestId());
        requestContext.setIsHelm(parameter.getIsHelm());
        org.onap.aai.domain.yang.CloudRegion aaiCloudRegion =
                bbInputSetupUtils.getCloudRegion(parameter.getRequestDetails().getCloudConfiguration());
        CloudRegion cloudRegion =
                mapperLayer.mapCloudRegion(parameter.getRequestDetails().getCloudConfiguration(), aaiCloudRegion);
        Tenant tenant = getTenant(parameter.getRequestDetails().getCloudConfiguration(), aaiCloudRegion);
        outputBB.setOrchContext(orchContext);
        outputBB.setRequestContext(requestContext);
        outputBB.setCloudRegion(cloudRegion);
        outputBB.setTenant(tenant);
        Customer customer = parameter.getCustomer();
        if (customer == null) {
            Map<String, String> uriKeys = bbInputSetupUtils
                    .getURIKeysFromServiceInstance(parameter.getServiceInstance().getServiceInstanceId());
            String globalCustomerId = uriKeys.get(AAIFluentTypeBuilder.Types.CUSTOMER.getUriParams().globalCustomerId);
            String subscriptionServiceType =
                    uriKeys.get(AAIFluentTypeBuilder.Types.SERVICE_SUBSCRIPTION.getUriParams().serviceType);
            customer = mapCustomer(globalCustomerId, subscriptionServiceType);
        }
        outputBB.setServiceInstance(parameter.getServiceInstance());
        if (customer.getServiceSubscription() != null) {
            customer.getServiceSubscription().getServiceInstances().add(parameter.getServiceInstance());
        }
        outputBB.setCustomer(customer);
        return outputBB;
    }

}