Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Referring to model elements created by lazy rules
[ATL] Referring to model elements created by lazy rules [message #101554] Wed, 11 March 2009 01:10 Go to next message
Eclipse UserFriend
Originally posted by: atl_apprentice.yahoo.com

Hi all,

I am facing a following problem and I do not yet know how to solve this.

I created a transformation in which some UML model elements are generated by
means of lazy rules.
These lazy rules can not be unique, because they are called multiple times
to create model elements from one single source model element in different
locations in the target model.

If the rule would be unique a message is shown in the console
"message: Cannot set property ownedElement on element OUT!...
exception: javax.jmi.reflect.CompositionViolationException........." etc.

This is because one single model element can not have multiple namespaces.

When the unique keyword is removed this problem does not occur, because each
time the lazy rule is called a new element is created.

so far so good...

Now I want to create Dependencies to the created model elements, but I don't
know how to refer to the created model elements.

Normally I would make the lazy rule unique and call the rule again to refer
to a created model element.

But now, I can't use the unique keyword, because of the reason described
above.

So how do I refer to the model elements created earlier by means of
(non-unique) lazy rules?

Thanks
Re: [ATL] Referring to model elements created by lazy rules [message #101655 is a reply to message #101554] Thu, 12 March 2009 11:16 Go to previous message
Eclipse UserFriend
Originally posted by: atl_apprentice.yahoo.com

To answer my own question:

I resolved my problem. The solution is very simple.

I could not use thisModule.resolveTemp with lazy rules.

But the lazy rules are invoked from other rules.

At some point there has to be a rule in the "invocation tree" which is not
lazy.

Using resolveTemp with the non-lazy rule I was able to find my path to the
desired target model element.

Regards.



> Hi all,
>
> I am facing a following problem and I do not yet know how to solve this.
>
> I created a transformation in which some UML model elements are generated
> by means of lazy rules.
> These lazy rules can not be unique, because they are called multiple times
> to create model elements from one single source model element in different
> locations in the target model.
>
> If the rule would be unique a message is shown in the console
> "message: Cannot set property ownedElement on element OUT!...
> exception: javax.jmi.reflect.CompositionViolationException........." etc.
>
> This is because one single model element can not have multiple namespaces.
>
> When the unique keyword is removed this problem does not occur, because
> each time the lazy rule is called a new element is created.
>
> so far so good...
>
> Now I want to create Dependencies to the created model elements, but I
> don't know how to refer to the created model elements.
>
> Normally I would make the lazy rule unique and call the rule again to
> refer to a created model element.
>
> But now, I can't use the unique keyword, because of the reason described
> above.
>
> So how do I refer to the model elements created earlier by means of
> (non-unique) lazy rules?
>
> Thanks
>
Previous Topic:[QVTO] extension again!
Next Topic:[ATL] [TCS] [AM3] "atl" language absent in LanguageRegistry
Goto Forum:
  


Current Time: Thu Apr 25 12:33:25 GMT 2024

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

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

Back to the top