浏览代码

RAMify: associations can also have attributes...

Joeri Exelmans 9 月之前
父节点
当前提交
8504ba52f6
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10 0
      transformation/ramify.py

+ 10 - 0
transformation/ramify.py

@@ -99,6 +99,16 @@ def ramify(state: State, model: UUID, prefix = "RAM_") -> UUID:
 
             already_ramified.add(assoc_name)
 
+            # Associations can also have attributes...
+            for (attr_name, attr_edge) in od.get_attributes(bottom, assoc_node):
+                # print('  creating attribute', attr_name, "with type String")
+                # Every attribute becomes 'string' type
+                # The string will be a Python expression
+                ramified_attr_link = ramified_scd._create_attribute_link(prefix+assoc_name, actioncode_modelref, prefix+attr_name, optional=True)
+                # create traceability link
+                bottom.create_edge(ramified_attr_link, attr_edge, RAMIFIES_LABEL)
+
+
         assocs_to_ramify = ramify_later
 
     for inh_name, inh_node in m_scd.get_inheritances().items():