{"id":1261,"date":"2014-11-25T11:55:27","date_gmt":"2014-11-25T10:55:27","guid":{"rendered":"http:\/\/www.capri-soft.de\/blog\/?p=1261"},"modified":"2014-11-25T13:13:40","modified_gmt":"2014-11-25T12:13:40","slug":"ibm-doors-dxl-delete-and-create-attributes-for-doors-module","status":"publish","type":"post","link":"https:\/\/www.capri-soft.de\/blog\/?p=1261","title":{"rendered":"IBM Doors DXL: Delete and Create Attributes for Doors Module"},"content":{"rendered":"<h1>Problem<\/h1>\n<p>An Attribute shall be deleted and replaced (recreated) by the same attribute with another type.<\/p>\n<h1>Approach<\/h1>\n<p>&#8211; Delete old attribute<br \/>\n&#8211; Create new one<br \/>\n&#8211; Views will not get lost with this method!<\/p>\n<h1>Solution<\/h1>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nvoid deleteAttrDef(Module m, string s)\r\n{\r\n  string err;\r\n  AttrDef ad = find(m, s);\r\n  err = delete(ad);\r\n  if (err !=&quot;&quot;) ack err;\r\n} \r\n\r\nvoid modifyAttributeType(Module m, string theAttribute, string newAttributType)\r\n{\r\n  current = m;\r\n\t\r\n  \/\/ Delete Attribute attribute1 if exists\r\n  if (exists(attribute(string theAttribute))) \r\n  {\t\r\n    deleteAttrDef(m, theAttribute);\r\n  }\r\n\t\r\n  \/\/ Create new attribute1 of type TEXT (not string)\r\n  AttrDef ad = create object type newAttributType attribute theAttribute\r\n\t\t\r\n  if (null ad)\r\n  {\r\n    print &quot;attr didn&#039;t create for module &quot; fullName(m) &quot;\\n&quot;;\r\n    halt;\r\n  }\t\t\t\r\n}\r\n\r\nmodifyAttributeType(current Module, &quot;My_Attribut_To_Change_Type&quot;, &quot;Text&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%3D1261&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 Attribute shall be deleted and replaced (recreated) by the same attribute with another type. Approach &#8211; Delete old attribute &#8211; Create new one &#8211; Views will not get lost with this method! Solution void deleteAttrDef(Module m, string s) { string err; AttrDef ad = find(m, s); err = delete(ad); if (err !=&quot;&quot;) ack &hellip; <a href=\"https:\/\/www.capri-soft.de\/blog\/?p=1261\" class=\"more-link\"><span class=\"screen-reader-text\">IBM Doors DXL: Delete and Create Attributes for Doors 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":[1],"tags":[],"class_list":["post-1261","post","type-post","status-publish","format-standard","hentry","category-allgemein"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4yGeN-kl","jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1261","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=1261"}],"version-history":[{"count":4,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1261\/revisions"}],"predecessor-version":[{"id":1266,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1261\/revisions\/1266"}],"wp:attachment":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1261"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1261"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1261"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}