Running Metrics Programmatically

MagicDraw OpenAPI, scripting related questions and discussions

Moderator: Moderators

Running Metrics Programmatically

Postby timmasbd@gmail.com » Sat Mar 25, 2023 4:01 pm

Hi there, I'm currently trying to execute my metric suites programmatically through the API - ideally without needing to have use Requirement Table to execute against. It appears there used to be a "MetricsTool" which was part of report wizard but was removed for some reason in one of the Cameo 19.0 SPs. I've read through previous posts on this forum which have given me another option using the MetricsValuesManager (noting this isn't part of the public API). I did some interrogation of this class programmatically and found the following public method available. I'm assuming that the "Classifier" is intended to be the scope element for the metric to run on. I've been trying to determine what should go in the map that is provided as the second argument, it appears that the "key" elements need to be "Property" elements, so presumably the MetricDefinition properties. I've been unable to determine what the "value" elements need to be, but the fact that even providing null it still seems to work suggests this should be empty. My issue is that even providing all of this, the map that is returned is always empty. Does anyone have any more information on what the parameters for this method should accept, and what it is meant to return?

public static java.util.Map com.nomagic.magicdraw.modelmetrics.expressions.MetricsValueManager.calculateAllValues(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Classifier, java.util.Map)
timmasbd@gmail.com
Forum Newbie
Forum Newbie
 
Posts: 1
Posts Rating:0
Joined: Fri Mar 24, 2023 9:29 pm

Return to Programmatic Extendibility

Who is online

Users browsing this forum: No registered users and 0 guests