答案 0 :(得分:1)
如果您将 Calloperation 链接到模型中的实际操作,则如下所示:
您可以使用属性中的“行为”选项卡选择操作
API 不会公开此信息,因此您必须自己查找。
操作的 GUID 存储在数据库字段 t_object.Classifier_guid
中。您可以使用方法 EA.Repository.GetMethodByGuid()
进行操作。
这里是如何在我的 framework
中实现的 /// <summary>
/// The operation to be invoked by the action execution.
/// </summary>
public UML.Classes.Kernel.Operation operation {
get{
// first get the operations guid which is stored in the Classifier_guid column
XmlDocument operationGUIDxml = this.EAModel.SQLQuery(@"select o.Classifier_guid from t_object o
where o.Object_ID = " + this.id.ToString());
XmlNode operationGUIDNode = operationGUIDxml.SelectSingleNode(this.EAModel.formatXPath("//Classifier_guid"));
return this.EAModel.getOperationByGUID(operationGUIDNode.InnerText);
}
set{
// no API method available, so we need to update the database directly
// this.model.executeSQL(@"update t_object
// set Classifier_guid = "+ ((Operation)value).GUID
// + "where Object_ID = " + this.id.ToString();
//TODO add GUID property to Operation
throw new NotImplementedException();
}
}