|
|
|
Re: [EMF Compare] [message #544960 is a reply to message #544716] |
Tue, 06 July 2010 07:43 |
|
This is a multi-part message in MIME format.
--------------020705050202020608030304
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Hi Beti,
Please take a look at the EMF Compare FAQ
http://wiki.eclipse.org/EMF_Compare_FAQ#Which_files_should_b e_compared_via_EMF_Compare_.3F
and let us know if we need to simplify or elaborate on these explanations.
Laurent Goubet
Obeo
Beti wrote:
> Hi, I am also discovering EMF compare features. I would like to know
> how can I compare models with extension .emx.
>
> Thanks in advance
--------------020705050202020608030304
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"
YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------020705050202020608030304--
|
|
|
Re: [EMF Compare] [message #545619 is a reply to message #544960] |
Thu, 08 July 2010 13:07 |
Beti Missing name Messages: 6 Registered: July 2010 |
Junior Member |
|
|
Hi,
Thanks a lot for your message. But, even after some time spent on the problem, I have still questions about how to use this or that object.
I am working on comparing UML/OCL models. My goal is for example to find the variable definitions or uses that changed into the OCL code. My question is maybe naive, but how can I get my object variable (from my metamodel) which use is changed into the OCL code ( in a operation of my Class Diagram, for instance), once I have called the DiffService.doDiff() operation? Can I just say :
if (diff instance of Variable) {return diff;}
In addition, here is a part of my code :
protected static int getSubchanges(DiffGroup d)
{
int res = 0;
for (DiffElement diff : d.getSubDiffElements()) {
if (diff instanceof DiffGroup) {
System.out.println("diff group : "+((DiffGroup)diff).getRightParent());
res += getSubchanges((DiffGroup)diff);
} else {
System.out.println("nb : "+diff.eClass());
res += 1;
}
}
return res;
}
protected static int getSubchanges(DiffModel self) {
int subChanges = 0;
System.out.println("totot");
for (DiffElement diff : self.getOwnedElements()) {
if (diff instanceof DiffGroup) {
System.out.println("diff group First: "+((DiffGroup)diff));
subChanges += getSubchanges((DiffGroup)diff);
} else {
System.out.println("diff unit sub"+diff.eContents());
subChanges += 1;
}
}
return subChanges;
}
ann in my main :
// Computing differences
DiffModel diff = DiffService.doDiff(match, false);
int nb = getSubchanges(diff);
Sorry, if my question is not very clear.
Thanks in advance!
Best regards,
Beti
[Updated on: Thu, 08 July 2010 13:08] Report message to a moderator
|
|
|
Re: [EMF Compare] [message #545697 is a reply to message #545619] |
Thu, 08 July 2010 16:10 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi Beti
For EMF Compare to give you an intelligent OCL difference you would need
to have your OCL represented by its AST. I suspect that most tools are
currently persisting the OCL as a string.
If you are working within the context of your own Java code, you could
try traversing your model and replacing each String-based expression
with its parsed equivalent.
Regards
Ed Willink
On 08/07/2010 14:07, Beti wrote:
> Hi,
>
> Thanks a lot for your message. But, even after some time spent on the
> problem, I have still questions about how to use this or that object.
> I am working on comparing UML/OCL models. My goal is for example to find
> the variable definitions or uses that changed into the OCL code. My
> question is maybe naive, but how can I get my object variable (from my
> metamodel) which use is changed into the OCL code ( in a operation of my
> Class Diagram, for instance), once I have called the
> DiffService.doDiff() operation? Can I just say :
>
> if (diff instance of Variable) {return diff;}
> In addition, here is a part of my code :
> protected static int getSubchanges(DiffGroup d)
> {
> int res = 0;
>
> for (DiffElement diff : d.getSubDiffElements()) {
> if (diff instanceof DiffGroup) {
> System.out.println("diff group : "+((DiffGroup)diff).getRightParent());
> res += getSubchanges((DiffGroup)diff);
> } else {
>
> System.out.println("nb : "+diff.eClass());
> res += 1;
> }
> }
>
> return res;
>
> }
> protected static int getSubchanges(DiffModel self) {
> int subChanges = 0;
> System.out.println("totot");
> for (DiffElement diff : self.getOwnedElements()) {
> if (diff instanceof DiffGroup) {
> System.out.println("diff group First: "+((DiffGroup)diff));
> subChanges += getSubchanges((DiffGroup)diff);
> } else {
> System.out.println("diff unit sub"+diff.eContents());
> subChanges += 1;
> }
> }
> return subChanges;
> }
>
> ann in my main :
> // Computing differences
> DiffModel diff = DiffService.doDiff(match, false);
>
>
> int nb = getSubchanges(diff);
|
|
|
|
|
Re: [EMF Compare] [message #623040 is a reply to message #623039] |
Tue, 06 July 2010 07:43 |
|
This is a multi-part message in MIME format.
--------------020705050202020608030304
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Hi Beti,
Please take a look at the EMF Compare FAQ
http://wiki.eclipse.org/EMF_Compare_FAQ#Which_files_should_b e_compared_via_EMF_Compare_.3F
and let us know if we need to simplify or elaborate on these explanations.
Laurent Goubet
Obeo
Beti wrote:
> Hi, I am also discovering EMF compare features. I would like to know
> how can I compare models with extension .emx.
>
> Thanks in advance
--------------020705050202020608030304
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"
YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------020705050202020608030304--
|
|
|
|
Re: [EMF Compare] [message #623050 is a reply to message #623049] |
Thu, 08 July 2010 16:10 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi Beti
For EMF Compare to give you an intelligent OCL difference you would need
to have your OCL represented by its AST. I suspect that most tools are
currently persisting the OCL as a string.
If you are working within the context of your own Java code, you could
try traversing your model and replacing each String-based expression
with its parsed equivalent.
Regards
Ed Willink
On 08/07/2010 14:07, Beti wrote:
> Hi,
>
> Thanks a lot for your message. But, even after some time spent on the
> problem, I have still questions about how to use this or that object.
> I am working on comparing UML/OCL models. My goal is for example to find
> the variable definitions or uses that changed into the OCL code. My
> question is maybe naive, but how can I get my object variable (from my
> metamodel) which use is changed into the OCL code ( in a operation of my
> Class Diagram, for instance), once I have called the
> DiffService.doDiff() operation? Can I just say :
>
> if (diff instance of Variable) {return diff;}
> In addition, here is a part of my code :
> protected static int getSubchanges(DiffGroup d)
> {
> int res = 0;
>
> for (DiffElement diff : d.getSubDiffElements()) {
> if (diff instanceof DiffGroup) {
> System.out.println("diff group : "+((DiffGroup)diff).getRightParent());
> res += getSubchanges((DiffGroup)diff);
> } else {
>
> System.out.println("nb : "+diff.eClass());
> res += 1;
> }
> }
>
> return res;
>
> }
> protected static int getSubchanges(DiffModel self) {
> int subChanges = 0;
> System.out.println("totot");
> for (DiffElement diff : self.getOwnedElements()) {
> if (diff instanceof DiffGroup) {
> System.out.println("diff group First: "+((DiffGroup)diff));
> subChanges += getSubchanges((DiffGroup)diff);
> } else {
> System.out.println("diff unit sub"+diff.eContents());
> subChanges += 1;
> }
> }
> return subChanges;
> }
>
> ann in my main :
> // Computing differences
> DiffModel diff = DiffService.doDiff(match, false);
>
>
> int nb = getSubchanges(diff);
|
|
|
Powered by
FUDForum. Page generated in 0.03900 seconds