Update logic
The update logic is as follows.
For each attribute metadata definition contained in the supplied array:
- 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:
- True: create a new metadata definition. Functionally identical
to using the
createAttributeMetadata()
request. - False: throw AttributeNotFoundException.
- True: create a new metadata definition. Functionally identical
to using the
- If the attribute metadata data type is different, throw InvalidAttributeException.
- 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):
- name: cannot be changed (name is the key!).
- displayName: accept new value.
- description: accept new value.
- isRequired: only allow change from true to false.
- isInternal: accept new value.
- isGenerated: no change allowed.
- attributeTypeEnum: no change allowed.
- accessTypeEnum: accept new value.
- selectTypeEnum: accept these transitions if options are
provided:
- NONE to SINGLE_SELECT or MULTIPLE_SELECT
- SINGLE_SELECT to MULTIPLE_SELECT
- options: options may be added, but not deleted. Only the
following option changes are supported (as per value match):
- displayName: accept new value (no ripple).
- description: accept new value (no ripple).
- isDefault: accept new value; however must match SelectTypeEnum.
- value: no change is allowed (value is the key!).
- defaultValue(flowcharts only): accept the new default value.
- maximumLength(text only): accept the new length if larger.
- If the attribute metadata definition is not internally consistent, then throw InvalidAttributeException.
- 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()