Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Problem resolving object slots from ECL
Problem resolving object slots from ECL [message #588265] Tue, 13 April 2010 10:44
Eclipse User
Originally posted by: c.k.holmes.lboro.ac.uk

Hi,
I have an increasingly refined model structure of the form:
Project A
Package A1
Package A2
Where Package A2 has a 'ref' relationship to a class defined in Package
A1 (I suspect this detail is irrelevant to this query).

Project B
Package B1
Although Package B1 actually comprises a nested hierarchy of packages it
extends some of the concepts introduced in Package A2.

Package A2 comprises a tree structured hierarchy of classes (the
examples below are contrived):
class Catalogue {
attr String name = "";
val Component[*] contains;
}
class Component {
attr String name = "";
val SubComponent[*] contains;
}
class SubComponent {
attr String name = "";
}

Package B1 comprises:
class Specification extends A2.Catalogue {
<more attributes>
}
class SpecifiedSubComponent extends A2.SubComponent {
<more attributes>
}

I want to compare two instances of the same metamodel. My ECL looks like
this:
pre {
}
post {
}
rule Specification
match left : Left!Specification
with right : Right!Specification {
compare {
return left.name = right.name;
}
do {
if(LoggingEnabled) {
('specification matched on: ' + left.name).println();
}
}
}
rule Component
match left : Left!Component
with right : Right!Component {
compare {
return left.name = right.name;
}
do {
if(LoggingEnabled) {
('component matched on: ' + left.name).println();
}
}
}
rule SpecifiedSubComponent
match left : Left!SpecifiedSubComponent
with right : Right!SpecifiedSubComponent {
compare {
return left.name = right.name;
}
do {
if(LoggingEnabled) {
('specified sub-component matched on: ' + left.name).println();
}
}
}

The ECL reports a failure at the compare statement block for the rule
Component, stating that property 'name' can't be found in class
Component. However the logging trace shows that the message:
'component matched on: aComponnetName' has been ejected to the console,
hence it has resolved the name attribute of the 'left' object (I can
switch left and right objects, it makes no difference).
If I remove rule Component then the ECL runs to completion without
raising an exception.

I can't see an error in my ECL, and my suspicion is that there is
something awry in the way ECL is dealing with the model hierarchy. I am
running the ECL from an Ant script.

Regards
Chris
Previous Topic:Passing Parameters into ETL from Ant
Next Topic:Problem resolving object slots from ECL
Goto Forum:
  


Current Time: Wed Oct 22 08:04:26 GMT 2014

Powered by FUDForum. Page generated in 0.15888 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software