|
|
|
@ -17,7 +17,9 @@
|
|
|
|
|
{:module-desc (or (System/getenv "ATTR_MODULE_DESC")
|
|
|
|
|
"0924be5a-9680-44e3-986f-54b5b59631ba")
|
|
|
|
|
:role-desc (or (System/getenv "ATTR_ROLE_DESC")
|
|
|
|
|
"39e467a5-9ed2-496b-bc98-a14e3b52a8d1")})
|
|
|
|
|
"39e467a5-9ed2-496b-bc98-a14e3b52a8d1")
|
|
|
|
|
:comp-desc (or (System/getenv "ATTR_COMP_DESC")
|
|
|
|
|
"35646a07-5b48-4711-9211-54df9f13e815")})
|
|
|
|
|
|
|
|
|
|
(def coc-instance-uuids
|
|
|
|
|
{"dev" (or (System/getenv "INST_DEV")
|
|
|
|
@ -150,6 +152,12 @@
|
|
|
|
|
(modules-and-levels! "d97628f4-477d-49d7-a1c1-2fd643a0ee65")
|
|
|
|
|
(instance! "d97628f4-477d-49d7-a1c1-2fd643a0ee65"))
|
|
|
|
|
|
|
|
|
|
(defn propery-of-attribute [{:keys [properties]} attr-uuid]
|
|
|
|
|
(->> properties
|
|
|
|
|
(filter #(= attr-uuid (-> % :attr :uuid)))
|
|
|
|
|
first
|
|
|
|
|
:value))
|
|
|
|
|
|
|
|
|
|
(neo4j/defquery components-of-module
|
|
|
|
|
"MATCH (module:instance {uuid:{uuid}}),
|
|
|
|
|
(cschema:schema {uuid:{compschema_uuid}}),
|
|
|
|
@ -159,30 +167,25 @@
|
|
|
|
|
ORDER BY comp.name")
|
|
|
|
|
(defn module! [uuid]
|
|
|
|
|
(let [i (instance! uuid)
|
|
|
|
|
desc (->> (:properties i)
|
|
|
|
|
(filter #(= (:module-desc attribute-uuids)
|
|
|
|
|
(-> % :attr :uuid)))
|
|
|
|
|
first
|
|
|
|
|
:value)
|
|
|
|
|
comps (->> {:uuid uuid
|
|
|
|
|
:compschema_uuid (:component schema-uuids)}
|
|
|
|
|
(neo4j/exec-query! components-of-module)
|
|
|
|
|
(map :comp))]
|
|
|
|
|
|
|
|
|
|
(assoc i
|
|
|
|
|
:desc desc
|
|
|
|
|
:desc (propery-of-attribute i (:module-desc attribute-uuids))
|
|
|
|
|
:components comps)))
|
|
|
|
|
(comment
|
|
|
|
|
(module! "0b30521a-0727-4a6b-b69e-6f3c554a81b2"))
|
|
|
|
|
|
|
|
|
|
(defn role! [uuid]
|
|
|
|
|
(let [i (instance! uuid)
|
|
|
|
|
desc (->> (:properties i)
|
|
|
|
|
(filter #(= (:role-desc attribute-uuids)
|
|
|
|
|
(-> % :attr :uuid)))
|
|
|
|
|
first
|
|
|
|
|
:value)]
|
|
|
|
|
(let [i (instance! uuid)]
|
|
|
|
|
(assoc i
|
|
|
|
|
:desc desc)))
|
|
|
|
|
:desc (propery-of-attribute i (:role-desc attribute-uuids)))))
|
|
|
|
|
(comment
|
|
|
|
|
(role! "2c507f67-600d-4add-b648-2ea62d5a4ffc"))
|
|
|
|
|
|
|
|
|
|
(defn comp! [uuid]
|
|
|
|
|
(let [i (instance! uuid)]
|
|
|
|
|
(assoc i
|
|
|
|
|
:desc (propery-of-attribute i (:comp-desc attribute-uuids)))))
|
|
|
|
|