class WorkflowAction {

    protected String validateConfigurationResourceIdInAAI(String generatedResourceId, String instanceName,
            RequestDetails reqDetails, WorkflowResourceIds workflowResourceIds) throws DuplicateNameException {
        Optional<org.onap.aai.domain.yang.Configuration> configuration =
                bbInputSetupUtils.getRelatedConfigurationByNameFromServiceInstance(
                        workflowResourceIds.getServiceInstanceId(), instanceName);
        if (configuration.isPresent()) {
            if (configuration.get().getModelCustomizationId()
                    .equalsIgnoreCase(reqDetails.getModelInfo().getModelCustomizationId())) {
                return configuration.get().getConfigurationId();
            } else {
                throw new DuplicateNameException("configuration", String.format(NAME_EXISTS_WITH_DIFF_CUSTOMIZATION_ID,
                        instanceName, configuration.get().getConfigurationId()));
            }
        }
        if (bbInputSetupUtils.existsAAIConfigurationGloballyByName(instanceName)) {
            throw new DuplicateNameException("configuration", instanceName);
        }
        return generatedResourceId;
    }

}