Home » Archived » GMT (Generative Modeling Technologies) » [Epsilon] Configuring HUTN file
[Epsilon] Configuring HUTN file [message #383907] |
Mon, 30 June 2008 12:28  |
Eclipse User |
|
|
|
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.
|
|
| |
Re: [Epsilon] Configuring HUTN file [message #383923 is a reply to message #383907] |
Wed, 02 July 2008 05:42   |
Eclipse User |
|
|
|
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.
|
|
|
Re: [Epsilon] Configuring HUTN file [message #383926 is a reply to message #383923] |
Wed, 02 July 2008 11:36   |
Eclipse User |
|
|
|
Many thanks for the info.
I tried it, and it works now.
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.
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"
}
}
}
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.
|
|
|
Re: [Epsilon] Configuring HUTN file [message #383930 is a reply to message #383926] |
Wed, 02 July 2008 12:00   |
Eclipse User |
|
|
|
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.
|
|
|
Re: [Epsilon] Configuring HUTN file [message #384435 is a reply to message #383930] |
Mon, 04 August 2008 08:20   |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------060006000006090704070800
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Hello!
I'm trying to define a configuration file for UML models using HUTN, but
I have some troubles.
I have followed the instructions you gave to Pau and I have no problems
with some simply metamodels I use for proofs, but when I try to
configure the HUTN files related to the UML metamodel I get this error:
Line: 4, Column: 8, Reason: The attribute "name" for the classifier
"Model" does not accept String values.,
Line: 4, Column: 8, Reason: The attribute "name" for the classifier
"Package" does not accept String values.
"Package" and "Model" inherit the attribute "name" from "NamedElement",
and it contains a String.
I send you a little example of the files I'm using.
One more doubt. I need to define an attribute whose type is an
enumeration. Reading the HUTN specification I noticed that I have to
config it, but the given examples seem different (like @config instead
of @spec) and I don't know much about how to do it.
Many thanks,
H
|
|
|
Re: [Epsilon] Configuring HUTN file [message #384447 is a reply to message #384435] |
Wed, 06 August 2008 12:20   |
Eclipse User |
|
|
|
Hello Héctor,
Thanks very much for your message. You can safely ignore the errors that
you mention.
The errors are caused by a bad comparison by the validation of the
configuration model. I've updated the EVL that performs the validation,
and the errors are no longer generated. A patched EVL file is attached,
please overlay your installation. The patch will appear in the next
release of HUTN.
Regarding enumeration types, we did have some support for these, but I
recently removed it as it was quite buggy. I will reintroduce support in
the next release. For now, I'm afraid you will have to specify the value
of your enumeration types by hand after generating the model with HUTN.
Apologies for the inconvenience.
If the value of the enumeration type can be calculated based on the
value of other attributes, you could automate it using EOL. For example:
for (p in Person.allInstances()) {
if (p.name = 'Louis') {
p.gender := MyModel!Gender#male;
} else if (p.name = 'Louise') {
p.gender := MyModel!Gender#female;
}
}
Cheers,
Louis.
Héctor Iturria wrote:
>
> Hello!
>
> I'm trying to define a configuration file for UML models using HUTN, but
> I have some troubles.
>
> I have followed the instructions you gave to Pau and I have no problems
> with some simply metamodels I use for proofs, but when I try to
> configure the HUTN files related to the UML metamodel I get this error:
>
> Line: 4, Column: 8, Reason: The attribute "name" for the classifier
> "Model" does not accept String values.,
> Line: 4, Column: 8, Reason: The attribute "name" for the classifier
> "Package" does not accept String values.
>
> "Package" and "Model" inherit the attribute "name" from "NamedElement",
> and it contains a String.
>
> I send you a little example of the files I'm using.
>
> One more doubt. I need to define an attribute whose type is an
> enumeration. Reading the HUTN specification I noticed that I have to
> config it, but the given examples seem different (like @config instead
> of @spec) and I don't know much about how to do it.
>
> Many thanks,
> Héctor
>
>
>
> Louis Rose escribió:
>> 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.
>
|
|
| |
Re: [Epsilon] Configuring HUTN file [message #384453 is a reply to message #384449] |
Thu, 07 August 2008 02:49  |
Eclipse User |
|
|
|
Hi Louis, many thanks for the reply :)
I will add the info by hand for now and I will wait until it can be done
in hutn.
Thanks!
Héctor
Louis Rose escribió:
> Whoops, I forgot to attach the file!
>
> Many thanks,
> Louis.
>
> Louis Rose wrote:
>> Hello Héctor,
>>
>> Thanks very much for your message. You can safely ignore the errors
>> that you mention.
>>
>> The errors are caused by a bad comparison by the validation of the
>> configuration model. I've updated the EVL that performs the
>> validation, and the errors are no longer generated. A patched EVL file
>> is attached, please overlay your installation. The patch will appear
>> in the next release of HUTN.
>>
>> Regarding enumeration types, we did have some support for these, but I
>> recently removed it as it was quite buggy. I will reintroduce support
>> in the next release. For now, I'm afraid you will have to specify the
>> value of your enumeration types by hand after generating the model
>> with HUTN. Apologies for the inconvenience.
>>
>> If the value of the enumeration type can be calculated based on the
>> value of other attributes, you could automate it using EOL. For example:
>>
>> for (p in Person.allInstances()) {
>> if (p.name = 'Louis') {
>> p.gender := MyModel!Gender#male;
>>
>> } else if (p.name = 'Louise') {
>> p.gender := MyModel!Gender#female;
>> }
>> }
>>
>> Cheers,
>> Louis.
>>
>> Héctor Iturria wrote:
>>>
>>> Hello!
>>>
>>> I'm trying to define a configuration file for UML models using HUTN,
>>> but I have some troubles.
>>>
>>> I have followed the instructions you gave to Pau and I have no
>>> problems with some simply metamodels I use for proofs, but when I try
>>> to configure the HUTN files related to the UML metamodel I get this
>>> error:
>>>
>>> Line: 4, Column: 8, Reason: The attribute "name" for the classifier
>>> "Model" does not accept String values.,
>>> Line: 4, Column: 8, Reason: The attribute "name" for the classifier
>>> "Package" does not accept String values.
>>>
>>> "Package" and "Model" inherit the attribute "name" from
>>> "NamedElement", and it contains a String.
>>>
>>> I send you a little example of the files I'm using.
>>>
>>> One more doubt. I need to define an attribute whose type is an
>>> enumeration. Reading the HUTN specification I noticed that I have to
>>> config it, but the given examples seem different (like @config
>>> instead of @spec) and I don't know much about how to do it.
>>>
>>> Many thanks,
>>> Héctor
>>>
>>>
>>>
>>> Louis Rose escribió:
>>>> 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.
>>>
>
|
|
|
Re: [Epsilon] Configuring HUTN file [message #618106 is a reply to message #383907] |
Mon, 30 June 2008 17:54  |
Eclipse User |
|
|
|
Hi Pau,
I've forwarded your message to Louis and he should get back to you shortly.
Cheers,
Dimitrios
P.S. Could you please also start a new thread in the newsgroup for the
comment you wrote on the Epsilon blog about HUTN/UML?
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.
|
|
|
Re: [Epsilon] Configuring HUTN file [message #618112 is a reply to message #383907] |
Wed, 02 July 2008 05:42  |
Eclipse User |
|
|
|
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.
|
|
|
Re: [Epsilon] Configuring HUTN file [message #618116 is a reply to message #383923] |
Wed, 02 July 2008 11:36  |
Eclipse User |
|
|
|
Many thanks for the info.
I tried it, and it works now.
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.
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"
}
}
}
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.
|
|
|
Re: [Epsilon] Configuring HUTN file [message #618118 is a reply to message #383926] |
Wed, 02 July 2008 12:00  |
Eclipse User |
|
|
|
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.
|
|
|
Re: [Epsilon] Configuring HUTN file [message #618632 is a reply to message #383930] |
Mon, 04 August 2008 08:20  |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------060006000006090704070800
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Hello!
I'm trying to define a configuration file for UML models using HUTN, but
I have some troubles.
I have followed the instructions you gave to Pau and I have no problems
with some simply metamodels I use for proofs, but when I try to
configure the HUTN files related to the UML metamodel I get this error:
Line: 4, Column: 8, Reason: The attribute "name" for the classifier
"Model" does not accept String values.,
Line: 4, Column: 8, Reason: The attribute "name" for the classifier
"Package" does not accept String values.
"Package" and "Model" inherit the attribute "name" from "NamedElement",
and it contains a String.
I send you a little example of the files I'm using.
One more doubt. I need to define an attribute whose type is an
enumeration. Reading the HUTN specification I noticed that I have to
config it, but the given examples seem different (like @config instead
of @spec) and I don't know much about how to do it.
Many thanks,
H
|
|
|
Re: [Epsilon] Configuring HUTN file [message #618882 is a reply to message #384435] |
Wed, 06 August 2008 12:20  |
Eclipse User |
|
|
|
Hello Héctor,
Thanks very much for your message. You can safely ignore the errors that
you mention.
The errors are caused by a bad comparison by the validation of the
configuration model. I've updated the EVL that performs the validation,
and the errors are no longer generated. A patched EVL file is attached,
please overlay your installation. The patch will appear in the next
release of HUTN.
Regarding enumeration types, we did have some support for these, but I
recently removed it as it was quite buggy. I will reintroduce support in
the next release. For now, I'm afraid you will have to specify the value
of your enumeration types by hand after generating the model with HUTN.
Apologies for the inconvenience.
If the value of the enumeration type can be calculated based on the
value of other attributes, you could automate it using EOL. For example:
for (p in Person.allInstances()) {
if (p.name = 'Louis') {
p.gender := MyModel!Gender#male;
} else if (p.name = 'Louise') {
p.gender := MyModel!Gender#female;
}
}
Cheers,
Louis.
Héctor Iturria wrote:
>
> Hello!
>
> I'm trying to define a configuration file for UML models using HUTN, but
> I have some troubles.
>
> I have followed the instructions you gave to Pau and I have no problems
> with some simply metamodels I use for proofs, but when I try to
> configure the HUTN files related to the UML metamodel I get this error:
>
> Line: 4, Column: 8, Reason: The attribute "name" for the classifier
> "Model" does not accept String values.,
> Line: 4, Column: 8, Reason: The attribute "name" for the classifier
> "Package" does not accept String values.
>
> "Package" and "Model" inherit the attribute "name" from "NamedElement",
> and it contains a String.
>
> I send you a little example of the files I'm using.
>
> One more doubt. I need to define an attribute whose type is an
> enumeration. Reading the HUTN specification I noticed that I have to
> config it, but the given examples seem different (like @config instead
> of @spec) and I don't know much about how to do it.
>
> Many thanks,
> Héctor
>
>
>
> Louis Rose escribió:
>> 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.
>
|
|
|
Re: [Epsilon] Configuring HUTN file [message #618883 is a reply to message #384447] |
Wed, 06 August 2008 12:23  |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------040103010802080702010106
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Whoops, I forgot to attach the file!
Many thanks,
Louis.
Louis Rose wrote:
> Hello H
|
|
|
Re: [Epsilon] Configuring HUTN file [message #618887 is a reply to message #384449] |
Thu, 07 August 2008 02:49  |
Eclipse User |
|
|
|
Hi Louis, many thanks for the reply :)
I will add the info by hand for now and I will wait until it can be done
in hutn.
Thanks!
Héctor
Louis Rose escribió:
> Whoops, I forgot to attach the file!
>
> Many thanks,
> Louis.
>
> Louis Rose wrote:
>> Hello Héctor,
>>
>> Thanks very much for your message. You can safely ignore the errors
>> that you mention.
>>
>> The errors are caused by a bad comparison by the validation of the
>> configuration model. I've updated the EVL that performs the
>> validation, and the errors are no longer generated. A patched EVL file
>> is attached, please overlay your installation. The patch will appear
>> in the next release of HUTN.
>>
>> Regarding enumeration types, we did have some support for these, but I
>> recently removed it as it was quite buggy. I will reintroduce support
>> in the next release. For now, I'm afraid you will have to specify the
>> value of your enumeration types by hand after generating the model
>> with HUTN. Apologies for the inconvenience.
>>
>> If the value of the enumeration type can be calculated based on the
>> value of other attributes, you could automate it using EOL. For example:
>>
>> for (p in Person.allInstances()) {
>> if (p.name = 'Louis') {
>> p.gender := MyModel!Gender#male;
>>
>> } else if (p.name = 'Louise') {
>> p.gender := MyModel!Gender#female;
>> }
>> }
>>
>> Cheers,
>> Louis.
>>
>> Héctor Iturria wrote:
>>>
>>> Hello!
>>>
>>> I'm trying to define a configuration file for UML models using HUTN,
>>> but I have some troubles.
>>>
>>> I have followed the instructions you gave to Pau and I have no
>>> problems with some simply metamodels I use for proofs, but when I try
>>> to configure the HUTN files related to the UML metamodel I get this
>>> error:
>>>
>>> Line: 4, Column: 8, Reason: The attribute "name" for the classifier
>>> "Model" does not accept String values.,
>>> Line: 4, Column: 8, Reason: The attribute "name" for the classifier
>>> "Package" does not accept String values.
>>>
>>> "Package" and "Model" inherit the attribute "name" from
>>> "NamedElement", and it contains a String.
>>>
>>> I send you a little example of the files I'm using.
>>>
>>> One more doubt. I need to define an attribute whose type is an
>>> enumeration. Reading the HUTN specification I noticed that I have to
>>> config it, but the given examples seem different (like @config
>>> instead of @spec) and I don't know much about how to do it.
>>>
>>> Many thanks,
>>> Héctor
>>>
>>>
>>>
>>> Louis Rose escribió:
>>>> 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.
>>>
>
|
|
|
Goto Forum:
Current Time: Mon Apr 14 18:45:02 EDT 2025
Powered by FUDForum. Page generated in 0.06258 seconds
|