Skip to main content
Version: 10.1

USMeta.Domains

note

This article is about the Domains method of the USMeta internal component.

USMeta.Domains

At runtime, outputs metadata information about domains, data types and allowed values from the model developed in USoft Definer.

Returns an XML document of the form demonstrated in Example at the end of this article.

Output

Domains

For each retrieved domain, the output takes the form of name/value pairs:

NameValue
NAMEDomain Name
MODULE_NAMEThe current application or module, which is potentially consuming other modules (cf. IMPLEMENTING_MODULE below).
DATABASE_TYPERDBMS datatype. This is not the name of the domain's data type in USoft Definer, but the datatype generated for the column when USoft generates the table in the database.
TOTAL_LENGTHColumn Width
LENGTH_AFTER_PERIODDecimals
DISPLAY_DATATYPEDisplay Type. Values map to prompts as in the "Display types” table below.
DISPLAY_LENGTHDisplay Length
DISPLAY_LENGTH_AFTER_PERIODDecimals Displ.
UPPERCASEUppercase
TEMPLATE_DOMAINTemplate Domain
REGEXPattern (Regexp). This is not the name of the regexp pattern but the actual pattern, eg., ‘.+\@.+\..+’ for an e-mail address.
HELP_TEXTHelp Text
SUPER_DOMAINHelp Text
FIXED_LENGTHFixed Length
DEFAULT_VALUEDefault Value
MIN_VALUEMin. Value
MAX_VALUEMax. Value
SEQNO_TYPE

Generate Unique Values:

'NO SEQNO’ if No;

'RDMBS’ if Database;

'COMPONENT’ if Component;

'GUID’ if GUID.

COMPONENTName of the RDMI component responsible for generating unique values; applies when Generate Unique Values = Component.
IO_FORMATIO Format
USABLE_AS_INTERFACE

Interface (Y/N)

IMPLEMENTING_MODULEModule

Allowed values

If the domain has allowed values, these are listed in an "Allowed Values” child element, in the following format (example):

<Domain NAME="BOOLEAN" ... >
<Allowed_Values>
<Allowed_Value VALUE="N" PROMPT="No"/>
<Allowed_Value VALUE="Y" PROMPT="Yes"/>
</Allowed_Values>
</Domain>

Consumers

If the table is from a consumed module, the consumers are listed in a "Consumed_In_Modules” child element, for example:

<Domain NAME="USVC_NAME_60" MODULE_NAME="USVC" ...>
<Consumed_In_Modules>
<Module MODULE_NAME="USD"/>
</Consumed_In_Modules>
</Domain>

Display Types

DISPLAY_DATATYPE values map to prompts in the Domain info window of USoft Definer as follows:

ValuePrompt
EXT_PIXMAPBitmap Image
CHECKCheck Box
OPTIONDropdown List Box
LONGMulti-line Text Box
CLOBMulti-line Text Box (CLOB)
EXT_OLEOLE Container
RADIOOption Buttons
SCALESlider
ALPHAText Box (Alpha)
CHARText Box (Character)
DATEText Box (Date)
DATETIMEText Box (Date and Time)
EDATEText  Box (European Date)
INTText Box (Integer)
JDATEText Box (Julian Date)
MONEYText Box (Money)
NUMBERText Box (Number)
RINTText Box (R Integer)
RMONEYText Box (R Money)
RNUMBERText Box (R Number)
TIMEText Box (Time)
EXT_TEXTText Document
DB_TEXTText Editor

Syntax

SELECT USMeta.Domains(
    *domain-name-pattern* Domains
,   *type-pattern* Type
,   *interfaces-only* InterfacesOnly
,   *module-pattern* Module
,   *mime-type* MimeType
)

*mime-type* := { application/xml
, xml
, application/json
, json }

All parameters are optional. Parameter values that you pass are mapped to parameters by alias name. The '.ID.' value in the following example is for domain-name-pattern because of the "Domains" alias:

SELECT   USMeta.Domains( '.*ID.*' Domains )
tip

For backward compatibility only, it is possible to supply parameter values by position. Using this syntax, a list of non-aliased values maps to the parameter list in the order stated, with empty values at the end of the list if you supply less than 4 values, and '' (the empty string) as a way of explicitly declaring an empty value.

Domain-name-pattern is a regular expression that matches zero, one or more domain names in the model. The result data is limited to domains matching the pattern. If domain-name-pattern is omitted, then result data is not limited in this way.

Type-pattern is a regular expression that matches zero, one or more data types of domains in the model. The result data is limited to domains with a data type matching the pattern. If type-pattern is omitted, then result data is not limited in this way. The following are valid data types in USoft:

BINARYIMAGENTEXTTEXT
BITINTNUMBERTIME
BLOBINTEGERNUMERICTIMESTAMP
CHARLONGNVARCHARTINYINT
CLOBLONGRAWNVARCHAR2VARBINARY
DATELONG VARBINARYRAWVARCHAR
DATETIMELONG VARCHARREALVARCHAR2
DECIMALMONEYSMALLDATETIMEWCHAR
DOUBLE PRECISIONNCHARSMALLINTWLONGVARCHAR
FLOATNCLOBSMALLMONEYWVARCHAR

