class VnfmAdapterCreateVnfTask {

    public void invokeVnfmAdapter(final BuildingBlockExecution execution) {
        try {
            LOGGER.debug("Executing invokeVnfmAdapter  ...");
            final CreateVnfRequest request = execution.getVariable(CREATE_VNF_REQUEST_PARAM_NAME);

            final GenericVnf vnf = extractPojosForBB.extractByKey(execution, GENERIC_VNF_ID);

            final Optional<CreateVnfResponse> response =
                    vnfmAdapterServiceProvider.invokeCreateInstantiationRequest(vnf.getVnfId(), request);

            if (!response.isPresent()) {
                final String errorMessage = "Unexpected error while processing create and instantiation request";
                LOGGER.error(errorMessage);
                exceptionUtil.buildAndThrowWorkflowException(execution, 1201, errorMessage);
            }

            final CreateVnfResponse vnfResponse = response.get();

            LOGGER.debug("Vnf instantiation response: {}", vnfResponse);
            execution.setVariable(CREATE_VNF_RESPONSE_PARAM_NAME, vnfResponse);

            LOGGER.debug("Finished executing invokeVnfmAdapter ...");
        } catch (final Exception exception) {
            LOGGER.error("Unable to invoke create and instantiation request", exception);
            exceptionUtil.buildAndThrowWorkflowException(execution, 1202, exception);
        }
    }

    @Autowired public  VnfmAdapterCreateVnfTask(final ExceptionBuilder exceptionUtil, final ExtractPojosForBB extractPojosForBB,
            final VnfmAdapterServiceProvider vnfmAdapterServiceProvider);

}