Problem with HUTN configuration files [message #640779] |
Tue, 23 November 2010 02:24  |
Eclipse User |
|
|
|
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 05:10   |
Eclipse User |
|
|
|
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 #641101 is a reply to message #641094] |
Wed, 24 November 2010 04:29  |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.05105 seconds