class MonitorVnfmCreateJobTask extends MonitorVnfmJobTask {

    public void checkIfOperationWasSuccessful(final BuildingBlockExecution execution) {
        LOGGER.debug("Executing checkIfOperationWasSuccessful  ...");
        final Optional<OperationStateEnum> operationStatusOption = execution.getVariable(OPERATION_STATUS_PARAM_NAME);
        final CreateVnfResponse vnfInstantiateResponse = execution.getVariable(CREATE_VNF_RESPONSE_PARAM_NAME);
        if (operationStatusOption == null || !operationStatusOption.isPresent()) {
            final String message = "Unable to instantiate jobId: "
                    + (vnfInstantiateResponse != null ? vnfInstantiateResponse.getJobId() : "null")
                    + "Unable to retrieve OperationStatus";
            LOGGER.error(message);
            exceptionUtil.buildAndThrowWorkflowException(execution, 1206, message);
        } else if (operationStatusOption != null && operationStatusOption.isPresent()) {
            final OperationStateEnum operationStatus = operationStatusOption.get();
            if (operationStatus != OperationStateEnum.COMPLETED) {
                final String message = "Unable to instantiate jobId: "
                        + (vnfInstantiateResponse != null ? vnfInstantiateResponse.getJobId() : "null")
                        + " OperationStatus: " + operationStatus;
                LOGGER.error(message);
                exceptionUtil.buildAndThrowWorkflowException(execution, 1207, message);
            }
            LOGGER.debug("Successfully completed instatiation of job {}", vnfInstantiateResponse);
        }
    }

    @Autowired public  MonitorVnfmCreateJobTask(final VnfmAdapterServiceProvider vnfmAdapterServiceProvider,
            final ExceptionBuilder exceptionUtil);

}