Adding custom attributes
The BMC Atrium Discovery data model allows additional attributes to be added nodes. You should only ever add additional attributes to inferred nodes. You must never update DDD nodes.
Attributes may be added by patterns at any point in time. It is strongly recommended that you add attributes at creation time when building your own inferred nodes. Modifying system created inferred nodes must be done after creation using a separate pattern.
Once you have modified the node it is necessary to make the attribute visible. There are two ways to do this:
- Updating the taxonomy by adding a custom taxonomy extension, or
- Populating the
_tw_meta_data_attrsattribute on the inferred node.
You must ensure only one pattern modifies the
_tw_meta_data_attrs value on a particular node otherwise the conflicting changes are likely to result in the loss of one of the updates.
To add a custom attribute at node creation
Adding a custom attribute when a node is created is shown in the example below.
To add a custom attribute after node creation
You can also add a custom attribute to a node after it is created. This may be in the pattern that creates the node, or where you are adding an attribute to a system created node, in a separate pattern.
To add a list of attributes
The following example code shows how to add a list of attributes to an existing node. The code creates a list, adds values, and assigns it at once.