class SDNCQueryTasks {

    public void queryVnf(BuildingBlockExecution execution) throws BBObjectNotFoundException {
        ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
        GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);

        String selfLink =
                "restconf/config/GENERIC-RESOURCE-API:services/service/" + serviceInstance.getServiceInstanceId()
                        + "/service-data/vnfs/vnf/" + genericVnf.getVnfId() + "/vnf-data/vnf-topology/";
        try {
            if (genericVnf.getSelflink() == null) {
                genericVnf.setSelflink(selfLink);
            }
            String response = sdncVnfResources.queryVnf(genericVnf);
            execution.setVariable(SDNCQUERY_RESPONSE + genericVnf.getVnfId(), response);
        } catch (BadResponseException ex) {
            logger.error("Exception occurred", ex);
            if (!ex.getMessage().equals(NO_RESPONSE_FROM_SDNC)) {
                exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, ONAPComponents.SDNC);
            } else {
                exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, ONAPComponents.SO);
            }
        } catch (Exception ex) {
            logger.error("Exception occurred", ex);
            exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, ONAPComponents.SO);
        }
    }

}