{"id":1579,"date":"2016-01-12T13:16:11","date_gmt":"2016-01-12T12:16:11","guid":{"rendered":"http:\/\/www.capri-soft.de\/blog\/?p=1579"},"modified":"2018-07-04T08:27:53","modified_gmt":"2018-07-04T06:27:53","slug":"ibm-doors-dxl-usefull-iterations","status":"publish","type":"post","link":"https:\/\/www.capri-soft.de\/blog\/?p=1579","title":{"rendered":"IBM Doors DXL: Useful incoming\/outgoing Link-Loops and -iterations (inlinks \/ in-link \/ out-link \/ outlinks) and other Iterations through Doors collections"},"content":{"rendered":"<h1>Loop all views in module<\/h1>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nModule m=current;\r\nstring myView;\r\n\r\nfor myView in views m do \r\n{\r\n   print myView &quot;\\n&quot;;\r\n}\r\n<\/pre>\n<p>Example: Get all Filter Strings from all views in current Module<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nModule m=current;\r\nstring myView;\r\n\r\nfor myView in views m do \r\n{\r\n   print myView &quot;\\t&quot;;\r\n   View v=view(myView);\r\n   load(m,v);\r\n   Filter f=current;\r\n\r\n   if(null f)\r\n   {\r\n\tprint &quot;no filter\\n&quot;\r\n   }\r\n   else\r\n   {\r\n      string filterString=stringOf(m,f);\r\n      print filterString &quot;\\n&quot;;\r\n   }\r\n}\r\n<\/pre>\n<h1>Loop all attributes on module<\/h1>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nModule m=current;\r\nstring attribute;\r\nfor attribute in m do {\r\n\tprint attribute &quot;\\n&quot;;\r\n}\r\n<\/pre>\n<h1>Loop through all In-Links (with Baselines) of an Object<\/h1>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nObject obj=current;\r\n\r\nLink lnk;\r\nLinkRef lnkRef;\r\nModName_ otherMod = null;\r\nstring linkModuleString;\r\n\r\n\/\/ I.e. for different Projects with different\r\n\/\/ Link-Module Locations\r\nstring projName = name(current Project);\t\r\nif(projName==&quot;VarCo&quot;)\r\n{\r\n  \/\/ Links zu Change Request\r\n  linkModuleString = &quot;\/VarCo\/20 Sample Project\/22 Links\/Changes&quot;; \r\n}\r\nelse\r\n{\r\n  \/\/ Links zu Change Request\r\n  linkModuleString = &quot;\/Project\/90 Administration\/Changes&quot;; \r\n}\r\n\t\r\nint lnkCount=0;\r\n\t\r\nItem linkModItem = itemFromID(uniqueID(item(linkModuleString)));\r\nlinkModName = fullName(linkModItem);\r\n\t\r\nfor lnkRef in all(obj&lt;-linkModName) do \r\n{\r\n  otherMod = module (sourceVersion lnkRef);\r\n  if (!null otherMod) \r\n  {\r\n    if ((!isDeleted otherMod) &amp;&amp; (null data(sourceVersion lnkRef))) \r\n    {\r\n      load((sourceVersion lnkRef),false);\r\n    }\r\n  }\r\n}\r\n\t\r\nfor lnk in all(obj&lt;-linkModName) do \r\n{\r\n  \/\/ Get In-Link Object\r\n  Object src = source lnk;\r\n  if ( isDeleted(src) || null(src) ) continue;\r\n\t\r\n  identifierCC =  identifier(src) &quot;&quot;;\r\n  lnkCount++;\r\n}\r\n<\/pre>\n<h1>Loop through out-links of an object<\/h1>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n\r\nObject obj=current;\r\n\r\nLink lnk;\r\n\r\nfor lnk in obj-&gt;&quot;*&quot; do\r\n{\r\n  string tmn=fullName target(lnk);\r\n\r\n  if(!open module tmn)\r\n  {\r\n    read(tmn,false);\r\n  }\r\n\r\n  Object tgt = target(lnk);\r\n  print identifier(tgt) &quot;\\n&quot;;\r\n}\r\n\r\n<\/pre>\n<h1>Loop through all (with baselines) out-links of an object<\/h1>\n<h2>First Approach<\/h2>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nModule baselineModul=current;                                         \r\n\r\nstring satisfiesModuleString = &quot;\/NDS\/90 Administration\/Satisfies&quot;;\r\nint object_count=0;\r\nint link_count=0;\r\n\r\nObject blObject;    \r\nfor blObject in baselineModul do \r\n{\r\n\t\/\/ Laufe durch die gebaselinten Outlinks\r\n\tLink lnk;\r\n\tfor lnk in all(blObject-&gt;satisfiesModuleString) do\r\n\t{\r\n\t\tModuleVersion mvTarget=targetVersion(lnk);\r\n\t\tif(null data(mvTarget)) \r\n\t\t{\r\n\t\t\tload(mvTarget,false);\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tObject tgt=target(lnk);\r\n\t\tlink_count++;\r\n    }\r\n\t \r\n\t object_count++;\r\n}\r\n\r\nprint &quot;Link Count: &quot; link_count &quot;\\nObject Count: &quot;  object_count &quot;&quot;;\r\n<\/pre>\n<h2>Second Approach<\/h2>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nModule baselineModul=current;\r\n\r\nModName_ otherMod=null;                                                \r\n\r\nstring satisfiesModuleString = &quot;\/NDS\/90 Administration\/Satisfies&quot;;\r\nint object_count=0;\r\nint link_count=0;\r\n\r\nObject blObject;    \r\nfor blObject in baselineModul do \r\n{\r\n    \t\r\n\t\/\/ Laufe durch die gebaselinten Outlinks\r\n\tLink lnk;\r\n\tfor lnk in all(blObject-&gt;satisfiesModuleString) do\r\n\t{\r\n\t  \tstring tmn=fullName target(lnk);\r\n\t  \r\n\t  \totherMod = module (targetVersion lnk);\r\n\t  \tif (!null otherMod) \r\n\t  \t{\r\n\t   \t\tif ((!isDeleted otherMod) &amp;amp;&amp;amp; (null data(targetVersion lnk))) \r\n\t\t\t{\r\n\t\t\t\r\n\t\t\t\tload((targetVersion lnk),false);\r\n\t\t\t}\r\n\t  \t}\t\t\t  \r\n\t\r\n\t  \tObject tgt = target(lnk);\r\n\t  \t\r\n\t  \tif(null tgt)\r\n\t  \t{\r\n\t\t  \tprint &quot;Is null das Teil!\\n&quot;;\r\n\t  \t}\r\n\t  \telse\r\n\t  \t{\r\n\t\t  \tBaseline blI= baselineInfo(module tgt);\r\n\t\t  \tprint major(blI) &quot; &quot; minor (blI) &quot;\\n&quot;;\r\n\t  \t}\r\n\t  \t\r\n  \t\tlink_count++;\r\n\t }\r\n\t \r\n\t object_count++;\r\n}\r\n\r\nprint &quot;Link Count: &quot; link_count &quot;\\nObject Count: &quot;  object_count &quot;&quot;;\r\n<\/pre>\n<h1>Loop through all (with baselines) out-links without opening the target module<\/h1>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nObject obj=current;\r\n\r\nLink lnk;\r\nfor lnk in all(obj-&gt;&quot;*&quot;) do\r\n{\r\n\tModuleVersion mvTarget=targetVersion(lnk);\r\n\tBaseline b = baseline(mvTarget);\r\n\tif(!null b)\r\n      {\r\n\t\t\/\/ Wenn der Link nicht auf Current geht\r\n\t\tprint major(b) &quot;.&quot; minor(b) &quot;\\n&quot;;\r\n      }\r\n\tprint fullName(mvTarget) &quot; &quot; targetAbsNo(lnk) &quot;\\n&quot;;\r\n}\r\n<\/pre>\n<iframe src=\"http:\/\/www.facebook.com\/plugins\/like.php?href=https%3A%2F%2Fwww.capri-soft.de%2Fblog%2F%3Fp%3D1579&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>Loop all views in module Module m=current; string myView; for myView in views m do { print myView &quot;\\n&quot;; } Example: Get all Filter Strings from all views in current Module Module m=current; string myView; for myView in views m do { print myView &quot;\\t&quot;; View v=view(myView); load(m,v); Filter f=current; if(null f) { print &quot;no &hellip; <a href=\"https:\/\/www.capri-soft.de\/blog\/?p=1579\" class=\"more-link\"><span class=\"screen-reader-text\">IBM Doors DXL: Useful incoming\/outgoing Link-Loops and -iterations (inlinks \/ in-link \/ out-link \/ outlinks) and other Iterations through Doors collections<\/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":true,"_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":[22,19],"tags":[],"class_list":["post-1579","post","type-post","status-publish","format-standard","hentry","category-dxl","category-ibm-doors"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4yGeN-pt","jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1579","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=1579"}],"version-history":[{"count":21,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1579\/revisions"}],"predecessor-version":[{"id":2495,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1579\/revisions\/2495"}],"wp:attachment":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1579"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1579"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1579"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}