Skip to content

Attribute Facets ​

This page focuses on details about the different attribute facets available and how they are used to configure an attribute.

Attribute Facet Basics ​

Attribute facets are used to provide details and configuration for an attribute, like providing a description of the attribute or restricting the allowed values. They can be thought of as "properties of an attribute". Each facet has:

  • a name which is predefined by the ADOxx platform,
  • a type depending on what the facet configures and
  • a value.

Almost all facets are set at the class that owns the attribute. This means that the facet values are also inherited with the attribute by all sub-classes, but can not be changed there. The exception to this is the AttributeValue facet, which specifies the default value for the attribute. It is set separately for each class that has the attribute, including classes that inherited the attribute.

Editing Attribute Facets ​

To change the facets of an attribute simply follow the steps for modifying an attribute.

Facets by Attribute Type ​

Depending on the type of an attribute different facets are available. Every type of attribute uses the following facets:

Furthermore, each type of attribute except for Record table (RECORD) uses the following facets:

The other facets are only available in certain types of attributes:

Attribute typeOther facets available
Short String (STRING)MultiLineString, AttributeRegularExpression
Long String (LONGSTRING)MultiLineString, AttributeRegularExpression
Character Large Object (CLOB)MultiLineString, AttributeRegularExpression
Integer (INTEGER)AttributeNumericDomain
Floating-point Number (DOUBLE)AttributeNumericDomain
Date (DATE)none
Time (TIME)none
Date and Time (DATETIME)none
Enumeration (ENUMERATION)EnumerationDomain, AttributeRegularExpression
Enumeration List (ENUMERATIONLIST)EnumerationDomain, AttributeRegularExpression
Expression (EXPRESSION)MultiLineString
Record table (RECORD)RecordClassName, RecordClassMultiplicity
HTTP Request (HTTP)OnlyOneRequestHttp
Inter-model Reference (INTERREF)AttributeInterRefDomain
Attribute Profile Reference (PROFREF / ATTRPROFREF)AttributeProfileRefDomain
Program Call (PROGRAMCALL)EnumerationDomain

Facet Details ​

The following sections provide details on the available attribute facets.

AttributeType ​

The AttributeType facet defines the type of the attribute. It is handled by the ADOxx platform and can not be changed after an attribute has been created.

This facet is available in every type of attribute.

The facet always has an integer value. The value is the internal numeric identifier of the type:

AttributeName ​

The AttributeName facet defines the name of the attribute. It is handled by the ADOxx platform and can not be changed after an attribute has been created.

This facet is available in every type of attribute.

The facet always has a text value.

AttributeValue ​

The AttributeValue facet defines the default value for the attribute. In the user interface of the Development Toolkit it is also labeled as "Standard value". Unlike other facets it can have a different value for each class that inherits the attribute. Therefore the facet's context is not just the attribute, but also a specific class with the attribute.

This facet is available in every type of attribute except for Record table (RECORD) type attributes.

The facet's type depends on the type of the attribute, being either an integer or a double for the two numeric types or a text for all other types of attributes.

AttributeHelpText ​

The AttributeHelpText facet provides a help text or description of the attribute. This description is available to the user in the Notebook through the Info icon Info button next to the attribute name. The button is only available when this facet has a non-empty value.

This facet is available in every type of attribute.

The facet always has a text value.

MultiLineString ​

The MultiLineString facet specifies for text attributes whether they can have multiple lines of text or only a single line.

This facet is only available for the attribute types:

The facet always has an integer value of either 0 (Unchecked checkbox for single line) or 1 (Checked checkbox for multiple lines).

AttributeRegularExpression ​

The AttributeRegularExpression facet allows to specify a regular expression to check an entered attribute value against. When the attribute value does not contain the pattern of the regular expression, then an error message is displayed to the user. To check the entire attribute value use the line anchors ^ (start) and $ (end) as part of the regular expression.

This facet is only available for the attribute types:

The facet always has a text value that must be either empty or use a specific syntax:

leo-grammar
REGEXP message:strValue expression:strValue .

The expression should specify the regular expression to check against, while the message specifies a text to be shown as part of the shown error. Both values are of type string, which requires to escape certain characters (see escaping characters in regular expressions for more information).

Examples:

Checks whether the entered value is a valid date in the format DD.MM.YYYY:

leo
REGEXP
  message:"Value in date format 'DD.MM.YYYY' required."
  expression:"^(((0[1-9]|1[0-9]|2[0-9]).(0[1-9]|10|11|12))|(30.(01|0[3-9]|10|11|12))|(31.(01|03|05|07|08|10|12))).[0-2][0-9][0-9][0-9]$"

Checks whether the entered value contains a date in the format MM.YYYY (additional text before and after is allowed):

leo
REGEXP
  message:"The entered value does not contain a date in the format MM.YYYY (from 01.1950 to 12.2050)."
  expression:"(0[1-9]|1[0-2])\\.(19[5-9][0-9]|20[0-5][0-9])"

