Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Reference in the metamodel
[ATL] Reference in the metamodel [message #47279] Mon, 18 June 2007 10:16 Go to next message
Eclipse User
Originally posted by: bch.openbluelab.org

Hi,

I search to transform my metamodel to the metamodel UML2. I must
construct a profile with all stereotypes but in this profile I must
reference the class http://www.eclipse.org/uml2/2.0.0/UML#//Element and
i don't know how to do that ?

Thanks
Re: [ATL] Reference in the metamodel [message #47831 is a reply to message #47279] Thu, 21 June 2007 07:18 Go to previous messageGo to next message
Eclipse User
Originally posted by: bch.openbluelab.org

Hi,

I have a new problem. I have a rule like that :

rule R {
from e : IN!Element
to
newElt : OUT!Element foreach(...) (
myAttr <- newSubElt
),
newSubElt : OUT!Element (...)
}

I want that each new element contains a new sub element but with this
rule (it's normal), I have an only sub element linked with the last
element. How can I create a sub element foreach element ?

Thanks

Benjamin CHEVALLEREAU a écrit :
> Hi,
>
> I search to transform my metamodel to the metamodel UML2. I must
> construct a profile with all stereotypes but in this profile I must
> reference the class http://www.eclipse.org/uml2/2.0.0/UML#//Element and
> i don't know how to do that ?
>
> Thanks
Re: [ATL] Reference in the metamodel [message #48355 is a reply to message #47831] Fri, 22 June 2007 08:32 Go to previous messageGo to next message
Eclipse User
Originally posted by: Hugo.Bruneliere.univ-nantes.fr

Hi Benjamin,

Benjamin CHEVALLEREAU a écrit :
> Hi,
>
> I have a new problem. I have a rule like that :
>
> rule R {
> from e : IN!Element
> to
> newElt : OUT!Element foreach(...) (
> myAttr <- newSubElt
> ),
> newSubElt : OUT!Element (...)
> }
>
> I want that each new element contains a new sub element but with this
> rule (it's normal), I have an only sub element linked with the last
> element. How can I create a sub element foreach element ?
>

You can use a "lazy rule" instead of using the "foreach" statement for
this kind of purpose.
A lazy rule is a declarative rule which have to be explicitly called
from another rule. For instance, in your case you can do something like
this:

- Declare R as a lazy rule

lazy rule R {
from e : IN!Element
to
newElt : OUT!Element (
myAttr <- newSubElt
),
newSubElt : OUT!Element (
)
}

- Call it from another rule
rule S {
from
e : IN!Element
to
newElt : OUT!Element (
elements <- e.elements->collect(elem | thisModule.R(elem))
)
}


Best regards,

Hugo

> Thanks
>
> Benjamin CHEVALLEREAU a écrit :
>> Hi,
>>
>> I search to transform my metamodel to the metamodel UML2. I must
>> construct a profile with all stereotypes but in this profile I must
>> reference the class http://www.eclipse.org/uml2/2.0.0/UML#//Element
>> and i don't know how to do that ?
>>
>> Thanks


--
--------------------------------------------------------
Hugo Bruneliere - R&D Engineer
ATLAS Group (INRIA & LINA) - University of Nantes
2, rue de la Houssiniere
44322 Nantes Cedex 3 - France
office +33 2 51 12 58 10 /\ cell.+33 6 07 42 45 30
EMail: Hugo.Bruneliere@univ-nantes.fr
http://www.sciences.univ-nantes.fr/lina/atl/
--------------------------------------------------------
Re: [ATL] Reference in the metamodel [message #48445 is a reply to message #48355] Fri, 22 June 2007 13:45 Go to previous messageGo to next message
Eclipse User
Originally posted by: bch.openbluelab.org

Thanks for your help !!

I have finded a solution with lazy rule. Now, I have a new problem. I
want to link a property with an external class but I don't know how to
do that. I want create a profile UML2. In UML2, we can find :

<elementImport xmi:id="_WfN3kCDAEdyNsvUu_WiziQ">
<importedElement xmi:type="uml:Class"
href="pathmap://UML_METAMODELS/UML.metamodel.uml#Element"/>
</elementImport>

So I want to reference a class in an other metamodel but I don't know how...

Best regards

Hugo Bruneliere a écrit :
> Hi Benjamin,
>
> Benjamin CHEVALLEREAU a écrit :
>> Hi,
>>
>> I have a new problem. I have a rule like that :
>>
>> rule R {
>> from e : IN!Element
>> to
>> newElt : OUT!Element foreach(...) (
>> myAttr <- newSubElt
>> ),
>> newSubElt : OUT!Element (...)
>> }
>>
>> I want that each new element contains a new sub element but with this
>> rule (it's normal), I have an only sub element linked with the last
>> element. How can I create a sub element foreach element ?
>>
>
> You can use a "lazy rule" instead of using the "foreach" statement for
> this kind of purpose.
> A lazy rule is a declarative rule which have to be explicitly called
> from another rule. For instance, in your case you can do something like
> this:
>
> - Declare R as a lazy rule
>
> lazy rule R {
> from e : IN!Element
> to
> newElt : OUT!Element (
> myAttr <- newSubElt
> ),
> newSubElt : OUT!Element (
> )
> }
>
> - Call it from another rule
> rule S {
> from
> e : IN!Element
> to
> newElt : OUT!Element (
> elements <- e.elements->collect(elem | thisModule.R(elem))
> )
> }
>
>
> Best regards,
>
> Hugo
>
>> Thanks
>>
>> Benjamin CHEVALLEREAU a écrit :
>>> Hi,
>>>
>>> I search to transform my metamodel to the metamodel UML2. I must
>>> construct a profile with all stereotypes but in this profile I must
>>> reference the class http://www.eclipse.org/uml2/2.0.0/UML#//Element
>>> and i don't know how to do that ?
>>>
>>> Thanks
>
>
Re: [ATL] Reference in the metamodel [message #49413 is a reply to message #48445] Tue, 26 June 2007 15:04 Go to previous messageGo to next message
Eclipse User
Originally posted by: bch.openbluelab.org

Have you an idea to reference the class
//UML_METAMODELS/UML.metamodel.uml#Element ?

Thanks

Benjamin CHEVALLEREAU a écrit :
> Thanks for your help !!
>
> I have finded a solution with lazy rule. Now, I have a new problem. I
> want to link a property with an external class but I don't know how to
> do that. I want create a profile UML2. In UML2, we can find :
>
> <elementImport xmi:id="_WfN3kCDAEdyNsvUu_WiziQ">
> <importedElement xmi:type="uml:Class"
> href="pathmap://UML_METAMODELS/UML.metamodel.uml#Element"/>
> </elementImport>
>
> So I want to reference a class in an other metamodel but I don't know
> how...
>
> Best regards
>
> Hugo Bruneliere a écrit :
>> Hi Benjamin,
>>
>> Benjamin CHEVALLEREAU a écrit :
>>> Hi,
>>>
>>> I have a new problem. I have a rule like that :
>>>
>>> rule R {
>>> from e : IN!Element
>>> to
>>> newElt : OUT!Element foreach(...) (
>>> myAttr <- newSubElt
>>> ),
>>> newSubElt : OUT!Element (...)
>>> }
>>>
>>> I want that each new element contains a new sub element but with this
>>> rule (it's normal), I have an only sub element linked with the last
>>> element. How can I create a sub element foreach element ?
>>>
>>
>> You can use a "lazy rule" instead of using the "foreach" statement for
>> this kind of purpose.
>> A lazy rule is a declarative rule which have to be explicitly called
>> from another rule. For instance, in your case you can do something
>> like this:
>>
>> - Declare R as a lazy rule
>>
>> lazy rule R {
>> from e : IN!Element
>> to
>> newElt : OUT!Element (
>> myAttr <- newSubElt
>> ),
>> newSubElt : OUT!Element (
>> )
>> }
>>
>> - Call it from another rule
>> rule S {
>> from
>> e : IN!Element
>> to
>> newElt : OUT!Element (
>> elements <- e.elements->collect(elem | thisModule.R(elem))
>> )
>> }
>>
>>
>> Best regards,
>>
>> Hugo
>>
>>> Thanks
>>>
>>> Benjamin CHEVALLEREAU a écrit :
>>>> Hi,
>>>>
>>>> I search to transform my metamodel to the metamodel UML2. I must
>>>> construct a profile with all stereotypes but in this profile I must
>>>> reference the class http://www.eclipse.org/uml2/2.0.0/UML#//Element
>>>> and i don't know how to do that ?
>>>>
>>>> Thanks
>>
>>
Re: [ATL] Reference in the metamodel [message #49472 is a reply to message #49413] Tue, 26 June 2007 15:50 Go to previous messageGo to next message
Frédéric Jouault is currently offline Frédéric Jouault
Messages: 572
Registered: July 2009
Senior Member
Hello,

I must admit that I am not sure to understand what you mean.

Why don't you use: "http://www.eclipse.org/uml2/2.0.0/UML#//Element", as
you wrote in your original post?


Regards,

Frédéric Jouault


Benjamin CHEVALLEREAU wrote:
> Have you an idea to reference the class
> //UML_METAMODELS/UML.metamodel.uml#Element ?
>
> Thanks
>
> Benjamin CHEVALLEREAU a écrit :
>> Thanks for your help !!
>>
>> I have finded a solution with lazy rule. Now, I have a new problem. I
>> want to link a property with an external class but I don't know how to
>> do that. I want create a profile UML2. In UML2, we can find :
>>
>> <elementImport xmi:id="_WfN3kCDAEdyNsvUu_WiziQ">
>> <importedElement xmi:type="uml:Class"
>> href="pathmap://UML_METAMODELS/UML.metamodel.uml#Element"/>
>> </elementImport>
>>
>> So I want to reference a class in an other metamodel but I don't know
>> how...
>>
>> Best regards
>>
>> Hugo Bruneliere a écrit :
>>> Hi Benjamin,
>>>
>>> Benjamin CHEVALLEREAU a écrit :
>>>> Hi,
>>>>
>>>> I have a new problem. I have a rule like that :
>>>>
>>>> rule R {
>>>> from e : IN!Element
>>>> to
>>>> newElt : OUT!Element foreach(...) (
>>>> myAttr <- newSubElt
>>>> ),
>>>> newSubElt : OUT!Element (...)
>>>> }
>>>>
>>>> I want that each new element contains a new sub element but with
>>>> this rule (it's normal), I have an only sub element linked with the
>>>> last element. How can I create a sub element foreach element ?
>>>>
>>>
>>> You can use a "lazy rule" instead of using the "foreach" statement
>>> for this kind of purpose.
>>> A lazy rule is a declarative rule which have to be explicitly called
>>> from another rule. For instance, in your case you can do something
>>> like this:
>>>
>>> - Declare R as a lazy rule
>>>
>>> lazy rule R {
>>> from e : IN!Element
>>> to
>>> newElt : OUT!Element (
>>> myAttr <- newSubElt
>>> ),
>>> newSubElt : OUT!Element (
>>> )
>>> }
>>>
>>> - Call it from another rule
>>> rule S {
>>> from
>>> e : IN!Element
>>> to
>>> newElt : OUT!Element (
>>> elements <- e.elements->collect(elem | thisModule.R(elem))
>>> )
>>> }
>>>
>>>
>>> Best regards,
>>>
>>> Hugo
>>>
>>>> Thanks
>>>>
>>>> Benjamin CHEVALLEREAU a écrit :
>>>>> Hi,
>>>>>
>>>>> I search to transform my metamodel to the metamodel UML2. I must
>>>>> construct a profile with all stereotypes but in this profile I must
>>>>> reference the class http://www.eclipse.org/uml2/2.0.0/UML#//Element
>>>>> and i don't know how to do that ?
>>>>>
>>>>> Thanks
>>>
>>>
Re: [ATL] Reference in the metamodel [message #49562 is a reply to message #49472] Wed, 27 June 2007 07:20 Go to previous messageGo to next message
Eclipse User
Originally posted by: bch.openbluelab.org

I have a property "importedElement" that I must assign to
"http://www.eclipse.org/uml2/2.0.0/UML#//Element". But I can't write this :

importedElement <- 'http://www.eclipse.org/uml2/2.0.0/UML#//Element'

--> message: cannot set feature UML2P!ElementImport.importedElement to
value http://www.eclipse.org/uml2/2.0.0/UML#//Element
exception:
java.lang.ClassCastException: java.lang.String


So I don't know how to do that.

Thanks



Frédéric Jouault a écrit :
> Hello,
>
> I must admit that I am not sure to understand what you mean.
>
> Why don't you use: "http://www.eclipse.org/uml2/2.0.0/UML#//Element", as
> you wrote in your original post?
>
>
> Regards,
>
> Frédéric Jouault
>
>
> Benjamin CHEVALLEREAU wrote:
>> Have you an idea to reference the class
>> //UML_METAMODELS/UML.metamodel.uml#Element ?
>>
>> Thanks
>>
>> Benjamin CHEVALLEREAU a écrit :
>>> Thanks for your help !!
>>>
>>> I have finded a solution with lazy rule. Now, I have a new problem. I
>>> want to link a property with an external class but I don't know how
>>> to do that. I want create a profile UML2. In UML2, we can find :
>>>
>>> <elementImport xmi:id="_WfN3kCDAEdyNsvUu_WiziQ">
>>> <importedElement xmi:type="uml:Class"
>>> href="pathmap://UML_METAMODELS/UML.metamodel.uml#Element"/>
>>> </elementImport>
>>>
>>> So I want to reference a class in an other metamodel but I don't know
>>> how...
>>>
>>> Best regards
>>>
>>> Hugo Bruneliere a écrit :
>>>> Hi Benjamin,
>>>>
>>>> Benjamin CHEVALLEREAU a écrit :
>>>>> Hi,
>>>>>
>>>>> I have a new problem. I have a rule like that :
>>>>>
>>>>> rule R {
>>>>> from e : IN!Element
>>>>> to
>>>>> newElt : OUT!Element foreach(...) (
>>>>> myAttr <- newSubElt
>>>>> ),
>>>>> newSubElt : OUT!Element (...)
>>>>> }
>>>>>
>>>>> I want that each new element contains a new sub element but with
>>>>> this rule (it's normal), I have an only sub element linked with the
>>>>> last element. How can I create a sub element foreach element ?
>>>>>
>>>>
>>>> You can use a "lazy rule" instead of using the "foreach" statement
>>>> for this kind of purpose.
>>>> A lazy rule is a declarative rule which have to be explicitly called
>>>> from another rule. For instance, in your case you can do something
>>>> like this:
>>>>
>>>> - Declare R as a lazy rule
>>>>
>>>> lazy rule R {
>>>> from e : IN!Element
>>>> to
>>>> newElt : OUT!Element (
>>>> myAttr <- newSubElt
>>>> ),
>>>> newSubElt : OUT!Element (
>>>> )
>>>> }
>>>>
>>>> - Call it from another rule
>>>> rule S {
>>>> from
>>>> e : IN!Element
>>>> to
>>>> newElt : OUT!Element (
>>>> elements <- e.elements->collect(elem | thisModule.R(elem))
>>>> )
>>>> }
>>>>
>>>>
>>>> Best regards,
>>>>
>>>> Hugo
>>>>
>>>>> Thanks
>>>>>
>>>>> Benjamin CHEVALLEREAU a écrit :
>>>>>> Hi,
>>>>>>
>>>>>> I search to transform my metamodel to the metamodel UML2. I must
>>>>>> construct a profile with all stereotypes but in this profile I
>>>>>> must reference the class
>>>>>> http://www.eclipse.org/uml2/2.0.0/UML#//Element and i don't know
>>>>>> how to do that ?
>>>>>>
>>>>>> Thanks
>>>>
>>>>
Re: [ATL] Reference in the metamodel [message #49592 is a reply to message #49562] Wed, 27 June 2007 08:17 Go to previous messageGo to next message
Frédéric Jouault is currently offline Frédéric Jouault
Messages: 572
Registered: July 2009
Senior Member
Hello,

Ok, now I understand your problem a bit better, thanks ;-).


What about:

importedElement <- UML!Element

?
(assuming you "loaded" the UML2 "metamodel" by URI and named it "UML")


Regards,

Frédéric Jouault


Benjamin CHEVALLEREAU wrote:
> I have a property "importedElement" that I must assign to
> "http://www.eclipse.org/uml2/2.0.0/UML#//Element". But I can't write this :
>
> importedElement <- 'http://www.eclipse.org/uml2/2.0.0/UML#//Element'
>
> --> message: cannot set feature UML2P!ElementImport.importedElement
> to value http://www.eclipse.org/uml2/2.0.0/UML#//Element
> exception:
> java.lang.ClassCastException: java.lang.String
>
>
> So I don't know how to do that.
>
> Thanks
>
>
>
> Frédéric Jouault a écrit :
>> Hello,
>>
>> I must admit that I am not sure to understand what you mean.
>>
>> Why don't you use: "http://www.eclipse.org/uml2/2.0.0/UML#//Element",
>> as you wrote in your original post?
>>
>>
>> Regards,
>>
>> Frédéric Jouault
>>
>>
>> Benjamin CHEVALLEREAU wrote:
>>> Have you an idea to reference the class
>>> //UML_METAMODELS/UML.metamodel.uml#Element ?
>>>
>>> Thanks
>>>
>>> Benjamin CHEVALLEREAU a écrit :
>>>> Thanks for your help !!
>>>>
>>>> I have finded a solution with lazy rule. Now, I have a new problem.
>>>> I want to link a property with an external class but I don't know
>>>> how to do that. I want create a profile UML2. In UML2, we can find :
>>>>
>>>> <elementImport xmi:id="_WfN3kCDAEdyNsvUu_WiziQ">
>>>> <importedElement xmi:type="uml:Class"
>>>> href="pathmap://UML_METAMODELS/UML.metamodel.uml#Element"/>
>>>> </elementImport>
>>>>
>>>> So I want to reference a class in an other metamodel but I don't
>>>> know how...
>>>>
>>>> Best regards
>>>>
>>>> Hugo Bruneliere a écrit :
>>>>> Hi Benjamin,
>>>>>
>>>>> Benjamin CHEVALLEREAU a écrit :
>>>>>> Hi,
>>>>>>
>>>>>> I have a new problem. I have a rule like that :
>>>>>>
>>>>>> rule R {
>>>>>> from e : IN!Element
>>>>>> to
>>>>>> newElt : OUT!Element foreach(...) (
>>>>>> myAttr <- newSubElt
>>>>>> ),
>>>>>> newSubElt : OUT!Element (...)
>>>>>> }
>>>>>>
>>>>>> I want that each new element contains a new sub element but with
>>>>>> this rule (it's normal), I have an only sub element linked with
>>>>>> the last element. How can I create a sub element foreach element ?
>>>>>>
>>>>>
>>>>> You can use a "lazy rule" instead of using the "foreach" statement
>>>>> for this kind of purpose.
>>>>> A lazy rule is a declarative rule which have to be explicitly
>>>>> called from another rule. For instance, in your case you can do
>>>>> something like this:
>>>>>
>>>>> - Declare R as a lazy rule
>>>>>
>>>>> lazy rule R {
>>>>> from e : IN!Element
>>>>> to
>>>>> newElt : OUT!Element (
>>>>> myAttr <- newSubElt
>>>>> ),
>>>>> newSubElt : OUT!Element (
>>>>> )
>>>>> }
>>>>>
>>>>> - Call it from another rule
>>>>> rule S {
>>>>> from
>>>>> e : IN!Element
>>>>> to
>>>>> newElt : OUT!Element (
>>>>> elements <- e.elements->collect(elem | thisModule.R(elem))
>>>>> )
>>>>> }
>>>>>
>>>>>
>>>>> Best regards,
>>>>>
>>>>> Hugo
>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> Benjamin CHEVALLEREAU a écrit :
>>>>>>> Hi,
>>>>>>>
>>>>>>> I search to transform my metamodel to the metamodel UML2. I must
>>>>>>> construct a profile with all stereotypes but in this profile I
>>>>>>> must reference the class
>>>>>>> http://www.eclipse.org/uml2/2.0.0/UML#//Element and i don't know
>>>>>>> how to do that ?
>>>>>>>
>>>>>>> Thanks
>>>>>
>>>>>
Re: [ATL] Reference in the metamodel [message #49622 is a reply to message #49592] Wed, 27 June 2007 12:53 Go to previous messageGo to next message
Eclipse User
Originally posted by: bch.openbluelab.org

Hello,

I have tried this :
importedElement <- UML2!Element

but I have no code in my file.
Do you know why ?

Thanks

Frédéric Jouault a écrit :
> Hello,
>
> Ok, now I understand your problem a bit better, thanks ;-).
>
>
> What about:
>
> importedElement <- UML!Element
>
> ?
> (assuming you "loaded" the UML2 "metamodel" by URI and named it "UML")
>
>
> Regards,
>
> Frédéric Jouault
>
>
> Benjamin CHEVALLEREAU wrote:
>> I have a property "importedElement" that I must assign to
>> "http://www.eclipse.org/uml2/2.0.0/UML#//Element". But I can't write
>> this :
>>
>> importedElement <- 'http://www.eclipse.org/uml2/2.0.0/UML#//Element'
>>
>> --> message: cannot set feature UML2P!ElementImport.importedElement
>> to value http://www.eclipse.org/uml2/2.0.0/UML#//Element
>> exception:
>> java.lang.ClassCastException: java.lang.String
>>
>>
>> So I don't know how to do that.
>>
>> Thanks
>>
>>
>>
>> Frédéric Jouault a écrit :
>>> Hello,
>>>
>>> I must admit that I am not sure to understand what you mean.
>>>
>>> Why don't you use: "http://www.eclipse.org/uml2/2.0.0/UML#//Element",
>>> as you wrote in your original post?
>>>
>>>
>>> Regards,
>>>
>>> Frédéric Jouault
>>>
>>>
>>> Benjamin CHEVALLEREAU wrote:
>>>> Have you an idea to reference the class
>>>> //UML_METAMODELS/UML.metamodel.uml#Element ?
>>>>
>>>> Thanks
>>>>
>>>> Benjamin CHEVALLEREAU a écrit :
>>>>> Thanks for your help !!
>>>>>
>>>>> I have finded a solution with lazy rule. Now, I have a new problem.
>>>>> I want to link a property with an external class but I don't know
>>>>> how to do that. I want create a profile UML2. In UML2, we can find :
>>>>>
>>>>> <elementImport xmi:id="_WfN3kCDAEdyNsvUu_WiziQ">
>>>>> <importedElement xmi:type="uml:Class"
>>>>> href="pathmap://UML_METAMODELS/UML.metamodel.uml#Element"/>
>>>>> </elementImport>
>>>>>
>>>>> So I want to reference a class in an other metamodel but I don't
>>>>> know how...
>>>>>
>>>>> Best regards
>>>>>
>>>>> Hugo Bruneliere a écrit :
>>>>>> Hi Benjamin,
>>>>>>
>>>>>> Benjamin CHEVALLEREAU a écrit :
>>>>>>> Hi,
>>>>>>>
>>>>>>> I have a new problem. I have a rule like that :
>>>>>>>
>>>>>>> rule R {
>>>>>>> from e : IN!Element
>>>>>>> to
>>>>>>> newElt : OUT!Element foreach(...) (
>>>>>>> myAttr <- newSubElt
>>>>>>> ),
>>>>>>> newSubElt : OUT!Element (...)
>>>>>>> }
>>>>>>>
>>>>>>> I want that each new element contains a new sub element but with
>>>>>>> this rule (it's normal), I have an only sub element linked with
>>>>>>> the last element. How can I create a sub element foreach element ?
>>>>>>>
>>>>>>
>>>>>> You can use a "lazy rule" instead of using the "foreach" statement
>>>>>> for this kind of purpose.
>>>>>> A lazy rule is a declarative rule which have to be explicitly
>>>>>> called from another rule. For instance, in your case you can do
>>>>>> something like this:
>>>>>>
>>>>>> - Declare R as a lazy rule
>>>>>>
>>>>>> lazy rule R {
>>>>>> from e : IN!Element
>>>>>> to
>>>>>> newElt : OUT!Element (
>>>>>> myAttr <- newSubElt
>>>>>> ),
>>>>>> newSubElt : OUT!Element (
>>>>>> )
>>>>>> }
>>>>>>
>>>>>> - Call it from another rule
>>>>>> rule S {
>>>>>> from
>>>>>> e : IN!Element
>>>>>> to
>>>>>> newElt : OUT!Element (
>>>>>> elements <- e.elements->collect(elem |
>>>>>> thisModule.R(elem))
>>>>>> )
>>>>>> }
>>>>>>
>>>>>>
>>>>>> Best regards,
>>>>>>
>>>>>> Hugo
>>>>>>
>>>>>>> Thanks
>>>>>>>
>>>>>>> Benjamin CHEVALLEREAU a écrit :
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I search to transform my metamodel to the metamodel UML2. I must
>>>>>>>> construct a profile with all stereotypes but in this profile I
>>>>>>>> must reference the class
>>>>>>>> http://www.eclipse.org/uml2/2.0.0/UML#//Element and i don't know
>>>>>>>> how to do that ?
>>>>>>>>
>>>>>>>> Thanks
>>>>>>
>>>>>>
Re: [ATL] Reference in the metamodel [message #49653 is a reply to message #49622] Wed, 27 June 2007 14:00 Go to previous messageGo to next message
Frédéric Jouault is currently offline Frédéric Jouault
Messages: 572
Registered: July 2009
Senior Member
Hello,

Do you allow inter-model references?


Regards,

Frédéric Jouault


Benjamin CHEVALLEREAU wrote:
> Hello,
>
> I have tried this :
> importedElement <- UML2!Element
>
> but I have no code in my file.
> Do you know why ?
>
> Thanks
>
> Frédéric Jouault a écrit :
>> Hello,
>>
>> Ok, now I understand your problem a bit better, thanks ;-).
>>
>>
>> What about:
>>
>> importedElement <- UML!Element
>>
>> ?
>> (assuming you "loaded" the UML2 "metamodel" by URI and named it "UML")
>>
>>
>> Regards,
>>
>> Frédéric Jouault
>>
>>
>> Benjamin CHEVALLEREAU wrote:
>>> I have a property "importedElement" that I must assign to
>>> "http://www.eclipse.org/uml2/2.0.0/UML#//Element". But I can't write
>>> this :
>>>
>>> importedElement <- 'http://www.eclipse.org/uml2/2.0.0/UML#//Element'
>>>
>>> --> message: cannot set feature
>>> UML2P!ElementImport.importedElement to value
>>> http://www.eclipse.org/uml2/2.0.0/UML#//Element
>>> exception:
>>> java.lang.ClassCastException: java.lang.String
>>>
>>>
>>> So I don't know how to do that.
>>>
>>> Thanks
>>>
>>>
>>>
>>> Frédéric Jouault a écrit :
>>>> Hello,
>>>>
>>>> I must admit that I am not sure to understand what you mean.
>>>>
>>>> Why don't you use:
>>>> "http://www.eclipse.org/uml2/2.0.0/UML#//Element", as you wrote in
>>>> your original post?
>>>>
>>>>
>>>> Regards,
>>>>
>>>> Frédéric Jouault
>>>>
>>>>
>>>> Benjamin CHEVALLEREAU wrote:
>>>>> Have you an idea to reference the class
>>>>> //UML_METAMODELS/UML.metamodel.uml#Element ?
>>>>>
>>>>> Thanks
>>>>>
>>>>> Benjamin CHEVALLEREAU a écrit :
>>>>>> Thanks for your help !!
>>>>>>
>>>>>> I have finded a solution with lazy rule. Now, I have a new
>>>>>> problem. I want to link a property with an external class but I
>>>>>> don't know how to do that. I want create a profile UML2. In UML2,
>>>>>> we can find :
>>>>>>
>>>>>> <elementImport xmi:id="_WfN3kCDAEdyNsvUu_WiziQ">
>>>>>> <importedElement xmi:type="uml:Class"
>>>>>> href="pathmap://UML_METAMODELS/UML.metamodel.uml#Element"/>
>>>>>> </elementImport>
>>>>>>
>>>>>> So I want to reference a class in an other metamodel but I don't
>>>>>> know how...
>>>>>>
>>>>>> Best regards
>>>>>>
>>>>>> Hugo Bruneliere a écrit :
>>>>>>> Hi Benjamin,
>>>>>>>
>>>>>>> Benjamin CHEVALLEREAU a écrit :
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I have a new problem. I have a rule like that :
>>>>>>>>
>>>>>>>> rule R {
>>>>>>>> from e : IN!Element
>>>>>>>> to
>>>>>>>> newElt : OUT!Element foreach(...) (
>>>>>>>> myAttr <- newSubElt
>>>>>>>> ),
>>>>>>>> newSubElt : OUT!Element (...)
>>>>>>>> }
>>>>>>>>
>>>>>>>> I want that each new element contains a new sub element but with
>>>>>>>> this rule (it's normal), I have an only sub element linked with
>>>>>>>> the last element. How can I create a sub element foreach element ?
>>>>>>>>
>>>>>>>
>>>>>>> You can use a "lazy rule" instead of using the "foreach"
>>>>>>> statement for this kind of purpose.
>>>>>>> A lazy rule is a declarative rule which have to be explicitly
>>>>>>> called from another rule. For instance, in your case you can do
>>>>>>> something like this:
>>>>>>>
>>>>>>> - Declare R as a lazy rule
>>>>>>>
>>>>>>> lazy rule R {
>>>>>>> from e : IN!Element
>>>>>>> to
>>>>>>> newElt : OUT!Element (
>>>>>>> myAttr <- newSubElt
>>>>>>> ),
>>>>>>> newSubElt : OUT!Element (
>>>>>>> )
>>>>>>> }
>>>>>>>
>>>>>>> - Call it from another rule
>>>>>>> rule S {
>>>>>>> from
>>>>>>> e : IN!Element
>>>>>>> to
>>>>>>> newElt : OUT!Element (
>>>>>>> elements <- e.elements->collect(elem |
>>>>>>> thisModule.R(elem))
>>>>>>> )
>>>>>>> }
>>>>>>>
>>>>>>>
>>>>>>> Best regards,
>>>>>>>
>>>>>>> Hugo
>>>>>>>
>>>>>>>> Thanks
>>>>>>>>
>>>>>>>> Benjamin CHEVALLEREAU a écrit :
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> I search to transform my metamodel to the metamodel UML2. I
>>>>>>>>> must construct a profile with all stereotypes but in this
>>>>>>>>> profile I must reference the class
>>>>>>>>> http://www.eclipse.org/uml2/2.0.0/UML#//Element and i don't
>>>>>>>>> know how to do that ?
>>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>
>>>>>>>
Re: [ATL] Reference in the metamodel [message #50210 is a reply to message #49653] Mon, 02 July 2007 07:14 Go to previous messageGo to next message
Eclipse User
Originally posted by: bch.openbluelab.org

Hi,

How to allow that ?

Thanks

Frédéric Jouault a écrit :
> Hello,
>
> Do you allow inter-model references?
>
>
> Regards,
>
> Frédéric Jouault
>
>
> Benjamin CHEVALLEREAU wrote:
>> Hello,
>>
>> I have tried this :
>> importedElement <- UML2!Element
>>
>> but I have no code in my file.
>> Do you know why ?
>>
>> Thanks
>>
>> Frédéric Jouault a écrit :
>>> Hello,
>>>
>>> Ok, now I understand your problem a bit better, thanks ;-).
>>>
>>>
>>> What about:
>>>
>>> importedElement <- UML!Element
>>>
>>> ?
>>> (assuming you "loaded" the UML2 "metamodel" by URI and named it "UML")
>>>
>>>
>>> Regards,
>>>
>>> Frédéric Jouault
>>>
>>>
>>> Benjamin CHEVALLEREAU wrote:
>>>> I have a property "importedElement" that I must assign to
>>>> "http://www.eclipse.org/uml2/2.0.0/UML#//Element". But I can't write
>>>> this :
>>>>
>>>> importedElement <- 'http://www.eclipse.org/uml2/2.0.0/UML#//Element'
>>>>
>>>> --> message: cannot set feature
>>>> UML2P!ElementImport.importedElement to value
>>>> http://www.eclipse.org/uml2/2.0.0/UML#//Element
>>>> exception:
>>>> java.lang.ClassCastException: java.lang.String
>>>>
>>>>
>>>> So I don't know how to do that.
>>>>
>>>> Thanks
>>>>
>>>>
>>>>
>>>> Frédéric Jouault a écrit :
>>>>> Hello,
>>>>>
>>>>> I must admit that I am not sure to understand what you mean.
>>>>>
>>>>> Why don't you use:
>>>>> "http://www.eclipse.org/uml2/2.0.0/UML#//Element", as you wrote in
>>>>> your original post?
>>>>>
>>>>>
>>>>> Regards,
>>>>>
>>>>> Frédéric Jouault
>>>>>
>>>>>
>>>>> Benjamin CHEVALLEREAU wrote:
>>>>>> Have you an idea to reference the class
>>>>>> //UML_METAMODELS/UML.metamodel.uml#Element ?
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> Benjamin CHEVALLEREAU a écrit :
>>>>>>> Thanks for your help !!
>>>>>>>
>>>>>>> I have finded a solution with lazy rule. Now, I have a new
>>>>>>> problem. I want to link a property with an external class but I
>>>>>>> don't know how to do that. I want create a profile UML2. In UML2,
>>>>>>> we can find :
>>>>>>>
>>>>>>> <elementImport xmi:id="_WfN3kCDAEdyNsvUu_WiziQ">
>>>>>>> <importedElement xmi:type="uml:Class"
>>>>>>> href="pathmap://UML_METAMODELS/UML.metamodel.uml#Element"/>
>>>>>>> </elementImport>
>>>>>>>
>>>>>>> So I want to reference a class in an other metamodel but I don't
>>>>>>> know how...
>>>>>>>
>>>>>>> Best regards
>>>>>>>
>>>>>>> Hugo Bruneliere a écrit :
>>>>>>>> Hi Benjamin,
>>>>>>>>
>>>>>>>> Benjamin CHEVALLEREAU a écrit :
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> I have a new problem. I have a rule like that :
>>>>>>>>>
>>>>>>>>> rule R {
>>>>>>>>> from e : IN!Element
>>>>>>>>> to
>>>>>>>>> newElt : OUT!Element foreach(...) (
>>>>>>>>> myAttr <- newSubElt
>>>>>>>>> ),
>>>>>>>>> newSubElt : OUT!Element (...)
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> I want that each new element contains a new sub element but
>>>>>>>>> with this rule (it's normal), I have an only sub element linked
>>>>>>>>> with the last element. How can I create a sub element foreach
>>>>>>>>> element ?
>>>>>>>>>
>>>>>>>>
>>>>>>>> You can use a "lazy rule" instead of using the "foreach"
>>>>>>>> statement for this kind of purpose.
>>>>>>>> A lazy rule is a declarative rule which have to be explicitly
>>>>>>>> called from another rule. For instance, in your case you can do
>>>>>>>> something like this:
>>>>>>>>
>>>>>>>> - Declare R as a lazy rule
>>>>>>>>
>>>>>>>> lazy rule R {
>>>>>>>> from e : IN!Element
>>>>>>>> to
>>>>>>>> newElt : OUT!Element (
>>>>>>>> myAttr <- newSubElt
>>>>>>>> ),
>>>>>>>> newSubElt : OUT!Element (
>>>>>>>> )
>>>>>>>> }
>>>>>>>>
>>>>>>>> - Call it from another rule
>>>>>>>> rule S {
>>>>>>>> from
>>>>>>>> e : IN!Element
>>>>>>>> to
>>>>>>>> newElt : OUT!Element (
>>>>>>>> elements <- e.elements->collect(elem |
>>>>>>>> thisModule.R(elem))
>>>>>>>> )
>>>>>>>> }
>>>>>>>>
>>>>>>>>
>>>>>>>> Best regards,
>>>>>>>>
>>>>>>>> Hugo
>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>>
>>>>>>>>> Benjamin CHEVALLEREAU a écrit :
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> I search to transform my metamodel to the metamodel UML2. I
>>>>>>>>>> must construct a profile with all stereotypes but in this
>>>>>>>>>> profile I must reference the class
>>>>>>>>>> http://www.eclipse.org/uml2/2.0.0/UML#//Element and i don't
>>>>>>>>>> know how to do that ?
>>>>>>>>>>
>>>>>>>>>> Thanks
>>>>>>>>
>>>>>>>>
Re: [ATL] Reference in the metamodel [message #50656 is a reply to message #50210] Wed, 04 July 2007 08:46 Go to previous message
Frédéric Jouault is currently offline Frédéric Jouault
Messages: 572
Registered: July 2009
Senior Member
Hi,

There is a checkbox in the launch config to "allow inter-model
references". In the latest version of ATL, this checkbox is in the
"advanced" tab.


Regards,

Frédéric Jouault


Benjamin CHEVALLEREAU wrote:
> Hi,
>
> How to allow that ?
>
> Thanks
>
> Frédéric Jouault a écrit :
>> Hello,
>>
>> Do you allow inter-model references?
>>
>>
>> Regards,
>>
>> Frédéric Jouault
>>
>>
>> Benjamin CHEVALLEREAU wrote:
>>> Hello,
>>>
>>> I have tried this :
>>> importedElement <- UML2!Element
>>>
>>> but I have no code in my file.
>>> Do you know why ?
>>>
>>> Thanks
>>>
>>> Frédéric Jouault a écrit :
>>>> Hello,
>>>>
>>>> Ok, now I understand your problem a bit better, thanks ;-).
>>>>
>>>>
>>>> What about:
>>>>
>>>> importedElement <- UML!Element
>>>>
>>>> ?
>>>> (assuming you "loaded" the UML2 "metamodel" by URI and named it "UML")
>>>>
>>>>
>>>> Regards,
>>>>
>>>> Frédéric Jouault
>>>>
>>>>
>>>> Benjamin CHEVALLEREAU wrote:
>>>>> I have a property "importedElement" that I must assign to
>>>>> "http://www.eclipse.org/uml2/2.0.0/UML#//Element". But I can't
>>>>> write this :
>>>>>
>>>>> importedElement <- 'http://www.eclipse.org/uml2/2.0.0/UML#//Element'
>>>>>
>>>>> --> message: cannot set feature
>>>>> UML2P!ElementImport.importedElement to value
>>>>> http://www.eclipse.org/uml2/2.0.0/UML#//Element
>>>>> exception:
>>>>> java.lang.ClassCastException: java.lang.String
>>>>>
>>>>>
>>>>> So I don't know how to do that.
>>>>>
>>>>> Thanks
>>>>>
>>>>>
>>>>>
>>>>> Frédéric Jouault a écrit :
>>>>>> Hello,
>>>>>>
>>>>>> I must admit that I am not sure to understand what you mean.
>>>>>>
>>>>>> Why don't you use:
>>>>>> "http://www.eclipse.org/uml2/2.0.0/UML#//Element", as you wrote in
>>>>>> your original post?
>>>>>>
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Frédéric Jouault
>>>>>>
>>>>>>
>>>>>> Benjamin CHEVALLEREAU wrote:
>>>>>>> Have you an idea to reference the class
>>>>>>> //UML_METAMODELS/UML.metamodel.uml#Element ?
>>>>>>>
>>>>>>> Thanks
>>>>>>>
>>>>>>> Benjamin CHEVALLEREAU a écrit :
>>>>>>>> Thanks for your help !!
>>>>>>>>
>>>>>>>> I have finded a solution with lazy rule. Now, I have a new
>>>>>>>> problem. I want to link a property with an external class but I
>>>>>>>> don't know how to do that. I want create a profile UML2. In
>>>>>>>> UML2, we can find :
>>>>>>>>
>>>>>>>> <elementImport xmi:id="_WfN3kCDAEdyNsvUu_WiziQ">
>>>>>>>> <importedElement xmi:type="uml:Class"
>>>>>>>> href="pathmap://UML_METAMODELS/UML.metamodel.uml#Element"/>
>>>>>>>> </elementImport>
>>>>>>>>
>>>>>>>> So I want to reference a class in an other metamodel but I don't
>>>>>>>> know how...
>>>>>>>>
>>>>>>>> Best regards
>>>>>>>>
>>>>>>>> Hugo Bruneliere a écrit :
>>>>>>>>> Hi Benjamin,
>>>>>>>>>
>>>>>>>>> Benjamin CHEVALLEREAU a écrit :
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> I have a new problem. I have a rule like that :
>>>>>>>>>>
>>>>>>>>>> rule R {
>>>>>>>>>> from e : IN!Element
>>>>>>>>>> to
>>>>>>>>>> newElt : OUT!Element foreach(...) (
>>>>>>>>>> myAttr <- newSubElt
>>>>>>>>>> ),
>>>>>>>>>> newSubElt : OUT!Element (...)
>>>>>>>>>> }
>>>>>>>>>>
>>>>>>>>>> I want that each new element contains a new sub element but
>>>>>>>>>> with this rule (it's normal), I have an only sub element
>>>>>>>>>> linked with the last element. How can I create a sub element
>>>>>>>>>> foreach element ?
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> You can use a "lazy rule" instead of using the "foreach"
>>>>>>>>> statement for this kind of purpose.
>>>>>>>>> A lazy rule is a declarative rule which have to be explicitly
>>>>>>>>> called from another rule. For instance, in your case you can do
>>>>>>>>> something like this:
>>>>>>>>>
>>>>>>>>> - Declare R as a lazy rule
>>>>>>>>>
>>>>>>>>> lazy rule R {
>>>>>>>>> from e : IN!Element
>>>>>>>>> to
>>>>>>>>> newElt : OUT!Element (
>>>>>>>>> myAttr <- newSubElt
>>>>>>>>> ),
>>>>>>>>> newSubElt : OUT!Element (
>>>>>>>>> )
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> - Call it from another rule
>>>>>>>>> rule S {
>>>>>>>>> from
>>>>>>>>> e : IN!Element
>>>>>>>>> to
>>>>>>>>> newElt : OUT!Element (
>>>>>>>>> elements <- e.elements->collect(elem |
>>>>>>>>> thisModule.R(elem))
>>>>>>>>> )
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Best regards,
>>>>>>>>>
>>>>>>>>> Hugo
>>>>>>>>>
>>>>>>>>>> Thanks
>>>>>>>>>>
>>>>>>>>>> Benjamin CHEVALLEREAU a écrit :
>>>>>>>>>>> Hi,
>>>>>>>>>>>
>>>>>>>>>>> I search to transform my metamodel to the metamodel UML2. I
>>>>>>>>>>> must construct a profile with all stereotypes but in this
>>>>>>>>>>> profile I must reference the class
>>>>>>>>>>> http://www.eclipse.org/uml2/2.0.0/UML#//Element and i don't
>>>>>>>>>>> know how to do that ?
>>>>>>>>>>>
>>>>>>>>>>> Thanks
>>>>>>>>>
>>>>>>>>>
Previous Topic:QVT framework?
Next Topic:[ATL] ADT feature in CVS inconsistent w/ repository
Goto Forum:
  


Current Time: Fri Oct 31 20:16:41 GMT 2014

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

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