class ActivateVnfOperationalEnvironment {

    public void processActivateSDCRequest(String requestId, String operationalEnvironmentId,
            List<ServiceModelList> serviceModelVersionIdList, String workloadContext,
            String vnfOperationalEnvironmentId) throws ApiException {

        JSONObject jsonResponse = null;
        int retryCount = 0;
        try {
            retryCount = Integer.parseInt(sdcRetryCount);
        } catch (NumberFormatException e) {
            retryCount = DEFAULT_ACTIVATE_RETRY_COUNT;
        }

        // loop through the serviceModelVersionId, and send request SDC
        for (ServiceModelList serviceModelList : serviceModelVersionIdList) {
            String serviceModelVersionId = serviceModelList.getServiceModelVersionId();
            String recoveryAction = serviceModelList.getRecoveryAction().toString().toUpperCase();

            // should insert 1 row
            OperationalEnvServiceModelStatus serviceModelStatus =
                    dbHelper.insertRecordToOperationalEnvServiceModelStatus(requestId, operationalEnvironmentId,
                            serviceModelVersionId, DISTRIBUTION_STATUS_SENT, recoveryAction, retryCount,
                            workloadContext, vnfOperationalEnvironmentId);
            client.save(serviceModelStatus);

            String distributionId = "";

            jsonResponse = sdcClientHelper.postActivateOperationalEnvironment(serviceModelVersionId,
                    operationalEnvironmentId, workloadContext);

            String statusCode = jsonResponse.get("statusCode").toString();
            if (statusCode.equals(String.valueOf(Response.Status.ACCEPTED.getStatusCode()))) {
                distributionId = jsonResponse.get("distributionId").toString();
                // should insert 1 row
                OperationalEnvDistributionStatus distStatus = dbHelper.insertRecordToOperationalEnvDistributionStatus(
                        distributionId, operationalEnvironmentId, serviceModelVersionId, requestId,
                        DISTRIBUTION_STATUS_SENT, "");
                client.save(distStatus);

            } else {
                ErrorLoggerInfo errorLoggerInfo =
                        new ErrorLoggerInfo.Builder(MessageEnum.APIH_GENERAL_EXCEPTION, ErrorCode.BusinessProcessError)
                                .build();
                String dbErrorMessage = " Failure calling SDC: statusCode: " + statusCode + "; messageId: "
                        + jsonResponse.get("messageId") + "; message: " + jsonResponse.get("message");

                requestDb.updateInfraFailureCompletion(dbErrorMessage, requestId, operationalEnvironmentId);
                throw new ValidateException.Builder(dbErrorMessage, HttpStatus.SC_BAD_REQUEST,
                        ErrorNumbers.SVC_DETAILED_SERVICE_ERROR).errorInfo(errorLoggerInfo).build();
            }
        }

    }

}