[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmt] Re: [Epsilon] Configuring HUTN file

Reply hidden below!

Pau Giner wrote:
Many thanks for the info.

I tried it, and it works now.

You're welcome, I'm glad we managed to fix the problem.


Only a pair of comments:

1. About the embedded configuration: I prefer better the configuration in a separate file since many of the configuration adjustments are metamodel-related. So replication could be avoided using a common file for several instances of your models. But, anyway it is possible for some people to find the embedded configuration also useful.

I agree; being able to specify configuration for each metamodel (rather than for each HUTN source) is my preferred style too.



2. Just to note that the described configuration process can be also made using HUTN. Its quite obvious, but just for illustration I copy the example definition for the configuration model I used:


@Spec{
    MetaModel "hutnConfig" {
      nsUri: "http://www.eclipse.org/gmt/epsilon/hutnConfig";
    }
}

hutnConfig{
Configuration "Config"{
  rules: IdentifierRule "Rule" {
          attribute: "id"
          classifier: "TestClass"
    }
}
}


Excellent, I hadn't tried this yet. Great idea!

Cheers,
Louis.




Louis Rose escribió:
Hi Pau,

Many thanks for your message. Apologies for the late reply; I had a deadline yesterday.

To use the HUTN configuration metamodel, you should:

1) Create a new instance of the metamodel. In the Epsilon perspective, Click File | New | EMF Model. Select: "http://www.eclipse.org/gmt/epsilon/hutnConfig"; as the Metamodel URI, and "Configuration" as the root instance type.

2) Open the new model, and define your rules with tree-structure editor.

3) In your HUTN source file, specify the config file in the same block as the metamodel nsURI. For example:

 @Spec {
    MetaModel "FamiliesMetaModel" {
        nsUri = "http://www.example.org/families";
        configFile = "FamiliesConfig.model"
    }
}

The value of "configFile" is relative to the HUTN source.

4) Save the HUTN source, and your configuration file should be loaded.

Does this fix your problem?

(On a related note, we do not yet support embedded configuration, as you describe. This seems to be a sensible alternative to the method outlined above, and is mentioned in the HUTN specification. I will add it to the list of features to be implemented in the next iteration (later this month).

Many thanks,
Louis.


Pau Giner wrote:
Hello,

I'm interested in the configuration capabilities of HUTN to define identifiers and default values.

I've explored the hutnConfig metamodel but it is not clear how to use it in a HUTN definition file.

If I write the following:

...
@Configuration{
IdentifierRule "rule"{
  attribute: "id"
  classifier: "test.Test"

 }
}
...


I got an error: [Line: 8, Column: 1, Reason: Unrecognised classifier: IdentifierRule]




Is there any example of using this configuration mechanism??

Thanks.