Updating spec values

A request that is intended to update spec values requires the use of one or more AttributeValueBObj objects, and the <Action>, <Path>, and <Value> elements inside the AttributeValueBObj object.

The following request snippet shows the spec values in an update request in a product. The AttributeValueBObj object is wrapped in a ProductSpecValueBObj object. The spec values can be successfully validated against the spec shown in Introduction to using spec values in runtime.
<ProductSpecValueBObj>
    ...
  <AttributeValueBObj>
    <Action>update</Action>
    <Path>/penSpec/penDescription</Path>
    <Value>Sleek, stylish and easy to write with.</Value>
  </AttributeValueBObj>

  <AttributeValueBObj>
    <Action>update</Action>
    <Path>/penSpec/penPhysicalDimensions</Path>
    <Value><![CDATA[
      <penPhysicalDimensions>
        <diameter>8</diameter>
      </penPhysicalDimensions>
      ]]>
    </Value>
  </AttributeValueBObj>
</ProductSpecValueBObj>

For this example, two updates are performed:

  • the value of the penDescription spec value is changed
  • the entire penPhysicalDimensions spec value is updated
When this update is applied to the spec values added in Adding spec values, the updated spec values are:
<penspec:penSpec xmlns="http://www.ibm.com/mdm/data/specs/penSpec/internal/00000001"
            xmlns:penspec="http://www.ibm.com/mdm/data/specs/penSpec/internal/00000001">
  <penId>1</penId>
  <penDescription id="1">Sleek, stylish and easy to write with.</penDescription>
  <penPhysicalDimensions>
    <diameter>8</diameter>
    <length>100</length>
  </penPhysicalDimensions>
  <penType>Ballpoint</penType>
</penspec:penSpec>
Note: Spec values do not prevent redundant updates. Specifically, if an update transaction results in any change to the XML document, even if it results in the exact same XML document, that change will be persisted to the database even though it is redundant.

For an example of an entire runtime request and response that manipulates spec values, see the InfoSphere MDM Transaction Reference Guide.