|
@@ -828,17 +828,42 @@ Attribute Manipulation
|
|
|
^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
.. function:: attribute_optional(model_name, node, attr_name, optionality)
|
|
|
- TODO
|
|
|
|
|
|
-.. function:: undefine_attribute(model_name, node, attr_name)
|
|
|
- TODO
|
|
|
+ Alter the optionality of a defined attribute *attr_name* on a class *node* in the model *model_name* to *optionality*.
|
|
|
+ The optionality has to be a boolean value.
|
|
|
+
|
|
|
+ Examples:
|
|
|
+
|
|
|
+ * To make the number of tokens in *formalisms/PetriNets* optional.
|
|
|
+
|
|
|
+ >>> attribute_optional("formalisms/PetriNets", "Place", "tokens", True)
|
|
|
+
|
|
|
+ * To make the number of tokens in *formalisms/PetriNets* mandatory.
|
|
|
+
|
|
|
+ >>> attribute_optional("formalisms/PetriNets", "Place", "tokens", False)
|
|
|
|
|
|
.. function:: attribute_name(model_name, node, attr_name, new_name)
|
|
|
- TODO
|
|
|
|
|
|
+ Change the name of a defined attribute *attr_name* on a class *node* in the model *model_name* to *new_name*.
|
|
|
+ The new name has to be a string value, and no similarly named attribute should exist on that element yet.
|
|
|
+
|
|
|
+ Examples:
|
|
|
+
|
|
|
+ * To change the name of the *tokens* attribute to *nrTokens* in *formalisms/PetriNets*.
|
|
|
+
|
|
|
+ >>> attribute_name("formalisms/PetriNets", "Place", "tokens", "nrTokens")
|
|
|
+
|
|
|
.. function:: attribute_type(model_name, node, attr_name, new_type)
|
|
|
- TODO
|
|
|
|
|
|
+ Change the type of a defined attribute *attr_name* on a class *node* in the model *model_name* to *new_type*.
|
|
|
+ The new type has to be a string value, refering to a type in the metamodel that defines the new type of the attribute.
|
|
|
+
|
|
|
+ Examples:
|
|
|
+
|
|
|
+ * To change the type of the *tokens* attribute *Integer* in *formalisms/PetriNets*, where *Integer* is defined as a *SimpleAttribute* instance.
|
|
|
+
|
|
|
+ >>> attribute_name("formalisms/PetriNets", "Place", "tokens", "Integer")
|
|
|
+
|
|
|
.. function:: read_defined_attrs(model_name, node)
|
|
|
TODO
|
|
|
|
|
@@ -856,6 +881,18 @@ Attribute Manipulation
|
|
|
|
|
|
>>> define_attribute("formalisms/PetriNets", "Place", "tokens", Natural)
|
|
|
|
|
|
+.. function:: undefine_attribute(model_name, node, attr_name)
|
|
|
+
|
|
|
+ Removes a defined attribute *attr_name* on *node* in model *model_name*.
|
|
|
+ Upon removal, all information about the attribute is also removed, such as optionality, name, and typing information.
|
|
|
+ Instances of the metamodel which make use of this attribute, will become non-conforming.
|
|
|
+
|
|
|
+ Examples:
|
|
|
+
|
|
|
+ * To undefine the *tokens* attribute in the *Place* class for *formalisms/PetriNets*.
|
|
|
+
|
|
|
+ >>> undefine_attribute("formalisms/PetriNets", "Place", "tokens")
|
|
|
+
|
|
|
.. function:: attr_assign(model_name, ID, attr, value)
|
|
|
|
|
|
Assign the value *value* to the attribute named *attr* of the element *ID* in the model named *model_name*.
|