Home » Archived » M2M (model-to-model transformation) » [ATL] programatically launch already loaded model
[ATL] programatically launch already loaded model [message #17519] |
Sat, 17 February 2007 01:28 |
Eclipse User |
|
|
|
Originally posted by: irbull.cs.uvic.ca
Is there a way to call a transform (programatically) on an already
loaded EMF model?
I have an EMF model that is already loaded and I would like to run a
transform on it. I don't want to reload it because it is rather large?
That is I don't want to:
ASMModel model = amh.loadModel(file.getName(), amh.getMof(), in);
thoughts,
cheers,
ian
|
|
|
Re: [ATL] programatically launch already loaded model [message #17535 is a reply to message #17519] |
Sat, 17 February 2007 18:19 |
Eclipse User |
|
|
|
Originally posted by: freddy.allilaire.univ-nantes.fr
Hi Ian,
I think you should take a look to the method loadASMEMFModel(String
name, ASMEMFModel metamodel, Resource extent, ModelLoader ml) available
if you directly use the class ASMEMFModel (you can use "null" for the ml
parameter).
I hope this help you to handle your large model (maybe NHL data ;-))
Regards,
Freddy
Ian Bull a écrit :
> Is there a way to call a transform (programatically) on an already
> loaded EMF model?
>
> I have an EMF model that is already loaded and I would like to run a
> transform on it. I don't want to reload it because it is rather large?
> That is I don't want to:
>
> ASMModel model = amh.loadModel(file.getName(), amh.getMof(), in);
>
>
> thoughts,
>
> cheers,
> ian
|
|
|
Re: [ATL] programatically launch already loaded model [message #17546 is a reply to message #17535] |
Sun, 18 February 2007 02:40 |
Eclipse User |
|
|
|
Originally posted by: irbull.cs.uvic.ca
Cool, Thanks Freddy, I will take a look at this...
and yep, my NHL Data... The things I can play with as a student :)
- ian
Freddy Allilaire wrote:
> Hi Ian,
>
> I think you should take a look to the method loadASMEMFModel(String
> name, ASMEMFModel metamodel, Resource extent, ModelLoader ml) available
> if you directly use the class ASMEMFModel (you can use "null" for the ml
> parameter).
>
> I hope this help you to handle your large model (maybe NHL data ;-))
>
> Regards,
> Freddy
>
> Ian Bull a écrit :
>> Is there a way to call a transform (programatically) on an already
>> loaded EMF model?
>>
>> I have an EMF model that is already loaded and I would like to run a
>> transform on it. I don't want to reload it because it is rather large?
>> That is I don't want to:
>>
>> ASMModel model = amh.loadModel(file.getName(), amh.getMof(), in);
>>
>>
>> thoughts,
>>
>> cheers,
>> ian
|
|
|
Re: [ATL] programatically launch already loaded model [message #17573 is a reply to message #17546] |
Tue, 20 February 2007 03:57 |
Eclipse User |
|
|
|
Originally posted by: irbull.cs.uvic.ca
Cool, this works!
However, my resource is loaded from Static EMF (not dynamic emf). Is
there a way to specify a metamodel from its EPackage?
cheers,
ian
Ian Bull wrote:
> Cool, Thanks Freddy, I will take a look at this...
>
> and yep, my NHL Data... The things I can play with as a student :)
>
> - ian
>
> Freddy Allilaire wrote:
>> Hi Ian,
>>
>> I think you should take a look to the method loadASMEMFModel(String
>> name, ASMEMFModel metamodel, Resource extent, ModelLoader ml)
>> available if you directly use the class ASMEMFModel (you can use
>> "null" for the ml parameter).
>>
>> I hope this help you to handle your large model (maybe NHL data ;-))
>>
>> Regards,
>> Freddy
>>
>> Ian Bull a écrit :
>>> Is there a way to call a transform (programatically) on an already
>>> loaded EMF model?
>>>
>>> I have an EMF model that is already loaded and I would like to run a
>>> transform on it. I don't want to reload it because it is rather
>>> large? That is I don't want to:
>>>
>>> ASMModel model = amh.loadModel(file.getName(), amh.getMof(), in);
>>>
>>>
>>> thoughts,
>>>
>>> cheers,
>>> ian
|
|
|
Re: [ATL] programatically launch already loaded model [message #17586 is a reply to message #17573] |
Tue, 20 February 2007 06:09 |
Eclipse User |
|
|
|
Originally posted by: irbull.cs.uvic.ca
I assume this is the problem, maybe not?
Basically it doesn't seem like my rules are matching any elements.
When I finish the transform and say:
outputModel.getExtent().getContents()
I get 0 elements.
The transformation is very simple:
module ExampleTransformation; -- Module Template
create OUT : BARCHART from IN : VIEWSHAPER;
rule Example {
from s : VIEWSHAPER!Node
to t : BARCHART!Item (
label <- s.toString()
)
}
and my model is nothing but VIEWSHAPER!Node, (there are lots of them :)
Actually, it doesn't matter what I put after BARCHAR!blah. It seems
like this never matches.
Is there a good way to debug this when called programmatically?
cheers,
ian
Ian Bull wrote:
> Cool, this works!
>
> However, my resource is loaded from Static EMF (not dynamic emf). Is
> there a way to specify a metamodel from its EPackage?
>
> cheers,
> ian
>
> Ian Bull wrote:
>> Cool, Thanks Freddy, I will take a look at this...
>>
>> and yep, my NHL Data... The things I can play with as a student :)
>>
>> - ian
>>
>> Freddy Allilaire wrote:
>>> Hi Ian,
>>>
>>> I think you should take a look to the method loadASMEMFModel(String
>>> name, ASMEMFModel metamodel, Resource extent, ModelLoader ml)
>>> available if you directly use the class ASMEMFModel (you can use
>>> "null" for the ml parameter).
>>>
>>> I hope this help you to handle your large model (maybe NHL data ;-))
>>>
>>> Regards,
>>> Freddy
>>>
>>> Ian Bull a écrit :
>>>> Is there a way to call a transform (programatically) on an already
>>>> loaded EMF model?
>>>>
>>>> I have an EMF model that is already loaded and I would like to run a
>>>> transform on it. I don't want to reload it because it is rather
>>>> large? That is I don't want to:
>>>>
>>>> ASMModel model = amh.loadModel(file.getName(), amh.getMof(), in);
>>>>
>>>>
>>>> thoughts,
>>>>
>>>> cheers,
>>>> ian
|
|
|
Re: [ATL] programatically launch already loaded model [message #17600 is a reply to message #17586] |
Tue, 20 February 2007 07:59 |
Eclipse User |
|
|
|
Originally posted by: irbull.cs.uvic.ca
No worries... I think I have it!
I used the same thing for my metamodels:
ASMEMFModel.loadASMEMFModel("VIEWSHAPER", (ASMEMFModel)amh.getMof(),
ViewshaperPackage.eINSTANCE.eResource(), null);
and said ViewshaperPackage.eINSTANCE.eResource for my metamodel.
cheers,
ian
Ian Bull wrote:
> I assume this is the problem, maybe not?
>
> Basically it doesn't seem like my rules are matching any elements.
> When I finish the transform and say:
> outputModel.getExtent().getContents()
> I get 0 elements.
>
> The transformation is very simple:
>
> module ExampleTransformation; -- Module Template
> create OUT : BARCHART from IN : VIEWSHAPER;
>
>
> rule Example {
> from s : VIEWSHAPER!Node
> to t : BARCHART!Item (
> label <- s.toString()
> )
> }
>
> and my model is nothing but VIEWSHAPER!Node, (there are lots of them :)
>
> Actually, it doesn't matter what I put after BARCHAR!blah. It seems
> like this never matches.
>
> Is there a good way to debug this when called programmatically?
>
> cheers,
> ian
>
> Ian Bull wrote:
>> Cool, this works!
>>
>> However, my resource is loaded from Static EMF (not dynamic emf). Is
>> there a way to specify a metamodel from its EPackage?
>>
>> cheers,
>> ian
>>
>> Ian Bull wrote:
>>> Cool, Thanks Freddy, I will take a look at this...
>>>
>>> and yep, my NHL Data... The things I can play with as a student :)
>>>
>>> - ian
>>>
>>> Freddy Allilaire wrote:
>>>> Hi Ian,
>>>>
>>>> I think you should take a look to the method loadASMEMFModel(String
>>>> name, ASMEMFModel metamodel, Resource extent, ModelLoader ml)
>>>> available if you directly use the class ASMEMFModel (you can use
>>>> "null" for the ml parameter).
>>>>
>>>> I hope this help you to handle your large model (maybe NHL data ;-))
>>>>
>>>> Regards,
>>>> Freddy
>>>>
>>>> Ian Bull a écrit :
>>>>> Is there a way to call a transform (programatically) on an already
>>>>> loaded EMF model?
>>>>>
>>>>> I have an EMF model that is already loaded and I would like to run
>>>>> a transform on it. I don't want to reload it because it is rather
>>>>> large? That is I don't want to:
>>>>>
>>>>> ASMModel model = amh.loadModel(file.getName(), amh.getMof(), in);
>>>>>
>>>>>
>>>>> thoughts,
>>>>>
>>>>> cheers,
>>>>> ian
|
|
|
Goto Forum:
Current Time: Thu Apr 25 13:27:25 GMT 2024
Powered by FUDForum. Page generated in 0.03167 seconds
|