如何通过 API 提取应用于 Enterprise Architect 中的需求工件的基本原理和问题
How to extract the Rationale and Problem applied to a Requirement artifact in Enterprise Architect through API
我在需求图中定义了一些需求,如下图所示。我想通过 API.
获取附加到要求的基本原理和问题
DB在t_object[=21]中的需求和注意没有关系=] table。我是否必须在其他 table 中查找?请提出建议。
EA.Elements
(t_object) 使用 EA.Connector
(t_connector)
相互连接
因此,为了将您的要求转化为您的笔记,您可以这样做
foreach (EA.Connector connector in myRequirement.Connectors)
{
EA.Element otherElement;
if (connector.ClientID != myRequirement.ElementID)
{
otherElement = myRepository.GetElementByID(connector.ClientID)
}
else
{
otherElement = myRepository.GetElementByID(connector.ClientID)
}
if (otherElement.Type == "Note")
{
return otherElement;
}
}
在查询中你可以这样
select note.*
from t_object o
inner join t_connector c on o.Object_ID in (c.Start_Object_ID, c.End_Object_ID)
inner join t_object note on note.Object_ID in (c.Start_Object_ID, c.End_Object_ID)
and note.Object_Type = 'Note'
where o.ea_guid = '<myRequirementGUID>'
我在需求图中定义了一些需求,如下图所示。我想通过 API.
获取附加到要求的基本原理和问题DB在t_object[=21]中的需求和注意没有关系=] table。我是否必须在其他 table 中查找?请提出建议。
EA.Elements
(t_object) 使用 EA.Connector
(t_connector)
因此,为了将您的要求转化为您的笔记,您可以这样做
foreach (EA.Connector connector in myRequirement.Connectors)
{
EA.Element otherElement;
if (connector.ClientID != myRequirement.ElementID)
{
otherElement = myRepository.GetElementByID(connector.ClientID)
}
else
{
otherElement = myRepository.GetElementByID(connector.ClientID)
}
if (otherElement.Type == "Note")
{
return otherElement;
}
}
在查询中你可以这样
select note.*
from t_object o
inner join t_connector c on o.Object_ID in (c.Start_Object_ID, c.End_Object_ID)
inner join t_object note on note.Object_ID in (c.Start_Object_ID, c.End_Object_ID)
and note.Object_Type = 'Note'
where o.ea_guid = '<myRequirementGUID>'