class WorkflowAction {

    protected String validateResourceIdInAAI(String generatedResourceId, WorkflowType type, String instanceName,
            RequestDetails reqDetails, WorkflowResourceIds workflowResourceIds) throws Exception {
        try {
            if ("SERVICE".equalsIgnoreCase(type.toString())) {
                return validateServiceResourceIdInAAI(generatedResourceId, instanceName, reqDetails);
            } else if ("NETWORK".equalsIgnoreCase(type.toString())) {
                return validateNetworkResourceIdInAAI(generatedResourceId, instanceName, reqDetails,
                        workflowResourceIds);
            } else if ("VNF".equalsIgnoreCase(type.toString())) {
                return validateVnfResourceIdInAAI(generatedResourceId, instanceName, reqDetails, workflowResourceIds);
            } else if ("VFMODULE".equalsIgnoreCase(type.toString())) {
                return validateVfModuleResourceIdInAAI(generatedResourceId, instanceName, reqDetails,
                        workflowResourceIds);
            } else if ("VOLUMEGROUP".equalsIgnoreCase(type.toString())) {
                return validateVolumeGroupResourceIdInAAI(generatedResourceId, instanceName, reqDetails,
                        workflowResourceIds);
            } else if ("CONFIGURATION".equalsIgnoreCase(type.toString())) {
                return validateConfigurationResourceIdInAAI(generatedResourceId, instanceName, reqDetails,
                        workflowResourceIds);
            }
            return generatedResourceId;
        } catch (DuplicateNameException dne) {
            throw dne;
        } catch (Exception ex) {
            logger.error(WORKFLOW_ACTION_WAS_UNABLE_TO_VERIFY_IF_THE_INSTANCE_NAME_ALREADY_EXIST_IN_AAI, ex);
            throw new IllegalStateException(
                    WORKFLOW_ACTION_WAS_UNABLE_TO_VERIFY_IF_THE_INSTANCE_NAME_ALREADY_EXIST_IN_AAI);
        }
    }

}