[xtend] UML profile stereotypes not recognized [message #509142] |
Thu, 21 January 2010 13:58 |
Richard Wood Messages: 29 Registered: January 2010 |
Junior Member |
|
|
Hello
Within my Xtend file UML stereotypes are not recognized at generation time.
I'm using a test UML2 3.0 model referencing a profile.
In the model a UML class is applying a stereotype "Service".
The Xtend method with type "Service" as input parameter is never executed.
According this post it seems to be an issue with the MWE configuration.
http://www.eclipse.org/forums/index.php?t=msg&goto=50025 6&S=5ba2edc7e72c9d3f1be1ad045e72b0bb#msg_500256
I'm using Galileo and 0.7.2
Here is my mwe config
<?xml version="1.0"?>
<workflow>
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup">
<platformUri value=".."/>
<registerGeneratedEPackage value="org.eclipse.uml2.uml.UMLPackage"/>
<registerEcoreFile value="file://C:/DataService/DataServiceFramework/lib/DataServiceGenerator/src/TestProfile.profile.uml"/>
</bean>
<bean id="mmUML"
class="org.eclipse.xtend.typesystem.uml2.UML2MetaModel">
</bean>
<bean id="testProfile"
class="org.eclipse.xtend.typesystem.uml2.profile.ProfileMetaModel">
<profile value="C:/DataService/DataServiceFramework/lib/DataServiceGenerator/src/TestProfile.profile.uml"/>
</bean>
<component class="org.eclipse.emf.mwe.utils.Reader">
<uri value="platform:/resource/DataServiceGenerator/src/Test.uml"/>
<modelSlot value="umlModel"/>
</component>
<component class="org.eclipse.xtend.XtendComponent">
<metaModel idRef="mmUML"/>
<metaModel idRef="testProfile"/>
<invoke value="umlTransform::transform(umlModel)" />
<outputSlot value="serviceModel" />
</component>
</workflow>
And here is the xtend code
extension org::eclipse::xtend::util::stdlib::io;
uml::Model transform(uml::Model mymodel):
info("XXXXX") ->
mymodel.packagedElement.typeSelect(uml::Class).transform()
;
Void transform(uml::Class myclass):
info("UML Class " + myclass.name)
;
Void transform(TestProfile::Service myclass):
info("Service " + myclass.name)
;
Any ideas?
Please advise.
Thanks
Richard
[Updated on: Thu, 21 January 2010 14:02] Report message to a moderator
|
|
|
|
|
Re: [xtend] UML profile stereotypes not recognized [message #509293 is a reply to message #509181] |
Thu, 21 January 2010 21:15 |
|
hi,
modifiying the workflow like this works for me
<?xml version="1.0"?>
<workflow>
<bean class="org.eclipse.xtend.typesystem.uml2.Setup" standardUML2Setup="true" />
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup">
<platformUri value="."/>
</bean>
<bean id="mmUML"
class="org.eclipse.xtend.typesystem.uml2.UML2MetaModel">
</bean>
<bean id="testProfile"
class="org.eclipse.xtend.typesystem.uml2.profile.ProfileMetaModel">
<profile value="platform:/resource/src/TestProfile.profile.uml"/>
</bean>
<component class="org.eclipse.emf.mwe.utils.Reader">
<uri value="platform:/resource/src/Test.uml"/>
<modelSlot value="umlModel"/>
</component>
<component class="org.eclipse.xtend.XtendComponent">
<metaModel idRef="testProfile"/>
<metaModel idRef="mmUML"/>
<invoke value="umlTransform::transform(umlModel)" />
<outputSlot value="serviceModel" />
</component>
</workflow>
INFO: XXXXX
21.01.2010 22:14:04 org.eclipse.xtend.util.stdlib.IOExtensions info
INFO: Service Something
21.01.2010 22:14:04 org.eclipse.emf.mwe.core.WorkflowRunner executeWorkflow
INFO: workflow completed in 1248ms!
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04367 seconds