Checks whether the entered value appears to be an e-mail address (contains an @ and later a .):

leo
REGEXP
  message:"That is not a valid e-mail address!"
  expression:"^.+@.+\\..+$"

AttributeNumericDomain ​

The AttributeNumericDomain facet allows to specify one or several ranges of valid numbers for a numeric attribute. When the attribute value is not inside one of the specified ranges, then an error message is displayed to the user. Furthermore, the amount of decimal places to use with a floating-point number can be specified.

This facet is only available for the attribute types:

The facet always has a text value that must be either empty or use a specific syntax:

leo-grammar
[ DomainDefinition ] [ LayoutDefinition ] .

DomainDefinition : DOMAIN message:strValue IntervalDefinition { IntervalDefinition } .

IntervalDefinition : INTERVAL lowerbound:NumericValue upperbound:NumericValue .

NumericValue : intValue | realValue

LayoutDefinition : LAYOUT decimals:intValue .

The DOMAIN is used to specify the allowed intervals for both integer and floating-point numbers. It can have one or several intervals defined and the message specifies a text to be shown as part of the shown error. Each INTERVAL has a lowerbound and an upperbound which are considered to be inclusive.

The LAYOUT is used to restrict the amount of decimal places for floating-point numbers. Any decimal places beyond that amount are truncated.

Examples:

Checks whether the entered value is in the range of 0 to 100 or 1000 to 1100, all inclusive:

leo
DOMAIN
  message:"The valid value range of the attribute lies from 0 to 100 and from 1000 to 1100."
  INTERVAL lowerbound:0 upperbound:100
  INTERVAL lowerbound:1000 upperbound:1100

Restrict the amount of decimal places to three.

leo
LAYOUT decimals:3

Restrict the amount of decimal places to two and check whether the entered value is between 0.25 and 20, all inclusive:

leo
LAYOUT decimals:2
DOMAIN
  message:"Enter a value between 0.25 (inclusive) and 20 (inclusive)."
  INTERVAL lowerbound:0.25 upperbound:20.0

EnumerationDomain ​

The EnumerationDomain facet specifies a list of allowed values for the attribute.

This facet is only available for the attribute types:

The facet always has a text value. The structure of the facet value depends on the attribute type

Enumeration and Enumeration List:

For an Enumeration (ENUMERATION) and Enumeration List (ENUMERATIONLIST) type attribute it is necessary to specify the allowed values separated by @ characters. You can also use the Dialog icon Dialog icon next to the EnumerationDomain facet to open a custom editor for modifying the list of allowed values. The ; can not be used as part of an allowed value, as it is used as a separator in the actual attribute value.

Examples:

Allow yes or no:

yes@no

Allow yes, no or an empty value:

@yes@no

Specify the days of the week as the possible values:

Monday@Tuesday@Wednesday@Thursday@Friday@Saturday@Sunday

Program Call:

For Program Call (PROGRAMCALL) the value can be empty or use a specific syntax:

leo-grammar
{ ItemDefinition } .

ItemDefinition : ITEM strValue [ ParameterDefinition ]
    { FilterDefinition }
    AdoScript .

ParameterDefinition : param:LowerCaseIdentifier [ :strValue ] .

FilterDefinition : fdlg-filter<intValue>:strValue fdlg-type<intValue>:strValue .

Each ITEM is available for the value of a program call attribute and identified by it's name provided via the strValue. It specifies "the program" that the item represents for the program call. Additionally the ParameterDefinition can specify a variable after param (through the LowerCaseIdentifier) to hold the parameter value of the program call attribute and a default value for it (through the strValue). The variable is then available in the AdoScript code of the item.

A FilterDefinition can be used to specify a file filter which is applied to the item. Each item can have zero, one or more file filters. The syntax uses the properties fdlg-filter<intValue> and fdlg-type<intValue> for these. A fdlg-filter defines the filter for the file name and it can use common file name wildcards, like * for any number of characters (for example "*.txt" for all files with the .txt extension). A fdlg-type provides the text that is shown as the name for the file filter in the user interface. A fdlg-filter and a fdlg-type are related to one another by using the same integer number for <intValue>.

The AdoScript can be any valid AdoScript code which is then executed for the program call. This can be starting another application, opening a file in a different application or perform some processing as part of the ADOxx tool. Besides having access to the variable specified via ParameterDefinition the following additional variables are also available as part of a program call execution:

  • attrid with the ID of the program call attribute.
  • objid with the ID of the object from where the program call is executed from.
  • classid with the ID of the object's class.

You can also use the Dialog icon Dialog icon next to the EnumerationDomain facet to open a custom editor for modifying the list of items. In the dialog a list at the top shows all available items (programs) and selecting an entry shows its details in the fields below. To add a new entry specify a new value for the Program call field (name of the item), modify the values in the other fields (some of which provide further dialogs to help with editing them) and select Add at the bottom. To modify an existing entry select it first, then select Delete, modify the values and select Add. The order of items can also be changed by selecting an item in the list and then using the Up Arrow up and Down Arrow down arrows.

