| KDM Method Invocation [message #1086024] |
Tue, 13 August 2013 13:53  |
Claudia Pereira Messages: 2 Registered: December 2012 |
Junior Member |
|
|
I am using MoDisco to discover UML interaction models from Java code.
I am analysing a KDM ActionElement representing a method invocation. How can I know which code element is the target object (the object that will receive the method call) ?
In this post (http://www.eclipse.org/forums/index.php/t/356704/), it is said that "KDM Action Elements of kind "method invocation" have Calls accessible via their reference actionRelation.Each Calls element has "to" and "from" references, respectively giving the called MethodUnit and the element (variable, other method invocation, etc) on which it is called"
However, in the KDM model, the reference "from" is the ActionElement from which the call relation originates. I do not find the way to obtain the object that receive the method call. For example:
the following sentence in java code:
"a.method(b) "
is translated in the KDM model:
.....
" - [ActionElement] expression statement
- [ActionElement] method invocation
-actionRelation
- Calls
-to: [MethodUnit] method
-from: [ActionElement] method invocation "
How I can get the object 'a'?
Thank you in advance.
Best regards,
Claudia
|
|
|
| Re: KDM Method Invocation [message #1089902 is a reply to message #1086024] |
Mon, 19 August 2013 08:07   |
Fabien Giquel Messages: 136 Registered: July 2009 |
Senior Member |
|
|
Hello Claudia,
i had a look at the discovered model and at the OMG KDM specification, and i have understood that there is one missing "[Adresses]" instance. The "[ActionElement] method invocation" should contain this missing "[Adresses]" instance which should reference the '[StorableUnit] a' .
So the Modisco KDM Model discoverer must be fixed to create this missing instance. Please apologize for this loss of information. Could you enter one bugzilla at https://bugs.eclipse.org/bugs/query.cgi?classification=Modeling&product=MDT.MoDisco, and simply copy/paste your original comment ?
KDM specification gives this example :
"c.add(o);"
--> xmi traduction in kdm model
...
<parameterUnit xmi:id="id.10" name="c" type="id.11">
...
<codeElement xmi:id="id.84" xmi:type="code:MethodUnit" name="add"/>
...
<codeElement xmi:id="id.34" xmi:type="action:ActionElement"
name="a1.5" kind="Call">
<actionRelation xmi:id="id.35" xmi:type="action:Addresses"
to="id.10" from="id.34"/>
<actionRelation xmi:id="id.36" xmi:type="action:Reads" to="id.44" from="id.34"/>
<actionRelation xmi:id="id.37" xmi:type="action:Calls" to="id.84" from="id.34"/>
<actionRelation xmi:id="id.38" xmi:type="action:Flow" to="id.19" from="id.34"/>
</codeElement>
Fabien.
----------------------------------------------------
Fabien GIQUEL
R&D Engineer
Mia-Software
4, rue du Château de l'Eraudiere
44324 NANTES CEDEX 03
----------------------------------------------------
|
|
|
|
Powered by
FUDForum. Page generated in 0.02088 seconds