-
Notifications
You must be signed in to change notification settings - Fork 1
Config File 6 Variables
herve edited this page Jan 30, 2019
·
1 revision
Graphical objects can show up as literals, variables, or a mix of the two:
- literals: any text that doesn't start with a dollar sign ($). As with any string in JSON, literals must also be enclosed with quotes. They are typically used in "text" property of the label controls or "default" property of other controls.
"this is a literal"
- variables: starts with a dollar sign and are enclosed with curly braces (can be nested). Variables must also be enclosed in quotes.
"${class}"
"${view:documentation}"
"${model:name}"
"${property:documentation_${model:property:language}}"
- mix: It's possible to mix literals and variable in read-only controls such as labels. Mixed content must follow the same rules as literals and variables do.
"Test form for ${class} \"${name}\""
Variables can be used in all controls (label, text, combo, check, table) to access information about an Archi component that a form refers to. The following variables can be used:
- ${class} [read only]: component class
- ${name} [read/write]: component name
- ${documentation} [read/write]: component documentation
- ${property:xxxxx} [read/write]: property xxxxx of a component
It's possible to access information about a parent of an Archi component using a form that refers to the parent by adding the following prefixes:
- view: information about the view containing an Archi component if the component is a graphical object such as a box or connection.
- model: information about the model that contains an Archi component
- source: refers to the source of a relationship
- target: refers to the target of a relationship
Variable values are typically defined using information from the corresponding Archi component. However, it is possible to change a variable's behaviour when reading or writing a value. This is usually used in conjunction with Archi properties:
- default: sets a default value when the corresponding Archi component's information has an empty or null value.
- forceDefault: forces the default value, even if the corresponding Archi component's information is defined and has a non-null value.
-
whenEmpty: indicates what to do with a value when its corresponding Archi component is empty.
- ignore: don't save the Archi property and leave the component untouched. If the Archi property existed, its value is saved.
- create: creates an Archi property with an empty value
- delete: deletes an existing Archi value