我有一个emx文件,其中包含序列图和类图。这些图是跟踪J2EE应用程序执行的结果。
为了帮助您以正确的方式引导您,我正在尝试将序列图转换为调用图(方法)。我非常努力地寻找可以在顺序图中解释所有标签的文档(请检查下面的emx / xmi代码示例),但我做不到。
我试图了解不同的标签及其在序列图中的表示。例如<packagedElement xsi:type="uml:Class">
,<ownedOperation>
,<packagedElement xsi:type="uml:ReceiveOperationEvent">
...
感谢您的帮助。
emx文件示例:
<?xml version="1.0" encoding="ASCII"?>
<uml:Model xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/200`enter code here`1/XMLSchema-instance" xmlns:uml="http://www.eclipse.org/uml2/3.0.0/UML" name="maintrace_main">
<packagedElement xsi:type="uml:Collaboration" name="Collaboration">
<ownedBehavior xsi:type="uml:Interaction" name="Interaction">
<lifeline represents="//Collaboration/@ownedAttribute.0" coveredBy="//Collaboration/Interaction/doGetstart3 //Collaboration/Interaction/doGetend4 //Collaboration/Interaction/doGet5 //Collaboration/Interaction/printlnstart8 //Collaboration/Interaction/printlnreturnEnd14
<fragment xsi:type="uml:MessageOccurrenceSpecification" name="doStartTagend568" covered="//Collaboration/Interaction/@lifeline.8" event="//doStartTag565" message="//Collaboration/Interaction/doStartTag.6"/>
....
</ownedBehavior>
<ownedAttribute type="//test.MainClass"/>
<ownedAttribute type="//test.Etudiant"/>
</packagedElement>
<packagedElement xsi:type="uml:Class" name="test.MainClass" clientDependency="//@packagedElement.29">
<ownedOperation name="main">
<ownedParameter name="arg1" type="//java.lang.String%5B%5D"/>
</ownedOperation>
</packagedElement>
<packagedElement xsi:type="uml:SendOperationEvent" name="println139" operation="//com.sun.j2ee.blueprints.util.tracer.Debug/println"/>
<packagedElement xsi:type="uml:ReceiveOperationEvent" name="println143" operation="//com.sun.j2ee.blueprints.util.tracer.Debug/println"/>
<packagedElement xsi:type="uml:SendOperationEvent" name="println144" operation="//com.sun.j2ee.blueprints.util.tracer.Debug/println"/>
<packagedElement xsi:type="uml:ReceiveOperationEvent" name="processRequest147"/>
<packagedElement xsi:type="uml:SendOperationEvent" name="processRequest148"/>
<packagedElement xsi:type="uml:ReceiveOperationEvent" name="doEnd151" operation="//com.sun.j2ee.blueprints.petstore.control.web.handlers.CartHandler/doEnd"/>
<packagedElement xsi:type="uml:SendOperationEvent" name="doEnd152" operation="//com.sun.j2ee.blueprints.petstore.control.web.handlers.CartHandler/doEnd"/>
<packagedElement xsi:type="uml:ReceiveOperationEvent" name="doEnd156" operation="//com.sun.j2ee.blueprints.petstore.control.web.handlers.CartHandler/doEnd"/>
<packagedElement xsi:type="uml:SendOperationEvent" name="doEnd157" operation="//com.sun.j2ee.blueprints.petstore.control.web.handlers.CartHandler/doEnd"/>
<packagedElement xsi:type="uml:ReceiveOperationEvent" name="processRequest160" operation="//com.sun.j2ee.blueprints.petstore.control.web.RequestProcessor/processRequest"/>
<packagedElement xsi:type="uml:SendOperationEvent" name="processRequest161" operation="//com.sun.j2ee.blueprints.petstore.control.web.RequestProcessor/processRequest"/>
<packagedElement xsi:type="uml:Class" name="com.sun.j2ee.blueprints.petstore.control.web.ScreenFlowManager" clientDependency="//@packagedElement.7007 //@packagedElement.7008 //@packagedElement.7009 //@packagedElement.7010 //@packagedElement.7011">
<ownedOperation name="getNextScreen">
<ownedParameter name="arg1" type="//javax.servlet.http.HttpServletRequest"/>
</ownedOperation>
<ownedOperation name="getURLMapping">
<ownedParameter name="arg1" type="//java.lang.String"/>
<ownedParameter type="//com.sun.j2ee.blueprints.petstore.control.web.URLMapping" direction="return"/>
</ownedOperation>
<ownedOperation name="getTemplate">
<ownedParameter name="arg1" type="//java.util.Locale"/>
<ownedParameter type="//java.lang.String" direction="return"/>
</ownedOperation>
<ownedOperation name="getScreens">
<ownedParameter name="arg1" type="//java.util.Locale"/>
<ownedParameter type="//java.util.HashMap" direction="return"/>
</ownedOperation>
<ownedOperation name="getParameter">
<ownedParameter name="arg1" type="//java.lang.String"/>
<ownedParameter name="arg2" type="//javax.servlet.http.HttpSession"/>
<ownedParameter type="//com.sun.j2ee.blueprints.petstore.control.web.Parameter" direction="return"/>
</ownedOperation>
<ownedOperation name="getScreens">
<ownedParameter name="arg1" type="//java.util.Locale"/>
<ownedParameter type="//java.util.HashMap" direction="return"/>
</ownedOperation>
<ownedOperation name="getParameter">
<ownedParameter name="arg1" type="//java.lang.String"/>
<ownedParameter name="arg2" type="//javax.servlet.http.HttpSession"/>
<ownedParameter type="//com.sun.j2ee.blueprints.petstore.control.web.Parameter" direction="return"/>
</ownedOperation>
<ownedOperation name="getScreens">
<ownedParameter name="arg1" type="//java.util.Locale"/>
<ownedParameter type="//java.util.HashMap" direction="return"/>
</ownedOperation>
<ownedOperation name="getParameter">
<ownedParameter name="arg1" type="//java.lang.String"/>
<ownedParameter name="arg2" type="//javax.servlet.http.HttpSession"/>
<ownedParameter type="//com.sun.j2ee.blueprints.petstore.control.web.Parameter" direction="return"/>
</ownedOperation>
<ownedOperation name="getScreens">
<ownedParameter name="arg1" type="//java.util.Locale"/>
<ownedParameter type="//java.util.HashMap" direction="return"/>
</ownedOperation>
<ownedOperation name="getParameter">
<ownedParameter name="arg1" type="//java.lang.String"/>
<ownedParameter name="arg2" type="//javax.servlet.http.HttpSession"/>
<ownedParameter type="//com.sun.j2ee.blueprints.petstore.control.web.Parameter" direction="return"/>
</ownedOperation>
<ownedOperation name="getScreens">
<ownedParameter name="arg1" type="//java.util.Locale"/>
<ownedParameter type="//java.util.HashMap" direction="return"/>
</ownedOperation>
<ownedOperation name="getParameter">
<ownedParameter name="arg1" type="//java.lang.String"/>
<ownedParameter name="arg2" type="//javax.servlet.http.HttpSession"/>
<ownedParameter type="//com.sun.j2ee.blueprints.petstore.control.web.Parameter" direction="return"/>
</ownedOperation>
</uml:Model>
答案 0 :(得分:0)
我有一个emx文件,其中包含序列图和类图。
否,您显示的文件内容不包含图表定义,而是类和协作定义。图是表示模型一部分的图片,而UML图交换非常不同。
您必须参考UML documentation以获得更多详细信息,但是很容易猜到
List<string> strlist = new List<string> { "one","two", "three" };
string somevalue = "two";
var result = strlist.Exists(e2 => e2 == somevalue);
... <packagedElement xsi:type="uml:Class" ...>
定义了一个类</packagedElement>
... <ownedOperation name="getURLMapping">
定义操作 getURLMapping (此处为类 ScreenFlowManager )</ownedOperation>
表示操作 getURLMapping 的第一个参数名为 arg1 ,并且是Java字符串协作的定义比较复杂,您将其截短了很多,但是有可能看到生命线和一些交换的消息。