How can I programmatically link a requirement to a step in test assessment

38 ビュー (過去 30 日間)
Philipp
Philipp 2024 年 8 月 5 日
コメント済み: Philipp 2025 年 2 月 18 日 8:09
I want to link my requirements from requirements editor to specific steps in my test assessment block (I also use test scenarios). I was able to create the link between both via mouse-clicks, but I want to link it via a script.
I suppose it is done by the command
slreq.createLink(src,dest)
but I was not able to get the handle / id / url of the step in my test scenario to use as a source.
If I examine a manually created link it uses the following "adress" to the step in the assessment:
domain: 'linktype_rmi_simulink'
artifact: 'C:\pathtomodel\AutomationExampleUnit.slx'
id: ':urn:uuid:4c7edae6-0d2c-4603-96ec-d8f11e1c3afb:52:84'
But where can I find this id ?
Update: When I would have the id it is possible to create the link this way
source.domain = 'linktype_rmi_simulink';
source.artifact = modelName;
source.id = ':urn:uuid:4c7edae6-0d2c-4603-96ec-d8f11e1c3afb:52:84'
slreq.createLink(source, req_list(i)) % outgoing link from step, inLink for requirement
Thanks in advance !!

採用された回答

Josh Kahn
Josh Kahn 2024 年 8 月 9 日
編集済み: Josh Kahn 2024 年 8 月 9 日
I put this in as an enhancement request for a future release. There are no public APIs for this as of R2024a but if you reach out to our support department, we can provide a workaround
Josh
  3 件のコメント
theShield
theShield 2025 年 2 月 17 日 8:33
編集済み: theShield 2025 年 2 月 17 日 12:18
Could you share the answer @Philipp ?
I am struggling with the same isue. I will really appreciate it.
Philipp
Philipp 約14時間 前
I received a *.p file from Mathworks support which can not be attached here due to restrictions so I guess you also have to contact the support and probably receive the same file from them

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by