+ // we check null in processNB
+ var outputKeyMapping = sourceProperties.outputKeyMapping!!
+
+ var responseNode: JsonNode? = if (outputKeyMapping.isEmpty()) {
+ var tmpResponseNode = if (type == BluePrintConstants.DATA_TYPE_JSON || type == BluePrintConstants.DATA_TYPE_MAP)
+ JacksonUtils.jsonNode(restResponse).at(path)
+ else
+ JacksonUtils.convertPrimitiveResourceValue(type, restResponse).at(path)
+ if (type == BluePrintConstants.DATA_TYPE_JSON || type == BluePrintConstants.DATA_TYPE_MAP) {
+ if (tmpResponseNode.isObject) {
+ logger.info("Creating substitute outputKeyMapping for $type type")
+ outputKeyMapping = HashMap<String, String>()
+ tmpResponseNode.fieldNames().forEach {
+ outputKeyMapping[it] = it
+ }
+ tmpResponseNode
+ } else {
+ val errMsg =
+ "Failed to get $dSource result for dictionary name ($dName): response is not a JSON object"
+ logger.warn(errMsg)
+ throw BluePrintProcessorException(errMsg)
+ }
+ } else {
+ logger.info("Wrapping output for the dictionary name (${resourceAssignment.name})")
+ val newNode = jacksonObjectMapper().createObjectNode()
+ newNode.replace(dName, tmpResponseNode)
+ outputKeyMapping[dName!!] = dName
+ newNode
+ }
+ } else
+ JacksonUtils.jsonNode(restResponse).at(path)
+ responseNode = checkNotNull(responseNode) {
+ "Failed to find path ($path) in response ($responseNode)"