{"id":2687,"date":"2018-05-16T16:28:03","date_gmt":"2018-05-16T14:28:03","guid":{"rendered":"http:\/\/www.capri-soft.de\/blog\/?p=2687"},"modified":"2018-06-07T08:31:54","modified_gmt":"2018-06-07T06:31:54","slug":"sparx-systems-enterprise-architect-get-composite-diagram-by-sql","status":"publish","type":"post","link":"https:\/\/www.capri-soft.de\/blog\/?p=2687","title":{"rendered":"Sparx Systems Enterprise Architect: Get Composite Diagram by SQL"},"content":{"rendered":"<h1>Problem<\/h1>\n<p>The menu point &#8222;Set Composite Diagram&#8220; allows to create a clickable link to another diagram from objects. Unfortunetly to get the references in SQL (with start and end GUID) is a little bit tricky&#8230;<\/p>\n<p><a href=\"https:\/\/www.capri-soft.de\/blog\/?attachment_id=2695\" rel=\"attachment wp-att-2695\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"2695\" data-permalink=\"https:\/\/www.capri-soft.de\/blog\/?attachment_id=2695\" data-orig-file=\"https:\/\/i0.wp.com\/www.capri-soft.de\/blog\/wp-content\/uploads\/2018\/05\/composite.png?fit=716%2C341&amp;ssl=1\" data-orig-size=\"716,341\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"composite\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.capri-soft.de\/blog\/wp-content\/uploads\/2018\/05\/composite.png?fit=474%2C226&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.capri-soft.de\/blog\/wp-content\/uploads\/2018\/05\/composite.png?resize=474%2C226&#038;ssl=1\" alt=\"\" width=\"474\" height=\"226\" class=\"alignnone size-full wp-image-2695\" srcset=\"https:\/\/i0.wp.com\/www.capri-soft.de\/blog\/wp-content\/uploads\/2018\/05\/composite.png?w=716&amp;ssl=1 716w, https:\/\/i0.wp.com\/www.capri-soft.de\/blog\/wp-content\/uploads\/2018\/05\/composite.png?resize=300%2C143&amp;ssl=1 300w\" sizes=\"auto, (max-width: 474px) 100vw, 474px\" \/><\/a><\/p>\n<h1>Approach<\/h1>\n<p>Open the .eap (<a href=\"https:\/\/www.capri-soft.de\/blog\/?p=2375\">MDB Plus<\/a>) file or der SQL Server structure (MS SQL Server Studio Express) in a tool that allows you to test SQL Statements<\/p>\n<h1>Solution<\/h1>\n<h2>Composite Diagrams of Activities<\/h2>\n<p>i.e. for the .eap-File (Access):<br \/>\nTo get the activities Composite diagrams, you need to join the t_object.PData1 Columne with the t_diagram.Diagram_ID Column. This can be done in the following way:<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\nSELECT compobjects.ea_guid As src_guid,\r\n       compobjects.name As src_name,\r\n       b.ea_guid As dest_guid,\r\n       b.name As dest_name \r\nFROM \r\n(\r\n      SELECT ea_guid, \r\n             Name, \r\n             Object_Type, \r\n             Stereotype, \r\n             PData1 \r\n      FROM t_object \r\n      WHERE NType=8 AND PData1 IS NOT null AND isnumeric(PData1)) compobjects\r\nINNER JOIN t_diagram b ON b.Diagram_ID=CInt(compobjects.PData1)\r\n<\/pre>\n<h2>Composite Diagrams of Classes<\/h2>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\nSELECT Client As src_guid, \r\n       obj.name As src_name, \r\n       Supplier As dest_guid, \r\n       obj2.name As dest_name   \r\nFROM ( t_xref xr\r\nLEFT JOIN t_object obj ON xr.Client=obj.ea_guid)\r\nLEFT JOIN t_diagram obj2 ON xr.Supplier=obj2.ea_guid \r\nWHERE Supplier&lt;&gt;'&lt;none&gt;'\r\n<\/pre>\n<h2>All Composites by source guid<\/h2>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\nSELECT src_guid,\r\n       src_name,\r\n       dest_guid,\r\n       dest_name\r\nFROM       \r\n(\r\n\tSELECT compobjects.ea_guid As src_guid,\r\n\t\t   compobjects.name As src_name,\r\n\t\t   b.ea_guid As dest_guid,\r\n\t\t   b.name As dest_name \r\n\tFROM\r\n\t(\r\n\t\t  SELECT ea_guid, \r\n\t\t\t\t Name, \r\n\t\t\t\t Object_Type, \r\n\t\t\t\t Stereotype, \r\n\t\t\t\t PData1 \r\n\t\t  FROM t_object \r\n\t\t  WHERE NType=8 AND PData1 IS NOT null AND isnumeric(PData1)) compobjects\r\n\tINNER JOIN t_diagram b ON b.Diagram_ID=CInt(compobjects.PData1)\r\n\tUNION ALL \r\n\tSELECT Client As src_guid, \r\n\t\t   obj.name As src_name, \r\n\t\t   Supplier As dest_guid, \r\n\t\t   obj2.name As dest_name   \r\n\tFROM ( t_xref xr\r\n\tLEFT JOIN t_object obj ON xr.Client=obj.ea_guid)\r\n\tLEFT JOIN t_diagram obj2 ON xr.Supplier=obj2.ea_guid \r\n\tWHERE Supplier&lt;&gt;'&lt;none&gt;'\r\n)\r\nWHERE src_guid='Put your GUID here'\r\n<\/pre>\n<iframe src=\"http:\/\/www.facebook.com\/plugins\/like.php?href=https%3A%2F%2Fwww.capri-soft.de%2Fblog%2F%3Fp%3D2687&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light\" scrolling=\"no\" frameborder=\"0\" allowTransparency=\"true\" style=\"border:none; overflow:hidden; width:450px;margin-top:5px;\"><\/iframe>","protected":false},"excerpt":{"rendered":"<p>Problem The menu point &#8222;Set Composite Diagram&#8220; allows to create a clickable link to another diagram from objects. Unfortunetly to get the references in SQL (with start and end GUID) is a little bit tricky&#8230; Approach Open the .eap (MDB Plus) file or der SQL Server structure (MS SQL Server Studio Express) in a tool &hellip; <a href=\"https:\/\/www.capri-soft.de\/blog\/?p=2687\" class=\"more-link\"><span class=\"screen-reader-text\">Sparx Systems Enterprise Architect: Get Composite Diagram by SQL<\/span> weiterlesen <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[28,43],"tags":[],"class_list":["post-2687","post","type-post","status-publish","format-standard","hentry","category-sparx-systems-enterprise-architect","category-sql"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4yGeN-Hl","jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2687","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2687"}],"version-history":[{"count":9,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2687\/revisions"}],"predecessor-version":[{"id":2703,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2687\/revisions\/2703"}],"wp:attachment":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2687"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2687"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2687"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}