{"id":1542,"date":"2015-10-15T11:17:55","date_gmt":"2015-10-15T09:17:55","guid":{"rendered":"http:\/\/www.capri-soft.de\/blog\/?p=1542"},"modified":"2018-04-12T14:35:03","modified_gmt":"2018-04-12T12:35:03","slug":"ibm-doors-dxl-renamereplace-enumeration-value-of-a-datatype-enumerationswert-aendern","status":"publish","type":"post","link":"https:\/\/www.capri-soft.de\/blog\/?p=1542","title":{"rendered":"IBM Doors DXL: Rename\/Replace Enumeration Value of a DataType &#8211; Enumerationswert \u00e4ndern"},"content":{"rendered":"<h1>Problem<\/h1>\n<p>An existing enumeration value should be renamed or replaced<\/p>\n<h1>Approach &#8211; Ansatz<\/h1>\n<p>We have to iterate through the Type-Array and repopulate new arrays, which will be used as parameters for the modify function<\/p>\n<h1>Solution &#8211; L\u00f6sung<\/h1>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n\/\/This program was intended to replace the values of an enumerated attribute\r\n\/\/The replace will not affect the current selected values, it will just change the value to the new one\r\n \r\npragma runLim, 0\r\n \r\nvoid replaceAttributeTypeValue(Module m, string atName, string oldVal, string newVal){\r\n    AttrType att = find(m, atName)\r\n        \/\/Declare Arrays Size\r\n        int colores&#x5B;att.size]\r\n        int arrMap&#x5B;att.size]\r\n        string arr&#x5B;att.size]\r\n        int arrVal&#x5B;att.size]\r\n        \r\n        int i\r\n        \/\/Populate Arrays\r\n        for(i = 0; i &lt; att.size; i++){ \r\n                arr&#x5B;i] = att.strings&#x5B;i]\r\n                arrVal&#x5B;i] = i\r\n                colores&#x5B;i] = -1\r\n                arrMap&#x5B;i] = i\r\n        }\r\n        \/\/\r\n        for(i = 0; i &lt; sizeof(arr); i++){ \r\n                if(arr&#x5B;i] == oldVal){\r\n                        arr&#x5B;i] = newVal\r\n                }\r\n        }\r\n \r\n        string err = null\r\n        AttrType at2 = modify(att, atName, arr, arrVal, colores, arrMap, err)\r\n        if(!null err){\r\n                print &quot;Failed: &quot; err&quot;\\n&quot;\r\n        }\r\n        else{\r\n                infoBox at2.name &quot; - Modified Successfully&quot;\r\n        }\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%3D1542&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 An existing enumeration value should be renamed or replaced Approach &#8211; Ansatz We have to iterate through the Type-Array and repopulate new arrays, which will be used as parameters for the modify function Solution &#8211; L\u00f6sung \/\/This program was intended to replace the values of an enumerated attribute \/\/The replace will not affect the &hellip; <a href=\"https:\/\/www.capri-soft.de\/blog\/?p=1542\" class=\"more-link\"><span class=\"screen-reader-text\">IBM Doors DXL: Rename\/Replace Enumeration Value of a DataType &#8211; Enumerationswert \u00e4ndern<\/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-1542","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-oS","jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1542","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=1542"}],"version-history":[{"count":4,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1542\/revisions"}],"predecessor-version":[{"id":2675,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1542\/revisions\/2675"}],"wp:attachment":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1542"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1542"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1542"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}