class BBInputSetup implements JavaDelegate {

    protected GeneralBuildingBlock getGBBMacro(ExecuteBuildingBlock executeBB, RequestDetails requestDetails,
            Map<ResourceKey, String> lookupKeyMap, String requestAction, String resourceId, String vnfType)
            throws Exception {
        String bbName = executeBB.getBuildingBlock().getBpmnFlowName();
        String key = executeBB.getBuildingBlock().getKey();

        if (requestAction.equalsIgnoreCase("deleteInstance") || requestAction.equalsIgnoreCase("unassignInstance")
                || requestAction.equalsIgnoreCase("activateInstance")
                || requestAction.equalsIgnoreCase("activateFabricConfiguration")
                || requestAction.equalsIgnoreCase("recreateInstance")
                || requestAction.equalsIgnoreCase("replaceInstance")) {
            return getGBBMacroExistingService(executeBB, lookupKeyMap, bbName, requestAction,
                    requestDetails.getCloudConfiguration());
        }

        String serviceInstanceId = lookupKeyMap.get(ResourceKey.SERVICE_INSTANCE_ID);
        GeneralBuildingBlock gBB =
                this.getGBBALaCarteService(executeBB, requestDetails, lookupKeyMap, requestAction, serviceInstanceId);
        RequestParameters requestParams = requestDetails.getRequestParameters();
        Service service = null;
        if (gBB != null && gBB.getServiceInstance() != null
                && gBB.getServiceInstance().getModelInfoServiceInstance() != null
                && gBB.getServiceInstance().getModelInfoServiceInstance().getModelUuid() != null) {
            service = bbInputSetupUtils.getCatalogServiceByModelUUID(
                    gBB.getServiceInstance().getModelInfoServiceInstance().getModelUuid());
        } else {
            throw new Exception("Could not get service instance for macro request");
        }
        if (requestParams != null && requestParams.getUserParams() != null) {
            for (Map<String, Object> userParams : requestParams.getUserParams()) {
                if (userParams.containsKey("service")) {
                    String input = mapper.writeValueAsString(userParams.get("service"));
                    return getGBBMacroUserParams(executeBB, requestDetails, lookupKeyMap, vnfType, bbName, key, gBB,
                            requestParams, service, input);
                }
            }
        }
        if (requestAction.equalsIgnoreCase("deactivateInstance")) {
            return gBB;
        } else if (requestAction.equalsIgnoreCase("createInstance")) {
            return getGBBMacroNoUserParamsCreate(executeBB, lookupKeyMap, bbName, key, gBB, service);
        } else {
            throw new IllegalArgumentException(
                    "No user params on requestAction: assignInstance. Please specify user params.");
        }
    }

}