Keyed Rewrite Write Response

When a webservice creates or updates data it typically replies with the fully populated record. The Keyed Response provides ability to consume a response which is of a different order to it being written (as opposed to the Sequential Response which assumes the response is in order of the data being written).

For example a list of records (customer, supplier, product) are sent to a webservice for inserting/updating, the response may in reverse order i.e. the first record in the request is the last in the response.

The response is matched to the IMan data by marking a field as a 'Key' field. The key field uniquely identifies record within siblings of the same transaction type, where each transaction type can be marked with a single 'Key' field.

Keyed rewrite requires the response include a (unique) value which can be matched back to the IMan dataset, otherwise the rewrite will simply not succeed. Examples include a unique incrementing value for each record, a Customer, Supplier or Product id.

Configuring the ReSponse

The response is parsed using JPath. The response works in the same fashion as the JSON Reader in the sense there is an Initial Path, Transaction Path(s) and Field Paths for parsing and iterating the data.

The exception is that all paths are relative; non-relative property/node access is not supported.

The screenshot below shows the response in reverse sequence to the transactions which were written.

Initial Path

The initial specifies the path (JPath or XPath) to the first array or repeating set of nodes.

Transaction Path

The Transaction Path specifies the path to the property/node to an array or repeating set of nodes. The path is relative to relative to the parent Transaction Type or the Initial JPath if it's the top most Transaction Type.

Transactions are updated in order they appear in the response. I.e. IMan expects the response to order the elements in the order as the request.

If the service responds with less transactions than the original request only the first X transactions in IMan will be updated, where X is the number of elements in the response.

Is Rewrite Key Field

Designates the field is the 'key' field used to match the response to the IMan data.

A transaction type which does not have a 'Key' field will not be processed (irrespective of any other setup), and nor will any children being processed.

Response Field Path

The field path specifies the path to the property/node in the response relative to the Transaction Path.

Only those fields which have a populated Return Path will have a value written back.