If interfaces-only is set to 'yes', only columns that have Interface = Yes are included. The default of interfaces-only is 'no', meaning that domains are in scope regardless of the value of their Interface attribute.

Module-pattern is a regular expression that matches zero, one or more module names in the model. The result data is limited to domains within modules matching the pattern. Any domains that are consumed from a different module which is filtered out by the regular expression, will show two additional fields 'INTERFACE_FROM_MODULE', which will be 'Y', and 'IMPLEMENTING_MODULE', which will contain the module name where the domain originates from. The 'MODULE_NAME' field will in this case contain the name of the module in which the interface was consumed. If module-pattern is omitted, then the result data is not limited in this way.

Mime-type determines whether the output is in XML ( ‘application/xml‘ or 'xml’) or in JSON ('application/json’ or 'json’). The default is XML.

Example

This example returns domain information about any domains in the model that have a name containing the letters 'ID', and a 'NUMBER' data type:

SELECT USMeta.Domains(
'.*ID.*' Domains
, 'NUMBER' Type
)

The return value of this statement could be:

<?xml version="1.0" encoding="UTF-16"?>
<Meta>
<Domains>
<Domain NAME="BOAT_ID" MODULE_NAME="TRAVEL" DATABASE_TYPE="NUMBER" TOTAL_LENGTH="8" LENGTH_AFTER_PERIOD="" DISPLAY_DATATYPE="NUMBER" DISPLAY_LENGTH="" DISPLAY_LENGTH_AFTER_PERIOD="" UPPERCASE="N" TEMPLATE_DOMAIN="INTEGER" REGEX="" HELP_TEXT="" SUPER_DOMAIN="" FIXED_LENGTH="N" DEFAULT_VALUE="" MIN_VALUE="" MAX_VALUE="" SEQNO_TYPE="RDMBS" COMPONENT="" IO_FORMAT="" USABLE_AS_INTERFACE="N" IMPLEMENTING_MODULE="BOATS"/>
<Domain NAME="DISCOUNT_ID" MODULE_NAME="TRAVEL" DATABASE_TYPE="NUMBER" TOTAL_LENGTH="2" LENGTH_AFTER_PERIOD="" DISPLAY_DATATYPE="NUMBER" DISPLAY_LENGTH="" DISPLAY_LENGTH_AFTER_PERIOD="" UPPERCASE="N" TEMPLATE_DOMAIN="INTEGER" REGEX="" HELP_TEXT="" SUPER_DOMAIN="" FIXED_LENGTH="N" DEFAULT_VALUE="" MIN_VALUE="" MAX_VALUE="" SEQNO_TYPE="RDMBS" COMPONENT="" IO_FORMAT="" USABLE_AS_INTERFACE="Y" IMPLEMENTING_MODULE=""/>
<Domain NAME="PERSON_ID" MODULE_NAME="TRAVEL" DATABASE_TYPE="NUMBER" TOTAL_LENGTH="5" LENGTH_AFTER_PERIOD="" DISPLAY_DATATYPE="INT" DISPLAY_LENGTH="" DISPLAY_LENGTH_AFTER_PERIOD="" UPPERCASE="N" TEMPLATE_DOMAIN="INTEGER" REGEX="" HELP_TEXT="" SUPER_DOMAIN="" FIXED_LENGTH="N" DEFAULT_VALUE="" MIN_VALUE="" MAX_VALUE="" SEQNO_TYPE="RDMBS" COMPONENT="" IO_FORMAT="" USABLE_AS_INTERFACE="Y" IMPLEMENTING_MODULE=""/>
<Domain NAME="RES_ID" MODULE_NAME="TRAVEL" DATABASE_TYPE="NUMBER" TOTAL_LENGTH="5" LENGTH_AFTER_PERIOD="" DISPLAY_DATATYPE="INT" DISPLAY_LENGTH="" DISPLAY_LENGTH_AFTER_PERIOD="" UPPERCASE="N" TEMPLATE_DOMAIN="INTEGER" REGEX="" HELP_TEXT="" SUPER_DOMAIN="" FIXED_LENGTH="N" DEFAULT_VALUE="" MIN_VALUE="" MAX_VALUE="" SEQNO_TYPE="RDMBS" COMPONENT="" IO_FORMAT="" USABLE_AS_INTERFACE="N" IMPLEMENTING_MODULE=""/>
<Domain NAME="TOUR_ID" MODULE_NAME="TRAVEL" DATABASE_TYPE="NUMBER" TOTAL_LENGTH="4" LENGTH_AFTER_PERIOD="" DISPLAY_DATATYPE="INT" DISPLAY_LENGTH="" DISPLAY_LENGTH_AFTER_PERIOD="" UPPERCASE="N" TEMPLATE_DOMAIN="INTEGER" REGEX="" HELP_TEXT="" SUPER_DOMAIN="" FIXED_LENGTH="N" DEFAULT_VALUE="" MIN_VALUE="" MAX_VALUE="" SEQNO_TYPE="RDMBS" COMPONENT="" IO_FORMAT="" USABLE_AS_INTERFACE="N" IMPLEMENTING_MODULE=""/>
</Domains>
</Meta>