AssetRelation Object
Represents a directed relation between two assets.

This object represents a directed "uses-used by" relation between the object that owns the relation and another entity used by the relation owner. The relation can be between objects of the same or of different types.

A relation is created by the AssetRelationFactory Object of any object that implements ISupportAssetRelations: BPModelPath, BPModelElement, Component, QCResource, Test, TestConfig, and UserAsset. The owner type and ID are those of the object that owns the factory. These are set automatically when the relation is created.

After creating the AssetRelation object, set the dependent end of the relation to point to the asset used by the relation owner. Specify the used asset with <AssetRelation Object>.Field("ASR_RELATED_ID") and <AssetRelation Object>.Field("ASR_RELATED_TYPE"). The type is the name of the database table that contains the asset.

You can also specify an order among different assets of the same owner using <AssetRelation Object>.Field("ASR_ORDER"). This property is for the use of the testing tool. ALM makes no use of the field.

See  Example: Setting Up Assets and Relations.

Implemented Interface Description
IBaseField2 Represents a basic data field or entity, such as an attachment.
IBaseField3 Represents a basic data field or entity, such as an attachment.
IBaseField4 Represents a basic data field or entity, such as an attachment.
Public Methods
Public Method LockObject Locks the object. Returns True if the object has been changed on the server.
Public Method Post Posts all changed values into database.
Public Method Refresh Reads saved values, overwriting values in memory.
Public Method Undo Undoes changes to field values that have not been posted.
Public Method UnLockObject Unlocks the object.
Public Properties
Public Property AutoPost If true, the database is updated immediately when the field value changes.
Public Property AutoUnlock Indicates whether to make the item changeable to other users automatically after a Refresh or Post.
Public Property DeletedAssetInfo A reference to this AssetRelation's DeletedAssetInfo object.
Public Property Field The value of the specified field.
Public Property FieldMultiValue The MultiValue object of the specified field.
Public Property ID The item ID.
Public Property IsBroken Returns true if either object in the relation does not exist.
Public Property IsLocked Checks if object is locked for editing.
Public Property Modified Checks if the item has been modified since last refresh or post operation. If true, the field properties on the server side are not up to date.
Public Property TypeName The field's type.
Public Property Virtual Checks if this is a virtual item, that is, an item that does not have a corresponding database record.
See Also