« Back to Secure Tropos Project

Custom model attributes for different modeltypes

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Custom model attributes for different modeltypes
community documentation modeltype attrrep
Answer
3/27/14 12:29 PM
Is it possible to define custom notebooks for models and modelattributes for modeltypes in ADOxx?

RE: Custom model attributes for different modeltypes
Answer
7/10/13 1:18 PM as a reply to Anonymous.
All additional model attributes are stored in a class of the dynamic library in ADOxx called __ModelTypeMetaData__. This class must exist only in the dynamic library. Ensure that the ClassAbstract class attribute is set to 1 to make this properly work.

Step 1: Prepare Class Hierarchy
IMPORTANT: The class __ModelTypeMetaData__ does not exist in the default library/empty library, it needs to be created manuallyas a sub-class of the __LibraryMetaData__.

Step 2: Add Attributes to Class "__ModelTypeMetaData__"
You can add attributes of any type, except INTERREF and ATTRPROFREF. When using RECORD attributes you have to take care that the referenced RECORD class does not contain any INTERREF attribute. Otherwise you will get an error message in ADOxx, since INTERREFs are not supported in model attributes

Step 3: Define AttrRep Attribute for ModelType
To adopt the AttrRep you have to add an attrrep attribute to a model type definition in the Modi attribute value of the concerned library. The attrrep value must be the name of a STRING or LONGSTRING attribute in the "__ModelTypeMetaData__" class.
The syntax of this attribute is the same as the AttrRep attribute for classes and relations, please be careful to test the implementation since no validation happens on save.

Example
ALL Representation of __ModelTypeMetaData__
1class "__ModelTypeMetaData__"
2    attribute "Sample_Model_AttrRep"
3    type STRING
4    value "NOTEBOOK ... ATTR \"A new model attr\" ... "
5
6    attribute "A new model attr"
7    type INTEGER


Library Attribute MODI
1MODELTYPE "Example ModelType A" .... attrrep:"Sample_Model_AttrRep"