Customizing the metamodel > Keywords for USRPROPS > COMPONENT SCRIPT
  
COMPONENT SCRIPT
Calls a function written in Basic, using function calls to System Architect that are included in what is referred to as SA Basic.
The component scripts are used for LISTOF and EXPRESSIONOF lists. The action taken by the script works against each item in the list. For example, the syntax COMPONENT_SCRIPT fmtomtattr returns all attributes and their corresponding C- storage types, separated by : (colon).
By convention, the function itself is named with one of the following prefixes:
fmtxxx
The function itself is in hard code and cannot be modified. Most functions in SAPROPS.CFG are this way. Hard-coding the function makes System Architect’s response faster.
_fmtxxx
Exists in the FMTSCRIPT.BAS file in System Architect’s main executable directory.
For information on how to create your own script, see SCRIPT.
Explanation of existing scripts
fmtUMLAttr
Returns all attributes and their corresponding types, separated by a colon.
fmtOMTOperation
Returns all operations and their corresponding C-storage types, enclosed in parentheses (type).
FmtOMTObjInstAttr
Returns all attributes for the class that an object instantiates.
FmtOMTActivity
Returns the script do: and the name of the activity for all activities listed in a state definition.
FmtOMTStateActions
Returns the name of the internal action for all internal actions listed in a state definition.
This graphic is described in the surrounding text.
Example (using fmtomattr)
Definition "Class" {
PROPERTY "Attributes"
{ PROPERTY "Attributes"
{ ZOOMABLE EDIT COMPLETE ListOf "Class Attribute"
KEYED BY {"Package", "Class Name":"Name", Name }
LENGTH 4096 ASGRID DISPLAY
{ FORMAT COMPONENT_SCRIPT _FmtNewUMLAttr LEGEND "$$FORCE$$"}
LABEL "Attributes"
}
}
See also
Keywords for USRPROPS