Records in the data domain can be updated with one or more new assignments for standard attributes and managed values.
The updateRecords sub-operation, when used with a list of addAssignments elements, allows you to update existing records in the data domain by adding standard attribute values and/or managed values. The element can also create a standard or managed attribute if the attribute to be added does not exist. In this case, it is added with the default values for PDRs.
You can assign multiple values from a given standard attribute only if the attribute is configured as a multi-assign standard attribute. That means that the PDR for the standard attribute has the mdex-property_IsSingleAssign property set to true. If the addAssignments list attempts to assign multiple values to a standard attribute that does not accept multiple values, an error is signaled.
Managed values can be added to records even if the managed attribute to which they belong does not exist in the data domain. In this case, the Data Ingest Web Service automatically creates the managed attribute.
This chapter will document the updateRecords sub-operation. For a description of addOrUpdateRecords, see Adding records after the initial load.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.endeca.com/MDEX/ingest/2/0" xmlns:ns1="http://www.endeca.com/MDEX/XQuery/2009/09"> <soapenv:Header/> <soapenv:Body> <ns:ingestChanges> <ns:updateRecords> <ns:recordSpecifier>?</ns:recordSpecifier> <ns:addAssignments> <ns1:attribute name="?">?</ns1:attribute> </ns:addAssignments> </ns:updateRecords> </ns:ingestChanges> </soapenv:Body> </soapenv:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.endeca.com/MDEX/ingest/2/0" xmlns:ns1="http://www.endeca.com/MDEX/XQuery/2009/09"> <soapenv:Header/> <soapenv:Body> <ns:ingestChanges> <ns:updateRecords> <ns:recordSpecifier>"partID" = 'P123'</ns:recordSpecifier> <ns:addAssignments> <ns1:attribute name="modelNum" type="mdex:int">2562</ns1:attribute> </ns:addAssignments> </ns:updateRecords> </ns:ingestChanges> </soapenv:Body> </soapenv:Envelope>
Note that the attribute type of the modelNum standard attribute is specified, because the standard attribute does not exist and therefore will be created as part of the request.