Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Problem with HUTN configuration files(Problem with HUTN configuration files)
Problem with HUTN configuration files [message #640779] Tue, 23 November 2010 07:24 Go to next message
Jes is currently offline JesFriend
Messages: 9
Registered: November 2010
Junior Member
Hi again!

I'm having problems with reference elements in hutn configuration files. For instance, this a configuration I'm using:

patterns: ConfiguredPattern "CP1" {
specifics: SpecificInstance "SI1" {
instance: Instance " platform:/resource/es.cv.gvcase.linkers.dd2cld.transf/models /DD2CLD.rulescatalog#//@configurations.0/@pattern/@elements. 0 "
element: DataStructure " /es.cv.gvcase.linkers.dd2cld.test.data/models/TFR-MAP-003-V0 0-001.model#//gbddName/dsName "
}
pattern: Pattern " platform:/resource/es.cv.gvcase.linkers.dd2cld.transf/models /DD2CLD.rulescatalog#//@configurations.0/@pattern "
firstElement: DataStructure " /es.cv.gvcase.linkers.dd2cld.test.data/models/TFR-MAP-003-V0 0-001.model#//gbddName/dsName "
defaultRule: Rule " platform:/resource/es.cv.gvcase.linkers.dd2cld.transf/models /DD2CLD.rulescatalog#//@configurations.0/@rules.0 "
parameterValue: ParameterValue "PV1" {
parameter: Parameter " platform:/resource/es.cv.gvcase.linkers.dd2cld.transf/models /DD2CLD.rulescatalog#//@configurations.0/@parameter.0 "
}
rule: Rule " platform:/resource/es.cv.gvcase.linkers.dd2cld.transf/models /DD2CLD.rulescatalog#//@configurations.0/@rules.0 "
...

The lines "element:" and "firstElement:" are wrong. I'm using epsilon 0.8.9. In the 0.8.8 version this syntax error doesn't occur.

My point is that the elements must be referenced by ID, but not all the elements contains an ID field.

Any idea?

Thanks.
Re: Problem with HUTN configuration files [message #640826 is a reply to message #640779] Tue, 23 November 2010 10:10 Go to previous messageGo to next message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Hi Jes,

I'm a bit confused... This HUTN source code doesn't use a HUTN configuration file. In Epsilon, HUTN configuration files only define three types (Configuration, IdentifierRule and DefaultValueRule), none of which are used in this HUTN source code.

So, it seems that this isn't a problem with HUTN configuration files, but with a cross-model reference. I think the errors might be expected because, in this HUTN source, the two lines that have errors (firstElement and element) seem to be incorrect for two reasons:

1) They should start with "platform:/resource" (like the other cross-references in this HUTN source).

2) They should reference the target model elements using a URI fragment. For example, "//@configurations.0/@rules.0" is a valid URI fragment, which means the "first rule contained in the first configuration of the model".
"//gbddName/dsName" is not a valid URI fragment, and EMF cannot resolve it. Either use a valid URI fragment, or use an XMI ID instead.

The EMF book describes the way in which URI fragments and XMI IDs can be used to refer to model elements. There seems to be an online version of the relevant chapter here: http://learning.infocollections.com/ebook%202/Computer/Progr amming/Java/Eclipse.Modeling.Framework/0131425420_ch13lev1se c2.html

I can't explain why this worked in Epsilon 0.8.8. Without a URI schema (such as "platform:/resource"), the cross-references could not have been resolved. I hope the two proposals above help to fix the problem now though.

Cheers,
Louis.
Re: Problem with HUTN configuration files [message #641062 is a reply to message #640779] Wed, 24 November 2010 07:52 Go to previous messageGo to next message
Jes is currently offline JesFriend
Messages: 9
Registered: November 2010
Junior Member
This is another (full) example that works in Epsilon 0.8.8:

@Spec {
metamodel "Configuration_UML2DB" {
nsUri: "http:///es.cv.gvcase.transformationConfiguration.ecore"
}
}

C_UML2DB {
Configuration "Configuration_UML2DB" {
name: "Configuration_UML2DB"
patterns: ConfiguredPattern "CP1" {
specifics: SpecificInstance "SI1" {
instance: Instance " platform:/resource/es.cv.gvcase.linkers.uml2db.transf/models /UML2DB.rulescatalog#//@configurations.12/@pattern/@elements .0 "
element: Class " /es.cv.gvcase.linkers.uml2db.test.data/models/TFR-MAP-003-V0 3-001.model#//C1 "
}
pattern: Pattern " platform:/resource/es.cv.gvcase.linkers.uml2db.transf/models /UML2DB.rulescatalog#//@configurations.12/@pattern "
firstElement: Class " /es.cv.gvcase.linkers.uml2db.test.data/models/TFR-MAP-003-V0 3-001.model#//C1 "
defaultRule: Rule " platform:/resource/es.cv.gvcase.linkers.uml2db.transf/models /UML2DB.rulescatalog#//@configurations.12/@rules.0 "
parameterValue: ParameterValue "PV1" {
parameter: Parameter " platform:/resource/es.cv.gvcase.linkers.uml2db.transf/models /UML2DB.rulescatalog#//@configurations.12/@parameter.0 "
value: Property " /es.cv.gvcase.linkers.uml2db.test.data/models/TFR-MAP-003-V0 3-001.model#//C1/P1 "
value: Property " /es.cv.gvcase.linkers.uml2db.test.data/models/TFR-MAP-003-V0 3-001.model#//C1/P2 "
}
rule: Rule " platform:/resource/es.cv.gvcase.linkers.uml2db.transf/models /UML2DB.rulescatalog#//@configurations.12/@rules.0 "
}
source: Model "UML" {
name: "UML2 Model"
metamodel: Metamodel " platform:/resource/es.cv.gvcase.linkers.uml2db.transf/models /UML2DB.rulescatalog#//@source.0 "
path: " /es.cv.gvcase.linkers.uml2db.test.data/models/TFR-MAP-003-V0 3-001.model "
modelRef: Model " /es.cv.gvcase.linkers.uml2db.test.data/models/TFR-MAP-003-V0 3-001.model#/ "
}
catalog: Catalog " platform:/resource/es.cv.gvcase.linkers.uml2db.transf/models /UML2DB.rulescatalog#/ "
TransformationId: "es.cv.gvcase.linkers.uml2db.transf.Transformation"
}
}

See the lines "element:" and "firstElement:", there are using references to the elements by name (in this case, C1 is the name of the class in the hutn model).

This same code with the 0.8.9 version of Epsilon shows me errors in that lines. I don't understand it.

Cheers.
Re: Problem with HUTN configuration files [message #641094 is a reply to message #640779] Wed, 24 November 2010 09:16 Go to previous messageGo to next message
Jes is currently offline JesFriend
Messages: 9
Registered: November 2010
Junior Member
Problem solved, my fault. This is the correct syntax:

element: DataStructure " /es.cv.gvcase.linkers.dd2cld.test.data/models/TFR-MAP-003-V0 0-001.model#//@dataStructures.0 "

I had tried with @datastructures.0, but the 's' should be uppercase.

Thanks.
Re: Problem with HUTN configuration files [message #641101 is a reply to message #641094] Wed, 24 November 2010 09:29 Go to previous message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Hi Jes,

Great, glad you fixed the problem.

I'm surprised that the cross reference value works when it doesn't have a schema (such as: platform:/resource), but perhaps this is a difference between operating systems. (I'm using Mac OS).

Cheers,
Louis.
Previous Topic:[EWL] Wizard menu error
Next Topic:custom marker view in an RCP app using evl
Goto Forum:
  


Current Time: Thu Apr 25 13:18:24 GMT 2024

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

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

Back to the top