{"id":1250,"date":"2014-10-20T14:35:12","date_gmt":"2014-10-20T12:35:12","guid":{"rendered":"http:\/\/www.capri-soft.de\/blog\/?p=1250"},"modified":"2014-10-20T14:38:46","modified_gmt":"2014-10-20T12:38:46","slug":"ibm-doors-dxl-browser-triggers-on-module","status":"publish","type":"post","link":"https:\/\/www.capri-soft.de\/blog\/?p=1250","title":{"rendered":"IBM Doors DXL: Browse Triggers on module"},"content":{"rendered":"<h1>Problem<\/h1>\n<p>When there are triggers on a module it often is not visible to administrators and other users that can perform DXL operations. <\/p>\n<h1>Approach<\/h1>\n<p>A menu point as module add in should be generated. Copy the following script to the moduleaddins directory of your doors installation.<\/p>\n<h1>Solution<\/h1>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n\/\/ This is necessary that it works\r\n\/*******************************************************\r\n * Author: Bj\u00f6rn Karpenstein\r\n * Date:   2014-10-01\r\n * \r\n * This script lists all triggers of the module\r\n ******************************************************\/\r\npragma runLim, 0;\r\n\r\nstring lstArray &#x5B;] = {}; \r\n \r\nDB mainWindow;\r\nDBE textBox;\r\nDBE textList;\r\n\r\nvoid listAllTriggerForMod (Module mod) \r\n{\r\n  string theResult=&quot;&quot;;\r\n  Trigger t;\r\n  int i = 0;\r\n  for t in mod do \r\n  {\r\n    insert(textList, i, name(t) &quot;&quot;, iconNone);\r\n    i++;\r\n  }\r\n}\r\n\r\nstring getSourceForTriggerName (string theTrigger) \r\n{\r\n  string sourceCode = &quot;&quot;;\r\n  Trigger t;\r\n  for t in current Module do \r\n  {\r\n    if(name(t) &quot;&quot; == theTrigger)\r\n    {\r\n      sourceCode = dxl(t) &quot;&quot;;\r\n    }\t\t\r\n  }\r\n\t\r\n  return sourceCode;\r\n}\r\n\r\nvoid doDeselect(DBE dbe, int idx)\r\n{\r\n  \/\/infoBox &quot;You deselected &quot; dbe&#x5B;idx] &quot;&quot;;\r\n} \r\n\r\n\r\nvoid doActivate(DBE dbe, int idx)\r\n{\r\n  \/\/ infoBox &quot;You activated &quot; dbe&#x5B;idx] &quot;&quot;;\t\r\n}\r\n\r\nvoid doSelect(DBE dbe, int idx)\r\n{\r\n  string triggerName = getColumnValue(textList,idx,0);\r\n  set(textBox, getSourceForTriggerName(triggerName));\t\r\n} \r\n\r\nvoid main(void)\r\n{\r\n  User currentUser = find();\r\n  bool mayDXL = currentUser.mayEditDXL;\r\n  if (!mayDXL)\r\n  {\r\n   \/\/ Show error box and inform user. Stop execution of script.\r\n   errorBox &quot;You are not allowed to run\/edit DXL code!&quot;;\r\n   halt;\r\n  }\t\t\r\n\t\r\n  mainWindow = create(&quot;List all triggers&quot;);\r\n\t\r\n  textList = listView(mainWindow, 0, 310, 20, lstArray);\t\t\r\n  textBox = text(mainWindow, &quot;&quot;, &quot;&quot;, 400, false);\r\n\t\r\n  textList-&gt;&quot;right&quot;-&gt;&quot;unattached&quot;;\r\n  textBox-&gt;&quot;left&quot;-&gt;&quot;flush&quot;-&gt;textList;\r\n  textBox-&gt;&quot;top&quot;-&gt;&quot;aligned&quot;-&gt;textList;\t\r\n\r\n  realize(mainWindow);\t\t\t\r\n\t\r\n  insertColumn(textList, 0, &quot;Trigger Name&quot;, 300, iconNone);\r\n\t\r\n  set(textList,doSelect,doDeselect,doActivate);\t\t\r\n  listAllTriggerForMod(current);\r\n\t\r\n  \/\/ set(textBox, listAllTriggerForMod(current));\r\n  show(mainWindow);\t\r\n}\r\n\r\nmain();\r\n<\/pre>\n<iframe src=\"http:\/\/www.facebook.com\/plugins\/like.php?href=https%3A%2F%2Fwww.capri-soft.de%2Fblog%2F%3Fp%3D1250&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 When there are triggers on a module it often is not visible to administrators and other users that can perform DXL operations. Approach A menu point as module add in should be generated. Copy the following script to the moduleaddins directory of your doors installation. Solution \/\/ This is necessary that it works \/******************************************************* &hellip; <a href=\"https:\/\/www.capri-soft.de\/blog\/?p=1250\" class=\"more-link\"><span class=\"screen-reader-text\">IBM Doors DXL: Browse Triggers on module<\/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":[22,19],"tags":[],"class_list":["post-1250","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-ka","jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1250","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=1250"}],"version-history":[{"count":2,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1250\/revisions"}],"predecessor-version":[{"id":1252,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1250\/revisions\/1252"}],"wp:attachment":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1250"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1250"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}