[ATL] UML2 Profiles support [message #28138] |
Tue, 03 April 2007 08:42  |
Eclipse User |
|
|
|
Originally posted by: benois.argia-engineering.fr
Hi All,
I read newsgroup archives, the work of Christophe Le Camus and Dennis
Wagelaar about UML2 Profiles. But it seems ATL doesn't support completely
UML2 Profiles. I want to write a simple transformation in order to
extract stereotyped class and populate another DSL model. Can you help me
to start please ?
I copy my code here :
-- @atlcompiler atl2006
module UML22DSL;
create OUT : DSL from IN : UML2;
helper context UML2!uml::Element def: hasStereotype(name : String) :
Boolean =
--true;
self.getAppliedStereotypes()->exists(e | e.name = name);
--self.getAppliedStereotype(name)->oclIsKindOf(UML2!Stereotype);
rule UML2Stereotype1ToConcept1 {
from
s : UML2!uml::Class (s.hasStereotype('Stereotype1'))
to
t : DSL!Concept1 (
name <- s.name
)
do{
('RULE:UML2Stereotype1ToConcept1> Stereotype1 applied').println();
let st : String = '' in ('RULE:UML2Stereotype1ToConcept1> s.name=<' +
s.name + '>').println();
}
}
My transfo failed on :
****** BEGIN Stack Trace
message: ERROR: could not find operation getAppliedStereotypes on
UML2!Class having supertypes: [UML2!BehavioredClassifier,
UML2!EncapsulatedClassifier, OclType, OclAny] (including Java operations)
A.main() : ??#22 null
local variables = {self=UML22DSL : ASMModule} local stack = []
Regards,
Jérôme.
|
|
|
|
Re: [ATL] UML2 Profiles support [message #29330 is a reply to message #28138] |
Wed, 04 April 2007 11:10   |
Eclipse User |
|
|
|
Originally posted by: lw_mailme_00.yahoo.com
Jérôme,
which version of the UML2 plugins are you using? This definitely works
with UML2 2.0.3; I don't know about UML2 1.x.x.
Your helper could also be defined as
not s.getAppliedStereotype(name).oclIsUndefined()
In this case the name must have the form <profile name>::<stereotype
name>, for example, 'myProfile::myStereotype'
- Lutz
Jérôme BENOIS wrote, on 4/3/2007 8:42 AM:
> Hi All,
>
> I read newsgroup archives, the work of Christophe Le Camus and Dennis
> Wagelaar about UML2 Profiles. But it seems ATL doesn't support completely
> UML2 Profiles. I want to write a simple transformation in order to
> extract stereotyped class and populate another DSL model. Can you help me
> to start please ?
>
> I copy my code here :
>
> -- @atlcompiler atl2006
> module UML22DSL;
> create OUT : DSL from IN : UML2;
>
> helper context UML2!uml::Element def: hasStereotype(name : String) :
> Boolean =
> --true;
> self.getAppliedStereotypes()->exists(e | e.name = name);
> --self.getAppliedStereotype(name)->oclIsKindOf(UML2!Stereotype);
>
> rule UML2Stereotype1ToConcept1 {
> from
> s : UML2!uml::Class (s.hasStereotype('Stereotype1'))
> to
> t : DSL!Concept1 (
> name <- s.name
> )
> do{
> ('RULE:UML2Stereotype1ToConcept1> Stereotype1 applied').println();
> let st : String = '' in ('RULE:UML2Stereotype1ToConcept1> s.name=<' +
> s.name + '>').println();
> }
> }
>
> My transfo failed on :
>
> ****** BEGIN Stack Trace
> message: ERROR: could not find operation getAppliedStereotypes on
> UML2!Class having supertypes: [UML2!BehavioredClassifier,
> UML2!EncapsulatedClassifier, OclType, OclAny] (including Java operations)
> A.main() : ??#22 null
> local variables = {self=UML22DSL : ASMModule} local stack = []
>
> Regards,
> Jérôme.
|
|
|
|
|
Re: [ATL] UML2 Profiles support [message #30029 is a reply to message #29330] |
Thu, 05 April 2007 04:33   |
Eclipse User |
|
|
|
Originally posted by: touzitou.enstimac.fr
Hi Jerome,
i confirm that it works with UML2 2.0.3. Profiles Work well and nice.
it confirms that now ATl and UML2 can work together using profiles.
to use stereotype please use that form <profile name>::<stereotype
> name>.
Jihed.
Lutz Wrage a écrit :
> Jérôme,
>
> which version of the UML2 plugins are you using? This definitely works
> with UML2 2.0.3; I don't know about UML2 1.x.x.
> Your helper could also be defined as
>
> not s.getAppliedStereotype(name).oclIsUndefined()
>
> In this case the name must have the form <profile name>::<stereotype
> name>, for example, 'myProfile::myStereotype'
>
> - Lutz
>
> Jérôme BENOIS wrote, on 4/3/2007 8:42 AM:
>> Hi All,
>>
>> I read newsgroup archives, the work of Christophe Le Camus and Dennis
>> Wagelaar about UML2 Profiles. But it seems ATL doesn't support completely
>> UML2 Profiles. I want to write a simple transformation in order to
>> extract stereotyped class and populate another DSL model. Can you
>> help me
>> to start please ?
>>
>> I copy my code here :
>>
>> -- @atlcompiler atl2006
>> module UML22DSL;
>> create OUT : DSL from IN : UML2;
>>
>> helper context UML2!uml::Element def: hasStereotype(name : String) :
>> Boolean =
>> --true;
>> self.getAppliedStereotypes()->exists(e | e.name = name);
>> --self.getAppliedStereotype(name)->oclIsKindOf(UML2!Stereotype);
>>
>> rule UML2Stereotype1ToConcept1 {
>> from
>> s : UML2!uml::Class (s.hasStereotype('Stereotype1'))
>> to
>> t : DSL!Concept1 (
>> name <- s.name
>> )
>> do{
>> ('RULE:UML2Stereotype1ToConcept1> Stereotype1 applied').println();
>> let st : String = '' in ('RULE:UML2Stereotype1ToConcept1>
>> s.name=<' +
>> s.name + '>').println();
>> }
>> }
>>
>> My transfo failed on :
>>
>> ****** BEGIN Stack Trace
>> message: ERROR: could not find operation getAppliedStereotypes on
>> UML2!Class having supertypes: [UML2!BehavioredClassifier,
>> UML2!EncapsulatedClassifier, OclType, OclAny] (including Java operations)
>> A.main() : ??#22 null
>> local variables = {self=UML22DSL : ASMModule} local stack = []
>>
>> Regards,
>> Jérôme.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03512 seconds