当前位置: 首页 > 知识库问答 >
问题:

Enterprise Architect脚本:为序列图设置连接器属性

孙阳旭
2023-03-14

我在两个元素之间创建了一个消息(序列连接器):

dim w_src as EA.Element
dim w_dst as EA.Element

set w_src = Repository.GetElementByGuid("{C90B3F33-D01D-48d9-A46A-BD32CA8AF20E}")
set w_dst = Repository.GetElementByGuid("{239814DD-D331-47dc-A198-F2C32E57471C}")

Session.Output "Src: " & w_src.Name
Session.Output "Dest: " & w_dst.Name

dim w_con as EA.Connector
set w_con = w_src.Connectors.AddNew("wocMessage", "Sequence")
w_con.SupplierID = w_dst.ElementID

w_con.Stereotype = "query"

if not w_con.Update then : Session.Output "Error:" & w_con.GetLastError : exit sub : end if

w_src.Connectors.Refresh
    null

编辑:感谢Geert的回答,以下是以编程方式设置用户界面提供的所有参数的完整代码(在EA10上测试):

dim w_src as EA.Element
dim w_dst as EA.Element

set w_src = Repository.GetElementByGuid("{C90B3F33-D01D-48d9-A46A-BD32CA8AF20E}")
set w_dst = Repository.GetElementByGuid("{239814DD-D331-47dc-A198-F2C32E57471C}")

Session.Output "Src: " & w_src.Name
Session.Output "Dest: " & w_dst.Name

dim w_con as EA.Connector
set w_con = w_src.Connectors.AddNew("wocMessage", "Sequence")
w_con.SupplierID = w_dst.ElementID

w_con.Stereotype = "query"
w_con.StyleEx = "aliasparamsTO=int, string;paramvalues=5, theString;aliasparams=5, theString;alias=theAlias;"
w_con.Subtype = "" ' Lifecycle: "New" | "Delete" | ""
w_con.Notes = "This is a note"

if not w_con.Update then : Session.Output "Error:" & w_con.GetLastError : exit sub : end if

'w_con.MiscData(0) = "Asynchronous"
dim w_params : w_params = "'retval=unsigned int;params=5, theString;paramsDlg=5, theString;retatt=returnedValue;'"
dim w_condition : w_condition = "'theCondition'"
dim w_constraint : w_constraint = "'theConstraint'"
dim w_isIteration : w_isIteration = "'Iteration'" ' 'Iteration' | NULL
dim w_synch : w_synch = "'Synchronous'" ' 'Synchronous' | 'Asynchronous'
dim w_kind : w_kind = "'Call'" ' 'Call' | 'Signal'
dim w_isReturn : w_isReturn = 0 ' 1 | 0

Repository.Execute("update t_connector set PDATA1=" & w_synch _
    & ", PDATA2=" & w_params _
    & ", PDATA3=" & w_kind _
    & ", PDATA4=" & w_isReturn _
    & ", SourceCard=" & w_isIteration _
    & ", Btm_Mid_Label=" & w_condition _
    & ", SourceConstraint=" & w_constraint _
    & " where Connector_ID=" & w_con.ConnectorID)

w_src.Connectors.Refresh

Session.Output "[OK]"

共有1个答案

翟源
2023-03-14

您必须检查t_connector的列。我知道生命周期被放入子类型,但其他参数可能存储在其他地方。

特别注意PDATA*和STYLE*列。它们通常包含这种类型的信息。

 类似资料:
  • 问题内容: 要指定SQLite连接属性,请使用org.sqlite.SQLiteConfig,它的内容如下: 使用c3p0创建连接池的过程如下: 问题:如何创建结合了两者的数据源,让我设置诸如连接池的最大池大小和sqlite的同步模式之类的东西? 问题答案: 尝试 现在,数据源将是c3p0 PooledDataSource,它包装了已根据需要配置的SQLite未池化数据源。 请参阅C3P0的文档,

  • 技巧 有人问我,如何通过选项来指定动态连接器,而不使用缺省系统自带的动态连接器。我后来查了下ld的手册,有这么一个选项: -Ifile --dynamic-linker=file Set the name of the dynamic linker. This is only meaningful when generating dynamically linked ELF ex

  • 在Enterprise Architect中,可以在特定的关系图中隐藏连接器。开发外接程序(扩展),我需要通过“代码”执行这样的动作,但是我找不到连接器/关系图类的相应属性。 如果有人能帮助找到设置连接器可见性的相关属性,我将不胜感激。

  • 引用OHMY! Nitro Cursor I.nsi的内容: ; 该脚本使用 HM VNISEdit 脚本编辑器向导产生 ; 安装程序初始定义常量 !define PRODUCT_NAME "OHMY! Nitro Cursor I" !define PRODUCT_VERSION "1.0" !define PRODUCT_PUBLISHER "OHMY! Nitro Cursor I" !

  • 我使用的debezium-connector:https://repo1.maven.org/maven2/io/debezium/debezium-connector-oracle/1.4.0.final/debezium-connector-oracle-1.4.0.final-plugin.tar.gz 我遵循了docker-compose的以下说明:https://github.com/c