ADOxx Documentation
Theory - Hands-On - Scenarios - Community - Development Tools
Theory
ADOxx Development Language: EXPRESSION
Expressions provide a basic set of functions and operators for investigating or calculating within a model context and across multiple models. This can be both a fixed calculation and the processing of attribute values. The syntax of the language for EXPRESSION attributes is based on the following grammar:
ExprDefinition : | EXPR type: ResultType [ format: FormatString ] |
ResultType : | double | integer | string | time . |
Each definition of the EXPRESSION attribute starts with the keyword EXPR. The result type will be fixed by means of the attribute type: and a standard formula expr. Each time an instance is created (object, model or connector) the formula will be used to calculate the result value of the expression.
By setting the modifier as ‘fixed:' the expression will be unchangeable in the Modelling Toolkit. It means that the EXPRESSION attribute evaluates the same formula everywhere.
In the expressions where you can change the instances, each evaluation instance will be assigned to an appropriate expression. Then the specification of an expression in the "Expression-Definition" is optional and is of use for initial assignment of an expression to evaluation instances. For each evaluation instance, you can open an input window from the ADOxx Notebook, which enables the editing of the expression. The changeable expression will be saved to the evaluation instance under expr.
In ADOxx, three different types of expressions can be found:
- LeoExpressions LeoExpressions are a set of basic functions and operators, from which an expression can be aggregated. They are used to calculate values, manipulate strings and perform other similar basic tasks. LeoExpressions can be used with every LEO language. Wherever LEO strings are possible, LEO expressions can be used.
- CoreExpressions: A CoreExpression is an ADOxx-specific extension of a LeoExpression. When creating a CoreExpression, both functions and operators of LeoExpressions and core-specific functions designed specifically for ADOxx can be utilised. CoreExpressions can only be used in attributes of type EXPRESSIONS.
- AdoScriptExpressions: An AdoScriptExpression is an extension of a LeoExpression. Consequently, all functions and operators of the LeoExpressions can be used here as well. Furthermore, specifically designed AdoScript functions can be utilised. AdoScriptExpressions can only be used within AdoScript in the ADOxx Development Toolkit.
Leo Expressions
Operators
| |
|
| |
|
| | |
| |
|
|
| |
|
| |
|
| |
|
| |
| |
|
|
| |
|
| |
|
| |
|
| |
|
| |
| |
|
Functions
| |
|
|
| |
|
| |
|
| |
|
| |
| |
|
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
| |
|
|
| |
|
| |
|
| |
|
| |
| |
|
|
| |
| |
|
|
| |
|
| |
|
| |
| |
|
| |
|
The Core Expressions functions:
#Call the value of the instance attribute
aval (instID , attrName)
aval ( attrName )
aval ( instName , attrName )
aval ( className , instName , attrName )
#Returns a formatted string of the value. For INTERREF attributes, format is returned with the following replacements: %o by object name, %c by class name, %m by model name, %t by model type name of the target model.
avalf ( format , instID , attrName )
avalf ( format , attrName )
avalf ( format , instName , attrName )
avalf ( format , className , instName , attrName )
#Returns the value of the same-model attribute specified by attrName.
maval ( attrName )
#Returns the models referenced from the specified instance INTERREF attribute attrName.
irtmodels ( attrName )
irtmodels ( instID , attrName )
irtmodels ( instName , attrName )
irtobjs ( attrName )
irtobjs ( instID , attrName )
irtobjs ( instName , attrName )
#Returns the objects referencing this instance/model. The usage of this function is not recommended due to high performance costs.
objirsobjs ()
objirsobjs ( targetName )
objirsobjs ( targetID )
modelirsobjs ()
#Returns the ID of the referenced attribute profile from the specified same-instance PROFILEREF attribute.
profile ( attrName )
#Returns the value of the instance attribute of a referenced attribute profile.
paval ( profilerefAttrName , attrNameInProfile )
#Returns a formatted string of the value of the instance attribute of a of a referenced attribute profile.
pavalf ( format , profilerefAttrName , attrNameInProfile )
#Returns the to/from-object.
ctobj()
cfobj()
ctobjs ( relnName )
ctobjs ( instid , relnName )
cfobjs ( relnName )
cfobjs ( instid , relnName )
#Returns the connectors of the specified type relnName between the specifed objects. An objs parameter can be a single ID or a string containing a sequence of IDs.
conn ( relnName , fromObjs , toObjs )
#Returns the modelling object owning the RECORD attribute containing the row rowID
objofrow ( rowID )
#Returns the number of rows of a record
rcount ( recordAttrName )
#Returns the ID of the internal object representing the record row with the given rowIndex (between 1 and rcount()).
row ( recordAttrName , rowIndex )
#Returns the sum of all values of the record column columnName. You can sum INTEGER, DOUBLE, TIME, and EXPRESSION attributes.
rasum ( recordAttrName , columnName )
rasum ( idStr , recordAttrName , columnName )
#Returns the sum of all values of a column of a record in an attribute profile. You can sum INTEGER, DOUBLE, TIME, and EXPRESSION attributes
prasum ( profileAttrName , recordAttrName , columnName )
#Returns '1' if the model modelID is loaded, otherwise '0'.
isloaded ( modelid )
#Returns all objects of the class className in the specified model modelID.
allobjs ( modelID , className )
#Returns a string with the IDs of the AQL expression's result
aql ( aqlExpr )
#Returns the ID of the previous swimlane.
prevsl()
#Returns the ID of the next swimlane.
nextsl()
#Returns the sum for all objects specified by idStr of all attribute values of the attribute specified by attrName.
asum ( idStr , attrName )
#Returns the maximum for all objects specified by idStr of all attribute values of the attribute specified by attrName.
amax ( idStr , attrName )
#Returns the weighted sum for all objects specified by instIDStr of all attribute values of the attribute specified by objAttrName weighted with attribute values of connectors specified by connIDStr and connAttrName.
awsum ( instIDStr , objAttrName , connIDStr , connAttrName )
#Returns the class ID.
class ( instID )
class ( className )
#Returns the model type name.
mtype ()
mtype ( modelID )
#Returns the classes allowed in the model type modelTypeName.
mtclasses ( modelTypeName )
#Returns the visible relation classes in the model type modelTypeName.
mtrelns ( modelTypeName )
#Returns all class/instance/relation attributes of the class classID/ relationID.
allcattrs ( classID )
alliattrs ( classID )
allrattrs ( relationID )
#Returns the name of the attribute attrID.
attrname ( attrID )
Returns the type of the attribute attrID
atttype ( attrID )
Additionally, the following variables are preset for every EXPRESSSION attribute:
- objid with the ID of the own object/connector
- classid with the ID of the own class/relation class
- modelid with the ID of the model containing the own object
- attrid with he ID of this attribute
AdoScript Expressions:
The command EVAL_EXPRESSION introduces a Core Expression (see above) without the need for an EXPRESSION attribute and its structure is documented below. objid must be quoted, if the expression is object-related and the model id needs a model related expression. The type of the result is the same as the result of the expression.
EVAL_EXPRESSION coreExpr [ objid: id | modelid: id ] .
# --> RESULT ecode: intValue result: value
# value : double | integer | string | time .