Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Porting M2T code generator from OAW to EMFT
Porting M2T code generator from OAW to EMFT [message #138060] Sun, 05 July 2009 08:06 Go to next message
Philipp Zech is currently offline Philipp ZechFriend
Messages: 96
Registered: July 2009
Member
Hi,

recently I have developed a code generator as an eclipse plugin,
generatiing Java source out of UML ActivityDiagrams (based on OAW and
using an UML profile for custom extensions). Now I'm trying to remove
the OAW dependencies by using the eclipse own MWE, included in the EMFT
project. Unfortunately, I'm facing some problems by porting the workflow
file itself, in more detail, OAW allows to specify an own UML profile in
the workflow, for example somtehing like this:

...
<component id="StoryGenerator" class="oaw.xpand2.Generator">
<metaModel class="oaw.type.emf.EmfMetaModel">
<metaModelPackage value="org.eclipse.emf.ecore.EcorePackage"/>
</metaModel>
<metaModel class="oaw.uml2.UML2MetaModel"/>
<metaModel id="profile"
class="oaw.uml2.profile.ProfileMetaModel">
<profile
value="info/teststories/generator/profile/tts.profile.uml"/ > <- can, or
must this be done if using MWE?
</metaModel>
<expand
value="info::teststories::generator::xpand::Teststory::Teststory FOR
model"/>
<outlet path="${projectLocation}/src/info/teststories/sut/stories"/ >
<beautifier class="oaw.xpand2.output.JavaBeautifier"/>
</component>
...

Above is only shown an excerpt of the workflow for OAW (running withoug
any problems under OAW), where the profile for the diagrams is set I'm
using to process it properly.

The second problem I'm facing is, currently the workflow is called out
of an ActionDelegate inside an eclipse plugin, using OAW's
WorkflowRunner class, which more or less looks like:

...
WorkflowRunner runner = new WorkflowRunner();
runner.run(workflowFile, new NullProgressMonitor(), properties,
slotMap);
...

Again, my question is, can this be done using MWE?
I'm sure it can be done somehow, but up to now I have not been able to
find an according class in the EMFT, especially the MWE API.

Thanks a lot for all the help in advance!

Cheers,

Philipp
Re: Porting M2T code generator from OAW to EMFT [message #138089 is a reply to message #138060] Mon, 06 July 2009 11:39 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Phillipp,


> <profile
> value="info/teststories/generator/profile/tts.profile.uml"/ > <-
> can, or must this be done if using MWE?

Yes, it can be done.
Note that all the namespaces of the referenced class have been renamed.
Usually from org.openarchitectureware to som org.eclipse package.

The best way to find the corresponding qualified names is to us JDT's
open type action (CTRL+SHIFT+T) and typ the simple name in (e.g.
"Generator" or "UML2MetaModel").

Note that these two components are part of M2T/Xpand, so they have to be
on your classpath in order to be found.

> The second problem I'm facing is, currently the workflow is called out
> of an ActionDelegate inside an eclipse plugin, using OAW's
> WorkflowRunner class, which more or less looks like:
>
> ...
> WorkflowRunner runner = new WorkflowRunner();
> runner.run(workflowFile, new NullProgressMonitor(), properties,
> slotMap);
> ...
>

The API is still there. However, the package is different.
The WorkflowRunner is located in "org.eclipse.emf.mwe.core"

There is another, more convenient API to invoke workflows:

new WorkflowFacade(workflowFile).run()

It's in the same package.

Cheers,
Sven
Re: Porting M2T code generator from OAW to EMFT [message #138141 is a reply to message #138089] Tue, 07 July 2009 19:19 Go to previous messageGo to next message
Philipp Zech is currently offline Philipp ZechFriend
Messages: 96
Registered: July 2009
Member
Sven Efftinge schrieb:
> Hi Phillipp,
>
>
>> <profile
>> value="info/teststories/generator/profile/tts.profile.uml"/ > <-
>> can, or must this be done if using MWE?
>
> Yes, it can be done.
> Note that all the namespaces of the referenced class have been renamed.
> Usually from org.openarchitectureware to som org.eclipse package.
>
> The best way to find the corresponding qualified names is to us JDT's
> open type action (CTRL+SHIFT+T) and typ the simple name in (e.g.
> "Generator" or "UML2MetaModel").
>
> Note that these two components are part of M2T/Xpand, so they have to be
> on your classpath in order to be found.
>
>> The second problem I'm facing is, currently the workflow is called out
>> of an ActionDelegate inside an eclipse plugin, using OAW's
>> WorkflowRunner class, which more or less looks like:
>>
>> ...
>> WorkflowRunner runner = new WorkflowRunner();
>> runner.run(workflowFile, new NullProgressMonitor(), properties,
>> slotMap);
>> ...
>>
>
> The API is still there. However, the package is different.
> The WorkflowRunner is located in "org.eclipse.emf.mwe.core"
>
> There is another, more convenient API to invoke workflows:
>
> new WorkflowFacade(workflowFile).run()
>
> It's in the same package.
>
> Cheers,
> Sven
Hi Sven,

thanks a lot for your help.

Cheers,

Philipp
Re: Porting M2T code generator from OAW to EMFT [message #138633 is a reply to message #138141] Wed, 15 July 2009 13:15 Go to previous messageGo to next message
Philipp Zech is currently offline Philipp ZechFriend
Messages: 96
Registered: July 2009
Member
Philipp Zech schrieb:
> Sven Efftinge schrieb:
>> Hi Phillipp,
>>
>>
>>> <profile
>>> value="info/teststories/generator/profile/tts.profile.uml"/ >
>>> <- can, or must this be done if using MWE?
>>
>> Yes, it can be done.
>> Note that all the namespaces of the referenced class have been renamed.
>> Usually from org.openarchitectureware to som org.eclipse package.
>>
>> The best way to find the corresponding qualified names is to us JDT's
>> open type action (CTRL+SHIFT+T) and typ the simple name in (e.g.
>> "Generator" or "UML2MetaModel").
>>
>> Note that these two components are part of M2T/Xpand, so they have to
>> be on your classpath in order to be found.
>>
>>> The second problem I'm facing is, currently the workflow is called
>>> out of an ActionDelegate inside an eclipse plugin, using OAW's
>>> WorkflowRunner class, which more or less looks like:
>>>
>>> ...
>>> WorkflowRunner runner = new WorkflowRunner();
>>> runner.run(workflowFile, new NullProgressMonitor(), properties,
>>> slotMap);
>>> ...
>>>
>>
>> The API is still there. However, the package is different.
>> The WorkflowRunner is located in "org.eclipse.emf.mwe.core"
>>
>> There is another, more convenient API to invoke workflows:
>>
>> new WorkflowFacade(workflowFile).run()
>>
>> It's in the same package.
>>
>> Cheers,
>> Sven
> Hi Sven,
>
> thanks a lot for your help.
>
> Cheers,
>
> Philipp
Hi again,

the porting of the generator worked so far, nevertheless, now I'm
getting another error.
for the models, out of which I generate code, I'm using an own uml
profile. As soon as I want to read in the model into the slot in my
workflow,
I get an exception stating, that a package, declared inside our profile,
could not be found.
The worklflow component for the Reader looks something like this:

<!-- load the model and store it in slot 'model' -->
<component id = "ModelLoader" class =
"org.eclipse.emf.mwe.utils.Reader">
<uri value = "${model}" />
<modelSlot value = "model" />
<!-- if working with multiple roots set to true -->
<firstElementOnly value = "true" />
</component>

The question arising inside me now is, do i have to specify the
underlying profile already in the component where I read the model? And
if not, what could be a possible reasaon for that error?


Thanks a lot!

Cheers,

Philipp

PS: the package, which is not found actually is decalred inside of the
profile.
Re: Porting M2T code generator from OAW to EMFT [message #138744 is a reply to message #138633] Thu, 16 July 2009 10:24 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

On 15.07.09 15:15, Philipp Zech wrote:
> Hi again,
>
> the porting of the generator worked so far, nevertheless, now I'm
> getting another error.
> for the models, out of which I generate code, I'm using an own uml
> profile. As soon as I want to read in the model into the slot in my
> workflow,
> I get an exception stating, that a package, declared inside our profile,
> could not be found.
> The worklflow component for the Reader looks something like this:
>
> <!-- load the model and store it in slot 'model' -->
> <component id = "ModelLoader" class = "org.eclipse.emf.mwe.utils.Reader">
> <uri value = "${model}" />
> <modelSlot value = "model" />
> <!-- if working with multiple roots set to true -->
> <firstElementOnly value = "true" />
> </component>
>
> The question arising inside me now is, do i have to specify the
> underlying profile already in the component where I read the model? And
> if not, what could be a possible reasaon for that error?
>
>
> Thanks a lot!
>
> Cheers,
>
> Philipp
>
> PS: the package, which is not found actually is decalred inside of the
> profile.

Hi Philipp!

I do not get such an error with our projects. Is your profile a seperate file or included in your main .uml file? Normally profiles are external
resources. Do you use platform resource URI as ${model}? You should do so.

~Karsten


Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: Porting M2T code generator from OAW to EMFT [message #138930 is a reply to message #138744] Mon, 20 July 2009 10:20 Go to previous messageGo to next message
Philipp Zech is currently offline Philipp ZechFriend
Messages: 96
Registered: July 2009
Member
Karsten Thoms schrieb:
> On 15.07.09 15:15, Philipp Zech wrote:
>> Hi again,
>>
>> the porting of the generator worked so far, nevertheless, now I'm
>> getting another error.
>> for the models, out of which I generate code, I'm using an own uml
>> profile. As soon as I want to read in the model into the slot in my
>> workflow,
>> I get an exception stating, that a package, declared inside our profile,
>> could not be found.
>> The worklflow component for the Reader looks something like this:
>>
>> <!-- load the model and store it in slot 'model' -->
>> <component id = "ModelLoader" class = "org.eclipse.emf.mwe.utils.Reader">
>> <uri value = "${model}" />
>> <modelSlot value = "model" />
>> <!-- if working with multiple roots set to true -->
>> <firstElementOnly value = "true" />
>> </component>
>>
>> The question arising inside me now is, do i have to specify the
>> underlying profile already in the component where I read the model? And
>> if not, what could be a possible reasaon for that error?
>>
>>
>> Thanks a lot!
>>
>> Cheers,
>>
>> Philipp
>>
>> PS: the package, which is not found actually is decalred inside of the
>> profile.
>
> Hi Philipp!
>
> I do not get such an error with our projects. Is your profile a seperate
> file or included in your main .uml file? Normally profiles are external
> resources. Do you use platform resource URI as ${model}? You should do so.
>
> ~Karsten
Hi again,

well the previous error disappeared, but by now another nice one
approaches, stating that the path to my model, which is actuallay
proper, is unmapped. For convenience i will no post the whole workflow,
maybe I made some configuration errors I can't figure out:

<?xml version="1.0" encoding="ISO-8859-1"?>
<workflow>

<property name = "model" value = "/home/c703443/Workspace
Galileo/PingerTest/model/ping.uml" />
<property name = "projectLocation" value = "" />
<property name = "modelLocation" value = "${projectLocation}/model" />
<property name = "generatedStories" value =
"src/info/teststories/sut/stories" />
<property name = "generatedSequences" value = "testsequences" />
<property name = "profileLocation" value =
"info/teststories/generator/profile/tts.profile.uml" />
<property name = "testCodeEntry" value =
"info::teststories::generator::xpand::Teststory::Teststory FOR model" />
<property name = "sequencesEntry" value =
"info::teststories::generator::xpand::Workflow::Workflow FOR model" />


<!-- set up EMF for standlaone execution -->
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup">
<platformUri value = "../." />
<RegisterGeneratedEPackage
value = "org.eclipse.emf.ecore.EcorePackage" />
</bean>


<!-- load the model and store it in slot 'model' -->
<component id = "ModelLoader" class =
"org.eclipse.emf.mwe.utils.Reader">
<uri value = "platform:/resource${model}" />
<modelSlot value = "model" />
<!-- if working with multiple roots set to true -->
<firstElementOnly value = "true" />
</component>


<!-- directory cleaners -->
<component id = "GenStoryDirectoryCleaner" class =
"org.eclipse.emf.mwe.utils.DirectoryCleaner">
<directory value = "${projectLocation}/${generatedStories}" />
</component>


<component id = "GenWorkflowDirectoryCleaner" class =
"org.eclipse.emf.mwe.utils.DirectoryCleaner">
<directory value = "${projectLocation}/${generatedSequences}" />
</component>


<!-- generate code -->
<component id = "TestCodeGenerator" class =
"org.eclipse.xpand2.Generator">
<metaModel class = "org.eclipse.xtend.typesystem.emf.EmfMetaModel">
<metaModelPackage value =
"org.eclipse.emf.ecore.EcorePackage" />
</metaModel>
<metaModel class =
"org.eclipse.xtend.typesystem.uml2.UML2MetaModel" />
<metaModel id = "profile"
class =
"org.eclipse.xtend.typesystem.uml2.profile.ProfileMetaModel" >
<profile value = "${profileLocation}" />
</metaModel>
<expand value = "${testCodeEntry}" />
<outlet path = "${projectLocation}/${generatedStories}" />
<beautifier class = "org.eclipse.xpand2.output.JavaBeautifier" />
</component>


<!-- generate the test sequence -->
<component id = "WorkflowGenerator" class =
"org.eclipse.xpand2.Generator">
<metaModel class = "org.eclipse.xtend.typesystem.emf.EmfMetaModel">
<metaModelPackage value =
"org.eclipse.emf.ecore.EcorePackage" />
</metaModel>
<metaModel class =
"org.eclipse.xtend.typesystem.uml2.UML2MetaModel" />
<metaModel id = "profile"
class =
"org.eclipse.xtend.typesystem.uml2.profile.ProfileMetaModel" >
<profile value = "${profileLocation}" />
</metaModel>
<expand value = "${sequencesEntry}" />
<outlet path = "${projectLocation}/${generatedSequences}">
<postprocessor class =
" info.teststories.generator.workflow.beautifier.WorkflowBeaut ifier " />
</outlet>
</component>

</workflow>

Again, thanks a lot for any help.

Cheers,

Philipp
Re: Porting M2T code generator from OAW to EMFT [message #139077 is a reply to message #138930] Tue, 21 July 2009 18:06 Go to previous message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

<uri value = "platform:/resource${model}" />
is invalid here, since 'model' is an absolute path.

Change model like this:
<property name = "model" value = "platform:/resource/PingerTest/model/ping.uml" />

Same for profileLocation.


Philipp Zech schrieb:
> Karsten Thoms schrieb:
>> On 15.07.09 15:15, Philipp Zech wrote:
>>> Hi again,
>>>
>>> the porting of the generator worked so far, nevertheless, now I'm
>>> getting another error.
>>> for the models, out of which I generate code, I'm using an own uml
>>> profile. As soon as I want to read in the model into the slot in my
>>> workflow,
>>> I get an exception stating, that a package, declared inside our profile,
>>> could not be found.
>>>
>>> The question arising inside me now is, do i have to specify the
>>> underlying profile already in the component where I read the model? And
>>> if not, what could be a possible reasaon for that error?
>>>
>>>
>>> Thanks a lot!
>>>
>>> Cheers,
>>>
>>> Philipp
>>>
>>> PS: the package, which is not found actually is decalred inside of the
>>> profile.
>>
>> Hi Philipp!
>>
>> I do not get such an error with our projects. Is your profile a
>> seperate file or included in your main .uml file? Normally profiles
>> are external resources. Do you use platform resource URI as ${model}?
>> You should do so.
>>
>> ~Karsten
> Hi again,
>
> well the previous error disappeared, but by now another nice one
> approaches, stating that the path to my model, which is actuallay
> proper, is unmapped. For convenience i will no post the whole workflow,
> maybe I made some configuration errors I can't figure out:
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <workflow>
>
> <property name = "model" value = "/home/c703443/Workspace
> Galileo/PingerTest/model/ping.uml" />
> <property name = "projectLocation" value = "" />
> <property name = "modelLocation" value = "${projectLocation}/model" />
> <property name = "generatedStories" value =
> "src/info/teststories/sut/stories" />
> <property name = "generatedSequences" value = "testsequences" />
> <property name = "profileLocation" value =
> "info/teststories/generator/profile/tts.profile.uml" />
> <property name = "testCodeEntry" value =
> "info::teststories::generator::xpand::Teststory::Teststory FOR model" />
> <property name = "sequencesEntry" value =
> "info::teststories::generator::xpand::Workflow::Workflow FOR model" />
>
>
> <!-- set up EMF for standlaone execution -->
> <bean class="org.eclipse.emf.mwe.utils.StandaloneSetup">
> <platformUri value = "../." />
> <RegisterGeneratedEPackage
> value = "org.eclipse.emf.ecore.EcorePackage" />
> </bean>
>
>
> <!-- load the model and store it in slot 'model' -->
> <component id = "ModelLoader" class =
> "org.eclipse.emf.mwe.utils.Reader">
> <uri value = "platform:/resource${model}" />
> <modelSlot value = "model" />
> <!-- if working with multiple roots set to true -->
> <firstElementOnly value = "true" />
> </component>
>
>
> <!-- directory cleaners -->
> <component id = "GenStoryDirectoryCleaner" class =
> "org.eclipse.emf.mwe.utils.DirectoryCleaner">
> <directory value = "${projectLocation}/${generatedStories}" />
> </component>
>
>
> <component id = "GenWorkflowDirectoryCleaner" class =
> "org.eclipse.emf.mwe.utils.DirectoryCleaner">
> <directory value = "${projectLocation}/${generatedSequences}" />
> </component>
>
>
> <!-- generate code -->
> <component id = "TestCodeGenerator" class =
> "org.eclipse.xpand2.Generator">
> <metaModel class = "org.eclipse.xtend.typesystem.emf.EmfMetaModel">
> <metaModelPackage value =
> "org.eclipse.emf.ecore.EcorePackage" />
> </metaModel>
> <metaModel class =
> "org.eclipse.xtend.typesystem.uml2.UML2MetaModel" />
> <metaModel id = "profile"
> class =
> "org.eclipse.xtend.typesystem.uml2.profile.ProfileMetaModel" >
> <profile value = "${profileLocation}" />
> </metaModel>
> <expand value = "${testCodeEntry}" />
> <outlet path = "${projectLocation}/${generatedStories}" />
> <beautifier class = "org.eclipse.xpand2.output.JavaBeautifier" />
> </component>
>
>
> <!-- generate the test sequence -->
> <component id = "WorkflowGenerator" class =
> "org.eclipse.xpand2.Generator">
> <metaModel class = "org.eclipse.xtend.typesystem.emf.EmfMetaModel">
> <metaModelPackage value =
> "org.eclipse.emf.ecore.EcorePackage" />
> </metaModel>
> <metaModel class =
> "org.eclipse.xtend.typesystem.uml2.UML2MetaModel" />
> <metaModel id = "profile"
> class =
> "org.eclipse.xtend.typesystem.uml2.profile.ProfileMetaModel" >
> <profile value = "${profileLocation}" />
> </metaModel>
> <expand value = "${sequencesEntry}" />
> <outlet path = "${projectLocation}/${generatedSequences}">
> <postprocessor class =
> " info.teststories.generator.workflow.beautifier.WorkflowBeaut ifier " />
> </outlet>
> </component>
>
> </workflow>
>
> Again, thanks a lot for any help.
>
> Cheers,
>
> Philipp


Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: Porting M2T code generator from OAW to EMFT [message #621089 is a reply to message #138060] Mon, 06 July 2009 11:39 Go to previous message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Phillipp,


> <profile
> value="info/teststories/generator/profile/tts.profile.uml"/ > <-
> can, or must this be done if using MWE?

Yes, it can be done.
Note that all the namespaces of the referenced class have been renamed.
Usually from org.openarchitectureware to som org.eclipse package.

The best way to find the corresponding qualified names is to us JDT's
open type action (CTRL+SHIFT+T) and typ the simple name in (e.g.
"Generator" or "UML2MetaModel").

Note that these two components are part of M2T/Xpand, so they have to be
on your classpath in order to be found.

> The second problem I'm facing is, currently the workflow is called out
> of an ActionDelegate inside an eclipse plugin, using OAW's
> WorkflowRunner class, which more or less looks like:
>
> ...
> WorkflowRunner runner = new WorkflowRunner();
> runner.run(workflowFile, new NullProgressMonitor(), properties,
> slotMap);
> ...
>

The API is still there. However, the package is different.
The WorkflowRunner is located in "org.eclipse.emf.mwe.core"

There is another, more convenient API to invoke workflows:

new WorkflowFacade(workflowFile).run()

It's in the same package.

Cheers,
Sven
Re: Porting M2T code generator from OAW to EMFT [message #621095 is a reply to message #138089] Tue, 07 July 2009 19:19 Go to previous message
Philipp Zech is currently offline Philipp ZechFriend
Messages: 96
Registered: July 2009
Member
Sven Efftinge schrieb:
> Hi Phillipp,
>
>
>> <profile
>> value="info/teststories/generator/profile/tts.profile.uml"/ > <-
>> can, or must this be done if using MWE?
>
> Yes, it can be done.
> Note that all the namespaces of the referenced class have been renamed.
> Usually from org.openarchitectureware to som org.eclipse package.
>
> The best way to find the corresponding qualified names is to us JDT's
> open type action (CTRL+SHIFT+T) and typ the simple name in (e.g.
> "Generator" or "UML2MetaModel").
>
> Note that these two components are part of M2T/Xpand, so they have to be
> on your classpath in order to be found.
>
>> The second problem I'm facing is, currently the workflow is called out
>> of an ActionDelegate inside an eclipse plugin, using OAW's
>> WorkflowRunner class, which more or less looks like:
>>
>> ...
>> WorkflowRunner runner = new WorkflowRunner();
>> runner.run(workflowFile, new NullProgressMonitor(), properties,
>> slotMap);
>> ...
>>
>
> The API is still there. However, the package is different.
> The WorkflowRunner is located in "org.eclipse.emf.mwe.core"
>
> There is another, more convenient API to invoke workflows:
>
> new WorkflowFacade(workflowFile).run()
>
> It's in the same package.
>
> Cheers,
> Sven
Hi Sven,

thanks a lot for your help.

Cheers,

Philipp
Re: Porting M2T code generator from OAW to EMFT [message #621135 is a reply to message #138141] Wed, 15 July 2009 13:15 Go to previous message
Philipp Zech is currently offline Philipp ZechFriend
Messages: 96
Registered: July 2009
Member
Philipp Zech schrieb:
> Sven Efftinge schrieb:
>> Hi Phillipp,
>>
>>
>>> <profile
>>> value="info/teststories/generator/profile/tts.profile.uml"/ >
>>> <- can, or must this be done if using MWE?
>>
>> Yes, it can be done.
>> Note that all the namespaces of the referenced class have been renamed.
>> Usually from org.openarchitectureware to som org.eclipse package.
>>
>> The best way to find the corresponding qualified names is to us JDT's
>> open type action (CTRL+SHIFT+T) and typ the simple name in (e.g.
>> "Generator" or "UML2MetaModel").
>>
>> Note that these two components are part of M2T/Xpand, so they have to
>> be on your classpath in order to be found.
>>
>>> The second problem I'm facing is, currently the workflow is called
>>> out of an ActionDelegate inside an eclipse plugin, using OAW's
>>> WorkflowRunner class, which more or less looks like:
>>>
>>> ...
>>> WorkflowRunner runner = new WorkflowRunner();
>>> runner.run(workflowFile, new NullProgressMonitor(), properties,
>>> slotMap);
>>> ...
>>>
>>
>> The API is still there. However, the package is different.
>> The WorkflowRunner is located in "org.eclipse.emf.mwe.core"
>>
>> There is another, more convenient API to invoke workflows:
>>
>> new WorkflowFacade(workflowFile).run()
>>
>> It's in the same package.
>>
>> Cheers,
>> Sven
> Hi Sven,
>
> thanks a lot for your help.
>
> Cheers,
>
> Philipp
Hi again,

the porting of the generator worked so far, nevertheless, now I'm
getting another error.
for the models, out of which I generate code, I'm using an own uml
profile. As soon as I want to read in the model into the slot in my
workflow,
I get an exception stating, that a package, declared inside our profile,
could not be found.
The worklflow component for the Reader looks something like this:

<!-- load the model and store it in slot 'model' -->
<component id = "ModelLoader" class =
"org.eclipse.emf.mwe.utils.Reader">
<uri value = "${model}" />
<modelSlot value = "model" />
<!-- if working with multiple roots set to true -->
<firstElementOnly value = "true" />
</component>

The question arising inside me now is, do i have to specify the
underlying profile already in the component where I read the model? And
if not, what could be a possible reasaon for that error?


Thanks a lot!

Cheers,

Philipp

PS: the package, which is not found actually is decalred inside of the
profile.
Re: Porting M2T code generator from OAW to EMFT [message #621144 is a reply to message #138633] Thu, 16 July 2009 10:24 Go to previous message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

On 15.07.09 15:15, Philipp Zech wrote:
> Hi again,
>
> the porting of the generator worked so far, nevertheless, now I'm
> getting another error.
> for the models, out of which I generate code, I'm using an own uml
> profile. As soon as I want to read in the model into the slot in my
> workflow,
> I get an exception stating, that a package, declared inside our profile,
> could not be found.
> The worklflow component for the Reader looks something like this:
>
> <!-- load the model and store it in slot 'model' -->
> <component id = "ModelLoader" class = "org.eclipse.emf.mwe.utils.Reader">
> <uri value = "${model}" />
> <modelSlot value = "model" />
> <!-- if working with multiple roots set to true -->
> <firstElementOnly value = "true" />
> </component>
>
> The question arising inside me now is, do i have to specify the
> underlying profile already in the component where I read the model? And
> if not, what could be a possible reasaon for that error?
>
>
> Thanks a lot!
>
> Cheers,
>
> Philipp
>
> PS: the package, which is not found actually is decalred inside of the
> profile.

Hi Philipp!

I do not get such an error with our projects. Is your profile a seperate file or included in your main .uml file? Normally profiles are external
resources. Do you use platform resource URI as ${model}? You should do so.

~Karsten


Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: Porting M2T code generator from OAW to EMFT [message #621159 is a reply to message #138744] Mon, 20 July 2009 10:20 Go to previous message
Philipp Zech is currently offline Philipp ZechFriend
Messages: 96
Registered: July 2009
Member
Karsten Thoms schrieb:
> On 15.07.09 15:15, Philipp Zech wrote:
>> Hi again,
>>
>> the porting of the generator worked so far, nevertheless, now I'm
>> getting another error.
>> for the models, out of which I generate code, I'm using an own uml
>> profile. As soon as I want to read in the model into the slot in my
>> workflow,
>> I get an exception stating, that a package, declared inside our profile,
>> could not be found.
>> The worklflow component for the Reader looks something like this:
>>
>> <!-- load the model and store it in slot 'model' -->
>> <component id = "ModelLoader" class = "org.eclipse.emf.mwe.utils.Reader">
>> <uri value = "${model}" />
>> <modelSlot value = "model" />
>> <!-- if working with multiple roots set to true -->
>> <firstElementOnly value = "true" />
>> </component>
>>
>> The question arising inside me now is, do i have to specify the
>> underlying profile already in the component where I read the model? And
>> if not, what could be a possible reasaon for that error?
>>
>>
>> Thanks a lot!
>>
>> Cheers,
>>
>> Philipp
>>
>> PS: the package, which is not found actually is decalred inside of the
>> profile.
>
> Hi Philipp!
>
> I do not get such an error with our projects. Is your profile a seperate
> file or included in your main .uml file? Normally profiles are external
> resources. Do you use platform resource URI as ${model}? You should do so.
>
> ~Karsten
Hi again,

well the previous error disappeared, but by now another nice one
approaches, stating that the path to my model, which is actuallay
proper, is unmapped. For convenience i will no post the whole workflow,
maybe I made some configuration errors I can't figure out:

<?xml version="1.0" encoding="ISO-8859-1"?>
<workflow>

<property name = "model" value = "/home/c703443/Workspace
Galileo/PingerTest/model/ping.uml" />
<property name = "projectLocation" value = "" />
<property name = "modelLocation" value = "${projectLocation}/model" />
<property name = "generatedStories" value =
"src/info/teststories/sut/stories" />
<property name = "generatedSequences" value = "testsequences" />
<property name = "profileLocation" value =
"info/teststories/generator/profile/tts.profile.uml" />
<property name = "testCodeEntry" value =
"info::teststories::generator::xpand::Teststory::Teststory FOR model" />
<property name = "sequencesEntry" value =
"info::teststories::generator::xpand::Workflow::Workflow FOR model" />


<!-- set up EMF for standlaone execution -->
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup">
<platformUri value = "../." />
<RegisterGeneratedEPackage
value = "org.eclipse.emf.ecore.EcorePackage" />
</bean>


<!-- load the model and store it in slot 'model' -->
<component id = "ModelLoader" class =
"org.eclipse.emf.mwe.utils.Reader">
<uri value = "platform:/resource${model}" />
<modelSlot value = "model" />
<!-- if working with multiple roots set to true -->
<firstElementOnly value = "true" />
</component>


<!-- directory cleaners -->
<component id = "GenStoryDirectoryCleaner" class =
"org.eclipse.emf.mwe.utils.DirectoryCleaner">
<directory value = "${projectLocation}/${generatedStories}" />
</component>


<component id = "GenWorkflowDirectoryCleaner" class =
"org.eclipse.emf.mwe.utils.DirectoryCleaner">
<directory value = "${projectLocation}/${generatedSequences}" />
</component>


<!-- generate code -->
<component id = "TestCodeGenerator" class =
"org.eclipse.xpand2.Generator">
<metaModel class = "org.eclipse.xtend.typesystem.emf.EmfMetaModel">
<metaModelPackage value =
"org.eclipse.emf.ecore.EcorePackage" />
</metaModel>
<metaModel class =
"org.eclipse.xtend.typesystem.uml2.UML2MetaModel" />
<metaModel id = "profile"
class =
"org.eclipse.xtend.typesystem.uml2.profile.ProfileMetaModel" >
<profile value = "${profileLocation}" />
</metaModel>
<expand value = "${testCodeEntry}" />
<outlet path = "${projectLocation}/${generatedStories}" />
<beautifier class = "org.eclipse.xpand2.output.JavaBeautifier" />
</component>


<!-- generate the test sequence -->
<component id = "WorkflowGenerator" class =
"org.eclipse.xpand2.Generator">
<metaModel class = "org.eclipse.xtend.typesystem.emf.EmfMetaModel">
<metaModelPackage value =
"org.eclipse.emf.ecore.EcorePackage" />
</metaModel>
<metaModel class =
"org.eclipse.xtend.typesystem.uml2.UML2MetaModel" />
<metaModel id = "profile"
class =
"org.eclipse.xtend.typesystem.uml2.profile.ProfileMetaModel" >
<profile value = "${profileLocation}" />
</metaModel>
<expand value = "${sequencesEntry}" />
<outlet path = "${projectLocation}/${generatedSequences}">
<postprocessor class =
" info.teststories.generator.workflow.beautifier.WorkflowBeaut ifier " />
</outlet>
</component>

</workflow>

Again, thanks a lot for any help.

Cheers,

Philipp
Re: Porting M2T code generator from OAW to EMFT [message #621171 is a reply to message #138930] Tue, 21 July 2009 18:06 Go to previous message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

<uri value = "platform:/resource${model}" />
is invalid here, since 'model' is an absolute path.

Change model like this:
<property name = "model" value = "platform:/resource/PingerTest/model/ping.uml" />

Same for profileLocation.


Philipp Zech schrieb:
> Karsten Thoms schrieb:
>> On 15.07.09 15:15, Philipp Zech wrote:
>>> Hi again,
>>>
>>> the porting of the generator worked so far, nevertheless, now I'm
>>> getting another error.
>>> for the models, out of which I generate code, I'm using an own uml
>>> profile. As soon as I want to read in the model into the slot in my
>>> workflow,
>>> I get an exception stating, that a package, declared inside our profile,
>>> could not be found.
>>>
>>> The question arising inside me now is, do i have to specify the
>>> underlying profile already in the component where I read the model? And
>>> if not, what could be a possible reasaon for that error?
>>>
>>>
>>> Thanks a lot!
>>>
>>> Cheers,
>>>
>>> Philipp
>>>
>>> PS: the package, which is not found actually is decalred inside of the
>>> profile.
>>
>> Hi Philipp!
>>
>> I do not get such an error with our projects. Is your profile a
>> seperate file or included in your main .uml file? Normally profiles
>> are external resources. Do you use platform resource URI as ${model}?
>> You should do so.
>>
>> ~Karsten
> Hi again,
>
> well the previous error disappeared, but by now another nice one
> approaches, stating that the path to my model, which is actuallay
> proper, is unmapped. For convenience i will no post the whole workflow,
> maybe I made some configuration errors I can't figure out:
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <workflow>
>
> <property name = "model" value = "/home/c703443/Workspace
> Galileo/PingerTest/model/ping.uml" />
> <property name = "projectLocation" value = "" />
> <property name = "modelLocation" value = "${projectLocation}/model" />
> <property name = "generatedStories" value =
> "src/info/teststories/sut/stories" />
> <property name = "generatedSequences" value = "testsequences" />
> <property name = "profileLocation" value =
> "info/teststories/generator/profile/tts.profile.uml" />
> <property name = "testCodeEntry" value =
> "info::teststories::generator::xpand::Teststory::Teststory FOR model" />
> <property name = "sequencesEntry" value =
> "info::teststories::generator::xpand::Workflow::Workflow FOR model" />
>
>
> <!-- set up EMF for standlaone execution -->
> <bean class="org.eclipse.emf.mwe.utils.StandaloneSetup">
> <platformUri value = "../." />
> <RegisterGeneratedEPackage
> value = "org.eclipse.emf.ecore.EcorePackage" />
> </bean>
>
>
> <!-- load the model and store it in slot 'model' -->
> <component id = "ModelLoader" class =
> "org.eclipse.emf.mwe.utils.Reader">
> <uri value = "platform:/resource${model}" />
> <modelSlot value = "model" />
> <!-- if working with multiple roots set to true -->
> <firstElementOnly value = "true" />
> </component>
>
>
> <!-- directory cleaners -->
> <component id = "GenStoryDirectoryCleaner" class =
> "org.eclipse.emf.mwe.utils.DirectoryCleaner">
> <directory value = "${projectLocation}/${generatedStories}" />
> </component>
>
>
> <component id = "GenWorkflowDirectoryCleaner" class =
> "org.eclipse.emf.mwe.utils.DirectoryCleaner">
> <directory value = "${projectLocation}/${generatedSequences}" />
> </component>
>
>
> <!-- generate code -->
> <component id = "TestCodeGenerator" class =
> "org.eclipse.xpand2.Generator">
> <metaModel class = "org.eclipse.xtend.typesystem.emf.EmfMetaModel">
> <metaModelPackage value =
> "org.eclipse.emf.ecore.EcorePackage" />
> </metaModel>
> <metaModel class =
> "org.eclipse.xtend.typesystem.uml2.UML2MetaModel" />
> <metaModel id = "profile"
> class =
> "org.eclipse.xtend.typesystem.uml2.profile.ProfileMetaModel" >
> <profile value = "${profileLocation}" />
> </metaModel>
> <expand value = "${testCodeEntry}" />
> <outlet path = "${projectLocation}/${generatedStories}" />
> <beautifier class = "org.eclipse.xpand2.output.JavaBeautifier" />
> </component>
>
>
> <!-- generate the test sequence -->
> <component id = "WorkflowGenerator" class =
> "org.eclipse.xpand2.Generator">
> <metaModel class = "org.eclipse.xtend.typesystem.emf.EmfMetaModel">
> <metaModelPackage value =
> "org.eclipse.emf.ecore.EcorePackage" />
> </metaModel>
> <metaModel class =
> "org.eclipse.xtend.typesystem.uml2.UML2MetaModel" />
> <metaModel id = "profile"
> class =
> "org.eclipse.xtend.typesystem.uml2.profile.ProfileMetaModel" >
> <profile value = "${profileLocation}" />
> </metaModel>
> <expand value = "${sequencesEntry}" />
> <outlet path = "${projectLocation}/${generatedSequences}">
> <postprocessor class =
> " info.teststories.generator.workflow.beautifier.WorkflowBeaut ifier " />
> </outlet>
> </component>
>
> </workflow>
>
> Again, thanks a lot for any help.
>
> Cheers,
>
> Philipp


Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Previous Topic:JET2 in emft project
Next Topic:[EMF Compare] Graphical visualization of the differences?
Goto Forum:
  


Current Time: Sat Jul 27 01:25:17 GMT 2024

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

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

Back to the top