Service attributes serve the same role as normal element attributes. They allow you to attach specific data to particular DSM elements and access those data by names.
However, unlike normal DSM attributes, service attributes are not provided by the DSM driver and not connected to the external data source.
Rather, service attributes are maintained by the generator in the form of a special hash-map.
That hash-map is actually very simple. Each service attribute is represented by a two-part key: { attrName; element.id }, where 'attrName' is the attribute name; 'element.id' is the unique identifier of the DSM element, to which the attribute is attached. Such a key is mapped to the attribute value. |
Service attributes have the following properties:
null
.
getServiceAttr()
function.
The following functions are available to work with service attributes:
setServiceAttr()
Associates a service attribute with the specified name and value to the specified element.
getServiceAttr()
Returns the value of a service attribute with the specified name attached to the specified element.
hasServiceAttr()
Tests if there is a service attribute with the specified name attached to the specified element.
removeServiceAttr()
Deletes a service attribute with the specified name attached to the specified element.