Customizing the metamodel > Keywords for USRPROPS > SCRIPT
  
SCRIPT
SCRIPT calls a script written in SA Basic. The script is used for properties that are neither ListOf nor ExpressionOf. A Script takes the value of a property and performs an action, usually to display a particular type of annotation on a symbol on a diagram. The naming convention for the script itself is as follows:
_fmt (for example, _fmtUMLAttr): The function itself is in hard code and cannot be modified. Most functions in SAPROPS.CFG are this way. Hard-coding the function is done to make System Architect’s overall response faster.
fmt (for example, fmtUMLAttr): Exists in the FMTSCRIPT.BAS file in System Architect’s main executable directory.
Creating your own functions
You can create your own functions to display items in a particular way on a symbol, or to compute a particular value.
Put your functions in a USR_FN.BAS file in the main System Architect directory (C:\Program Files\UNICOM Systems\System Architect Suite\System Architect). (The SARULES.BAS file has a #include to USR_FN.BAS.) Do not put your functions in FMTSCRIPT.BAS, because this file is overwritten for every new installation or update of System Architect.
Most functions called in SAPROPS.CFG (which are hard-coded and by convention have an underscore at the start of their name, such as _fmtUMLAttr) have an equivalent function call in the fmtscript.bas file (without the underscore). To create your own function, you can use the scripts in FMTSCRIPT.BAS as a guide.
Explanation of existing functions
FmtOMTAbstractClass
Returns the script {abstract} if this property has been set; otherwise returns nothing.
FmtBOOClassConstraint
Returns a set of braces enclosing the name of the constraint; that is, {constraint name}, if one has been set; otherwise, returns nothing.
FmtOMTObjInstClass
Returns a set of parenthesis enclosing the name of the class; that is, (class name), if one has been set; otherwise, returns nothing.
FmtEntryAction
Returns the script entry / and the name of the entry action if one has been set; otherwise, returns nothing.
FmtExitAction
Returns the script exit / and the name of the exit action if one has been set; otherwise, returns nothing.
FmtOMTTransition
Returns the following values, in the following punctuation marks, if they are set in a state transition definition:
(attribute name) [condition] /action
Examples
CHAPTER "OMT Object-oriented"
GROUP "OMT Object-oriented"
{
...
PROPERTY "Abstract"
{ EDIT Boolean LENGTH 1 DEFAULT "F"
DISPLAY { FORMAT SCRIPT FmtOMTAbstractClass LEGEND "$$FORCE$$"}
}
...
PROPERTY "Constraints"
{ EDIT Text LENGTH 500
DISPLAY { FORMAT SCRIPT FmtBOOClassConstraint LEGEND "$$NONE$$"}
}
}
REM "end of group OMT Object-oriented"
See also
FORMAT
COLUMN SCRIPT
COMPONENT SCRIPT
fmtxxx or _fmtxxx
Keywords for USRPROPS