Update logic

The update logic is as follows.

For each attribute metadata definition contained in the supplied array:

  1. If the attribute name does not match an existing metadata that is bound to the component, do the following based on the allowCreate parameter value:
    1. True: create a new metadata definition. Functionally identical to using the createAttributeMetadata() request.
    2. False: throw AttributeNotFoundException.
  2. If the attribute metadata data type is different, throw InvalidAttributeException.
  3. Attempt to overwrite the existing attribute metadata definition with the field values of the supplied metadata, else throw InvalidAttributeException. Only the following updates are supported (else throw InvalidAttributeException):
    1. name: cannot be changed (name is the key!).
    2. displayName: accept new value.
    3. description: accept new value.
    4. isRequired: only allow change from true to false.
    5. isInternal: accept new value.
    6. isGenerated: no change allowed.
    7. attributeTypeEnum: no change allowed.
    8. accessTypeEnum: accept new value.
    9. selectTypeEnum: accept these transitions if options are provided:
      1. NONE to SINGLE_SELECT or MULTIPLE_SELECT
      2. SINGLE_SELECT to MULTIPLE_SELECT
    10. options: options may be added, but not deleted. Only the following option changes are supported (as per value match):
      1. displayName: accept new value (no ripple).
      2. description: accept new value (no ripple).
      3. isDefault: accept new value; however must match SelectTypeEnum.
      4. value: no change is allowed (value is the key!).
    11. defaultValue(flowcharts only): accept the new default value.
    12. maximumLength(text only): accept the new length if larger.
  4. If the attribute metadata definition is not internally consistent, then throw InvalidAttributeException.
  5. If necessary, find all component instances that reference the updated attribute metadata, and update as appropriate.
Note: In the event of an exception, none of the updates is committed.

In all cases, the attribute update operation is subject to the usual security constraints and validation.

See createAttributeMetadata(), deleteAttributeMetadata()