有没有办法使用转换编辑器(ctr + alt + h)转换"类"到了班级的属性"使用Enterprise Architect中的Transformation编辑器?
如果我有这个设计:
Class1- | PORT1 | < ---- ----连接器> | port2 | -Class2
我想;
来自port1 |的类1- | flowport1的属性< ---- ----连接器> |来自port2的flowport2 | -Property of Class2
当前代码如下所示(Class):
%if elemType=="Class"%
part
{
%TRANSFORM_CURRENT("Class","stereotype")%
%TRANSFORM_REFERENCE("Class",classGUID)%
name=%qt%%className%%qt%
stereotype = "Block"
%list="InnerClass" @separator="\n" @indent=" "%
}
%elseIf elemType=="Port"%
Port
{
%TRANSFORM_CURRENT("Class","stereotype")%
%TRANSFORM_REFERENCE("Class")%
stereotype = "FlowPort"
%if classStereotype=="inPort"%
Tag
{
%list="InnerClass" @separator="\n" @indent=" "%
name = "direction"
value = "out"
}
%elseIf classStereotype=="OutPort"%
Tag
{
name = "direction"
value = "out"
}
%else%
Tag
{
name = "direction"
value = "inout"
}
%endIf%
%list="Connector" @separator="\n" @indent=" "%
}
%endIf%
当前代码从设计中获取所有类,并使用" stereotype创建新部件:Block"。它还需要设计端口(定义为in- / outports)并将其构造型更改为具有正确方向的flowport。
希望我的解释充分 谢谢