소스 검색

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():