Examples:

Specify three available items to open a text document through a program call attribute. These are: Notepad with .txt file filter, Microsoft Word with .docx and .odt file filters and LibreOffice Writer with .odt file filter. The AdoScript for these items is a simple command to start the application with the program call parameter as its first argument.

leo
ITEM "Notepad" param:filepath
  fdlg-filter1:"*.txt" fdlg-type1:"Text files"
START ("notepad \"" + filepath + "\"")

ITEM "Microsoft Word" param:filepath
  fdlg-filter1:"*.docx" fdlg-type1:"Word files"
  fdlg-filter2:"*.odt" fdlg-type2:"ODT files"
START ("winword \"" + filepath + "\"")

ITEM "LibreOffice Writer" param:filepath
  fdlg-filter1:"*.odt" fdlg-type1:"ODT files"
START ("soffice.exe --writer \"" + filepath + "\"")

Two items where the execution shows a "hello" message with different texts. The second item specifies a default value for its parameter.

leo
ITEM "Simple Hello"
CC "Core" GET_OBJ_NAME objid:(objid)
CC "AdoScript" INFOBOX ("Hello from\n" + objname)

ITEM "Customized Hello" param:hellomessage:"General Kenobi"
CC "AdoScript" INFOBOX ("Hello there.\n" + hellomessage)

RecordClassName ​

The RecordClassName facet specifies the record class defining the structure used by a Record table (RECORD) attribute.

This facet is only available for the attribute type Record table (RECORD).

The facet always has a text value and the value must be the name of a record class.

RecordClassMultiplicity ​

The RecordClassMultiplicity facet specifies the total amount of rows (records) allowed for a Record table (RECORD) attribute. Adding more rows than allowed is prevented by the platform.

This facet is only available for the attribute type Record table (RECORD).

The facet always has an integer value. A value of 0 indicates that there is no limit specified for the amount of records.

OnlyOneRequestHttp ​

The OnlyOneRequestHttp facet specifies that only one HTTP request can be provided.

This facet is only available for the attribute type HTTP Request (HTTP).

The facet always has an integer value of either 0 (Unchecked checkbox for single line) or 1 (Checked checkbox for multiple lines).

AttributeInterRefDomain ​

The AttributeInterRefDomain facet specifies the allowed targets for an Inter-model Reference (INTERREF) attribute. The allowed targets can be either models or instances of (modelling) classes in models, but not both at once.

This facet is only available for the attribute type Inter-model Reference (INTERREF).

The facet always has a text value that must have a value following a specific syntax:

leo-grammar
REFDOMAIN [ max:intValue ] ModelReferenceDefinition | ObjectReferenceDefinition .

ModelReferenceDefinition : MODREF mt:strValue [ max:intValue ] .

ObjectReferenceDefinition : OBJREF mt:strValue c:strValue [ max:intValue ] .

You can also use the Dialog icon Dialog icon next to the AttributeInterRefDomain facet to open a custom editor for modifying the allowed targets.

The REFDOMAIN is the first keyword used for the value of this facet. It is followed by one or several MODREF or OBJREF entries. The value for mt has to specify the name of an available model type while the c for OBJREF defines the name of a (modelling) class available in that model type. Class hierarchy is considered, meaning that any sub-classes of the specified class can also be selected as long as they are also available in that type of model. The max value for each of them allows to specify the total amount of references (with REFDOMAIN) or total amount of references to a specific model type / class. It is not possible to mix MODREF and OBJREF for the same attribute.

Examples:

Allow to reference one instance of the class "Actor" from a model of type "Organizational diagram":

leo
REFDOMAIN max:1
OBJREF mt:"Organizational diagram" c:"Actor"

Allow to reference one model of type "Process model":

leo
REFDOMAIN max:1
MODREF mt:"Process model"

Allow to reference a total of 10 instances, up to 7 can be instances of the class "MyClassInMyFirstModelType" and up to 5 of the class "MyClassInMySecondModelType", both located in different types of models:

leo
REFDOMAIN max:10
OBJREF mt:"MyFirstModelType" c:"MyClassInMyFirstModelType" max:7
OBJREF mt:"MySecondModelType" c:"MyClassInMySecondModelType" max:5

AttributeProfileRefDomain ​

The AttributeProfileRefDomain facet specifies the allowed targets for an Attribute Profile Reference (PROFREF / ATTRPROFREF) attribute.

This facet is only available for the attribute type Attribute Profile Reference (PROFREF / ATTRPROFREF).

The facet always has a text value that must have a value following a specific syntax:

leo-grammar
APREF c:strValue

You can also use the Dialog icon Dialog icon next to the AttributeProfileRefDomain facet to open a custom editor for modifying the allowed targets.

The value for c has to specify the name of an available Attribute Profile class

Example:

Reference an Attribute Profile instance of the class "AdoScript Functionality (Code)".

leo
APREF c:"AdoScript Functionality (Code)"