Enterprise Architect基于SVN多人协作环境搭建
本文简单介绍基于TortoiseSVN搭建Enterprise Architect多人协作环境的方法。
一、软件安装
1、版本管理工具TortoiseSVN
安装时需选择“command line client tools”,该选项默认安装时不会被选中,需手动选择。
2、设计工具Enterprise Architect
无特殊说明
二、svn协作搭建步骤
配置svn环境
1、在svn服务器上申请单独的目录取名存放设计文件,比如EADesign/SDK3.0
2、配置目录的人员权限
配置服务器EA环境(导入已有EA设计文件)
1、EA多人协作是基于文件夹目录协作的,所以需将已有的EA文件分好目录结构,各开发人员仅checkout指定目录即可
举例:如果需要多开发人员同步设计基于类的时序图,可以分成Android和IOS两个目录,各自分为时序图和类图,参考下图
2、将已有eap工程导入到服务器中
2.1、在Model根节点右键->包控制->版本控制配置
2.2、填入唯一ID、选择subversion、选择本地工作地址(使用svncheckout的地址)、本地svn的安装目录
3、添加分支控制版本,右键选择”包控制“-”添加分支到版本控制“。弹出界面,选择确定,会在本地工作目录下产生ea子文件,将原有的ea文件导出到工作目录,ea软件会自动checkin到svn服务器上。
配置客户端环境(开发人员导出设计文件)
1、新建空的eap工程,无需选择任何模型
2、在model根节点右键选择包控制->导入模型节点
3、选择一个模型分支,即指定到本地工作目录,选择*.eab文件
4、修改工作路径为本地工作目录
5、导入后的视图如下,与服务器上一致
协同工作
1、在文件目录上点击右键->包控制。可以看到版本控制的选项
检入分支 checkin branch ——checkin该目录下所有子目录及文件
检出分支 checkout branch ——checkout该目录下所有子目录及文件
检入 ——仅checkin该目录下的文件
检出 ——仅checkout该目录下的文件
2、每次checkout前,先使用”取得最新版本“或“全部最新版本”将本地文件更新到最新之后再checkout。
3、如果目录已经被其他开发人员checkout,则checkout会失败
4、所有本地目录不要使用中文目录,否则会报错。
常见问题
1、如果某目录的xml过大(255K以上),会导致其他同事更新或者重新Import的时候报错,报错内容是“Enterprise Architect DAO.Field[3163] The field is too small to accept the amount of data you attempted to add.”
【解决办法】a)在原来正确的eap文件中,选择出错的目录(或者其上一级目录)上点击右键,Import/Export–>Export package to XMI file。弹出的选框中Export Type选择“XMI 2.1”,然后导出。
b)新建一个eap,导入原来svn上的所有内容,然后在出错的目录(或者其上一级目录)(注意与第一步的目录保持一致)上点击右键,Import/Export->Import package from XMI file。将导出的xml文件再导入到eap中。
2、网上查的解释,意思就是要换成xml格式为3.2.0.1以上的:https://wiki.nci.nih.gov/display/caCORE/UML+Modeling+FAQs
Q. When I try to import the XMI file, I get an error.
The error is:
DAO.field CommonProjects:3163 The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data.
If I click OK to proceed the past this error, the resulting model that gets imported is missing attributes in some of my classes. What is the problem with my XMI file?
ANSWER: EA tags have a limit of 255 characters. In the XMI file, concept definitions are saved using tags (e.g., PropertyConceptDefinition?, ObjectClassConceptDefinition?). Some concepts have definitions that are greater than 255 characters. In previous versions of SIW (pre-3.2.0.1), the SIW would place these long definitions into the XMI file as a single tag value. When that XMI file is then imported back into EA, EA cannot place the entire definition into the tag value. If EA is trying to load a class, then it will simply truncate the definition and proceed with the import. But if the long tag value is associated with an attribute, EA actually stops importing that attribute altogether, and in fact, skips over to the next class. As a result, the UML model that is imported, will be missing attributes.
SIW 3.2.0.1 adds extra tags that allow these long concept definitions to be split up into multiple tags. This is all done automatically by the SIW whenever a new concept is added to a clas/attribute/permissible value/association. However, for XMI files created pre-3.2.0.1, the existing concept definition tags will still contain definitions >255 characaters. The SIW will split these definitions into multiple tags, only if you do the following:
Open the pre-3.2.0.1 XMI file in 3.2.0.1 SIW.
Check EACH class/attribute/permissible value/association that is mapped to concepts.
If any of the concept definitions are >255 characters, place your cursor in the definition text box. Make an "edit" in that text box that does not change the definition in any way (e.g., type control-A to select all text, or add a space then immediately delete it, etc.).
After making the "edit" you will see the Apply button becomes active. Click the Apply button. This signals SIW that it should update the XMI for these concepts. As part of the update, it will automatically split the definition into multiple tags.
After you have done this for ALL classes/attributes/permissible values/associations, save the XMI file.
Now you should be able to import the XMI file into EA without any DAO.Field errors. Note that you only need to do this update process one time. Once your model is updated so that all existing concept definitions have been split into multiple tags, any additional concept definitions added later to your model will be split into multiple tags when added.(8/9/07)