Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » GMT (Generative Modeling Technologies) » [Epsilon] Configuring HUTN file
[Epsilon] Configuring HUTN file [message #383907] Mon, 30 June 2008 16:28 Go to next message
Pau Giner is currently offline Pau GinerFriend
Messages: 18
Registered: July 2009
Junior Member
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 #383919 is a reply to message #383907] Mon, 30 June 2008 21:54 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
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 #383923 is a reply to message #383907] Wed, 02 July 2008 09:42 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 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 15:36 Go to previous messageGo to next message
Pau Giner is currently offline Pau GinerFriend
Messages: 18
Registered: July 2009
Junior Member
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 16:00 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
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 12:20 Go to previous messageGo to next message
Hector Iturria is currently offline Hector IturriaFriend
Messages: 60
Registered: July 2009
Member
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 16:20 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
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 #384449 is a reply to message #384447] Wed, 06 August 2008 16:23 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
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 #384453 is a reply to message #384449] Thu, 07 August 2008 06:49 Go to previous message
Hector Iturria is currently offline Hector IturriaFriend
Messages: 60
Registered: July 2009
Member
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 21:54 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
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 09:42 Go to previous message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
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 15:36 Go to previous message
Pau Giner is currently offline Pau GinerFriend
Messages: 18
Registered: July 2009
Junior Member
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 16:00 Go to previous message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
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 12:20 Go to previous message
Hector Iturria is currently offline Hector IturriaFriend
Messages: 60
Registered: July 2009
Member
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 16:20 Go to previous message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
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 16:23 Go to previous message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
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 06:49 Go to previous message
Hector Iturria is currently offline Hector IturriaFriend
Messages: 60
Registered: July 2009
Member
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.
>>>
>
Previous Topic:[xtext] Error in the generated PartitionScanner
Next Topic:[Espilon][EWL] Wizard inheritance and call
Goto Forum:
  


Current Time: Fri Mar 29 15:49:21 GMT 2024

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

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

Back to the top