2

我目前做逆向工程MS SQL服务器2008年进入的Sparx的企业架构师版本创建数据库模型10隐藏在企业架构师的进口数据库模型的初始值

我已经能够导入表,并隐藏物品这是不需要的(这种操作和定型)。但是,在导入表格或图表属性时,我没有找到为列Initial隐藏值的选项,这使我可以逐个编辑每列(耗时)。

我是否错过任何配置来隐藏Initial值?如果这种配置不存在,那么在没有配置的情况下隐藏/删除初始值的最佳方法是什么?

回答

0

最后通过创建EA脚本得到了解决方案。感觉自由使用和增强它:)

!INC Local Scripts.EAConstants-JScript 

function OnProjectBrowserScript() 
{ 
    // Show the script output window 
    Repository.EnsureOutputVisible("Script"); 

    var treeSelectedType = Repository.GetTreeSelectedItemType(); 

    switch (treeSelectedType) 
    { 
     case otElement: // if select table 
     { 
      removeInitial(Repository.GetContextObject()); 
      break; 
     } 
     case otPackage: // if select package containing table 
     { 
      var selectedObject as EA.Element; 
      selectedObject = Repository.GetContextObject(); 

      for (var i = 0 ; i < selectedObject.Elements.Count ; i++) 
      { 
       removeInitial(selectedObject.Elements.GetAt(i)); 
      } 
      break; 
     } 
     default: 
     { 
      // Error message 
      Session.Prompt("This script does not support items of this type.", promptOK); 
     } 
    } 
} 

function removeInitial(selectedObject) 
{ 
    for (var i = 0 ; i < selectedObject.Attributes.Count; i++) 
    { 
     var attrib as EA.Attribute; 
     attrib = selectedObject.Attributes.GetAt(i); 
     attrib.Default = ""; 
     attrib.Update(); 
    } 
    Session.Output("finished updating " + selectedObject.Name); 

} 

OnProjectBrowserScript();