[XPand] Apply oaw to xpand project error [message #930173] |
Tue, 02 October 2012 04:39  |
Eclipse User |
|
|
|
Hi everyone,
I'm new to oAW and xpand, I'm trying to apply workflow to my xpand project, can you please to help me this issue?
Here is my xpand code:
«DEFINE main FOR ARRoot::BMD»
«FILE "Hello.h" -»
Number = «this.Example.parameter.value»
«ENDFILE»
«ENDDEFINE»
Here is my workflow:
<?xml version="1.0" encoding="utf-8"?>
<workflow>
<property name="baseDir" value="./"/>
<property name='src-gen' value="${baseDir}/gen" />
<!-- load model and store it in slot 'model' -->
<component class="org.openarchitectureware.xsd.XMLReader">
<uri value="./default.arxml"/>
<modelSlot value="EPC" />
<metaModel id="mm" class="org.openarchitectureware.xsd.XSDMetaModel">
<schemaFile value="${baseDir}/autosar_4-0-3.xsd"/>
</metaModel>
</component>
<component class="org.openarchitectureware.xpand2.Generator">
<metaModel idRef="mm" />
<expand value="src::mytemplate::main FOR EPC"/>
<outlet path="${src-gen}" >
<postprocessor class="org.openarchitectureware.xpand2.output.JavaBeautifier" />
</outlet>
</component>
</workflow>
My problem:
7218 INFO CompositeComponent - Generator: generating 'src::mytemplate::main FOR EPC' => .//gen
7410 ERROR AbstractExpressionsUsingWorkflowComponent - Error in Component of type org.openarchitectureware.xpand2.Generator:
EvaluationException : No Definition 'src::mytemplate::main for autosar403::Autosar' found!
[23,36] on line 1 'EXPAND src::mytemplate::main FOR EPC'
7410 ERROR WorkflowRunner - Workflow interrupted. Reason: EvaluationException : No Definition 'src::mytemplate::main for autosar403::Autosar' found!
[23,36] on line 1 'EXPAND src::mytemplate::main FOR EPC'
7411 ERROR WorkflowRunner - ERROR in Component of type org.openarchitectureware.xpand2.Generator
No Definition 'src::mytemplate::main for autosar403::Autosar' found! [EXPAND src::mytemplate::main FOR EPC] in workflow: Generator: generating 'src::mytemplate::main FOR EPC' => .//gen
I think my input at expand tab has problem, but I don't have any ideas to fix it. My model file has 2 parts:
+ BMD: template of parameters
+ EPC: value of parameters
Can you please give a brief direction with this problem?
Thank you
|
|
|
|
Re: [XPand] Apply oaw to xpand project error [message #930235 is a reply to message #930173] |
Tue, 02 October 2012 06:05   |
Eclipse User |
|
|
|
The qualified value of "expand" must be read as follows: The last segment is the definition within the Xpand file ("main"), obviously correct. The segment before is the name of the template file ("mytemplate" => "mytemplate.xpt"). All segments in front of that are the path to that Xpand file relative to classpath root. And I think here is your problem. I guess that "src" is actually your source folder, and thus the classpath root itself. The template thus lies directly in the classpath root, and the value for "expand" must be "mytemplate::main FOR EPC".
Regards,
~Karsten
|
|
|
Re: [XPand] Apply oaw to xpand project error [message #930268 is a reply to message #930235] |
Tue, 02 October 2012 06:53   |
Eclipse User |
|
|
|
Thanks for all your helps
@Christian Dietrich: How can I define the entry rule for the root node of my model? can you please explain more clearly?
@Karsten Thoms: I changed but it doesn't work, the same issue above
7448 ERROR AbstractExpressionsUsingWorkflowComponent - Error in Component of type org.openarchitectureware.xpand2.Generator:
EvaluationException : No Definition 'mytemplate::main for autosar403::Autosar' found!
[23,31] on line 1 'EXPAND mytemplate::main FOR EPC'
I also try to change classpath in MANIFEST.MF
with src::mytemplate::main and
with mytemplate::main but it doesn't work too
|
|
|
|
|
|
Re: [XPand] Apply oaw to xpand project error [message #930447 is a reply to message #930413] |
Tue, 02 October 2012 10:24   |
Eclipse User |
|
|
|
Thanks for your suggest, I try some ways to add <<DEFINE main FOR autosar403::Autosar>> to my xpand code but not effect, it doesn't find 'autosar403::Autosar', I think 'autosar403::Autosar' is just a kind of template for 'main' to follow and it's not in model, and I think I need to connect my model to 'autosar403::Autosar', but I don't know where, sorry because I'm newbie for these, can you give me a more more clearly direction, thanks for your time
|
|
|
|
|
Re: [XPand] Apply oaw to xpand project error [message #931396 is a reply to message #931220] |
Wed, 03 October 2012 06:41   |
Eclipse User |
|
|
|
Hi,
what do you mean with "i can generate"? i still do not get your point.
the root node of your xml file is an AUTOSAR node and not an BMD root.
so i think you mix up some metalevels here.
so where can i find everything to reproduce the problem.
btw why do you still use good old oaw? and not eclipse xpand.
~Christian
|
|
|
Re: [XPand] Apply oaw to xpand project error [message #931484 is a reply to message #931396] |
Wed, 03 October 2012 08:46   |
Eclipse User |
|
|
|
Hi,
I'm using Artop, that bases on eclipse and work with AUTOSAR model, xpand, and generate code, sorry for missing information. I can normally generate code with my xpand code and arxml model file above on Artop, I want to apply workflow to my project for fast generating code. I found homepage of oaw and install ver 4.3.1 for my Artop, do you mean it's better to use ver 5.x? In my project properties xtend/xpand has
+ ECU Configuration Typesystem (checked)
+ EMF Metamodels (checked)
+ oAW-Classic Metamodel
+ Sphinx-managed EMF Metamodel
+ JavaBean Metamodel
My project also has openArchitectureWare properties with
+ EMF Metamodels (checked)
+ oAW-Classic Metamodel (checked)
+ XSD Metamodels (checked)
+ JavaBeans Metamodel
+ RSA/RSM profiles
+ UML2 profile
By the way, I just install all model plugin on http://download.eclipse.org/releases/indigo
Thanks for your time
|
|
|
Re: [XPand] Apply oaw to xpand project error [message #931502 is a reply to message #931484] |
Wed, 03 October 2012 09:05   |
Eclipse User |
|
|
|
Hi I do not know atop but if they come with an own type system you
should maybe use this one instead of xsd. Maybe they do an internal
model2model transformation too. Therefore you should ask the artop
guys what they internally do and which kind of metamodel to use and
how to read the model.
I mean you should use eclipse xpand instead of law xpand.
--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de
|
|
|
Re: [XPand] Apply oaw to xpand project error [message #931571 is a reply to message #931502] |
Wed, 03 October 2012 10:20   |
Eclipse User |
|
|
|
Hi Christian, thanks for you help I found that they use autosar_4-0-3.xsd to read metamodel and xml.xsd to read model file .arxml, maybe in xtend/xpand properties, I don't have XSD Metamodels so it doesn't work, how can I add it to xtend/xpand properties. Thanks you very much
|
|
|
|
|
Re: [XPand] Apply oaw to xpand project error [message #932423 is a reply to message #932354] |
Thu, 04 October 2012 05:01   |
Eclipse User |
|
|
|
Hi Christian, I changed to <<DEFINE main FOR autosar403::Autosar>> and workflow worked, but I face other issue that I can't access parameters in my modelwith 'this' pointer, example with «this.Example.parameter.value» it can't see 'Example', I try «this.ARRoot.EPC.Example.parameter.value» but it can't access too, can you give me suggestion? Thanks
|
|
|
|
Re: [XPand] Apply oaw to xpand project error [message #932552 is a reply to message #932533] |
Thu, 04 October 2012 07:56   |
Eclipse User |
|
|
|
Maybe I haven't connect right between my model and the file to read the model. Anyway workflow worked, here is my xpand code
«DEFINE main FOR autosar403::Autosar»
«FILE "Hello.h" -»
this = «this»
«ENDFILE»
«ENDDEFINE»
Here is my output
this = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@1e36c93 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@14b93f (name: Autosar) (instanceClassName: null) (abstract: false, interface: false))
My other problem is code completion disappeared, I find solution by check javabean metamodel in xpand/xtend properties but it doesn't work, can you please suggest me some solutions for these issues?
Thanks
|
|
|
|
Re: [XPand] Apply oaw to xpand project error [message #932674 is a reply to message #932613] |
Thu, 04 October 2012 10:10   |
Eclipse User |
|
|
|
Hi, I also copy autosar403.xsd and xml.xsd to my source, check XSD metamodel in the project xpand/xtend properties, here is my xpand/xtend properties:
+ECU Configuration Typesystem (checked)
+EMF Metamodels (checked)
+Sphinx-managed EMF metamodels (checked)
+XSD metamodels (checked)
+oAW-Classic Metamodel
+UML2 profiles
+Javabeans Metamodel
Maybe my problem that I have 2 .xsd files to read model file arxml, so the way to access parameters in my model is different from the normal way
|
|
|
|
|
|
Re: [XPand] Apply oaw to xpand project error [message #933764 is a reply to message #932825] |
Fri, 05 October 2012 10:15   |
Eclipse User |
|
|
|
Hi Christian,
I think my problem is xsd schema cannot read model, it just see the root one. Follow output of root node above
this = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@1e36c93 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@14b93f (name: Autosar) (instanceClassName: null) (abstract: false, interface: false))
Beside, I find some other schema like autosar40.ecore and autosar40.genmodel, maybe I have to use emf metamodel to load autosar40.ecore and read my model, but my model is xml, so I just don't know to solve this issue.
Thanks
|
|
|
Re: [XPand] Apply oaw to xpand project error [message #934074 is a reply to message #933764] |
Fri, 05 October 2012 16:23   |
Eclipse User |
|
|
|
Hi,
i just gave it a try:
the problem is. autosar.xsd has notthing todo with *.arxml
here is what works
(use javabeans metamodel in xpand and required deps to the project.
<workflow>
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" platformUri="..">
<registerGeneratedEPackage value="autosar40.util.Autosar40Package" />
<extensionMap>
<from value="arxml" />
<to value="autosar40.util.Autosar40ResourceFactoryImpl" />
</extensionMap>
</bean>
<component class="org.eclipse.emf.mwe.utils.Reader">
<modelSlot value="model" />
<uri value="platform:/resource/test/default.arxml" />
</component>
<component class="org.eclipse.xpand2.Generator">
<expand value="test::main FOR model" />
<outlet path="src-gen" />
<metaModel class="org.eclipse.xtend.type.impl.java.JavaBeansMetaModel" />
</component>
</workflow>
«DEFINE main FOR autosar40::autosartoplevelstructure::AUTOSAR»
«FILE "test.txt"»
«this»
«ENDFILE»
«ENDDEFINE»
~Christian
|
|
|
Re: [XPand] Apply oaw to xpand project error [message #936670 is a reply to message #934074] |
Mon, 08 October 2012 08:01   |
Eclipse User |
|
|
|
Hi,
Can you show me your configuration in dependencies, and xpand/xtend properties or some references, I try to configure follow warning of console, but it seems not effective.
Beside, can you access other members in model file by xpand code?
Thanks
|
|
|
Re: [XPand] Apply oaw to xpand project error [message #936701 is a reply to message #936670] |
Mon, 08 October 2012 08:37   |
Eclipse User |
|
|
|
I choose javabeansmetamodel in the props and add the jar containing
the package class used in the workflow to the plugin dependencies of
the manifest.MF file sorry have no access to the code for the next 5
days
--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de
|
|
|
Re: [XPand] Apply oaw to xpand project error [message #936744 is a reply to message #936701] |
Mon, 08 October 2012 09:37   |
Eclipse User |
|
|
|
Hi,
I found my problem, I forgot to change my workflow .oaw to .mwe, so the console warning all about oAW class.
After fixing, my consult is follow
SEVERE: org.eclipse.emf.mwe.core.ConfigurationException: Couldn't find an interface autosar40.util.Autosar40Package
java.lang.RuntimeException: org.eclipse.emf.mwe.core.ConfigurationException: Couldn't find an interface autosar40.util.Autosar40Package
at org.eclipse.emf.mwe.internal.core.ast.util.InjectorSimple.setValue(InjectorSimple.java:35)
at org.eclipse.emf.mwe.internal.core.ast.util.VisitorCreator.visitSimpleParamAST(VisitorCreator.java:201)
Where do you place autosar40, is it autosar40.ecore?
Thanks much
|
|
|
|
|
|
Re: [XPand] Apply oaw to xpand project error [message #937674 is a reply to message #937629] |
Tue, 09 October 2012 07:00   |
Eclipse User |
|
|
|
Hi,
I need generate header .h, and need access parameters in my model, get its value and its name, ex: In my model haves 2 part BMD and EPC, BMD contains definition of 'parameter'(name; type int, enum, string..; range; description), EPC map and set value for it. This model is result when I create by AUTOSAR project in Artop
In my opinion, model is structure of some things insist of its definition and its value and xpand or acceleo is template that can access to these things and organize them follow the way we want(header file, html file ...). Do I misunderstand any important point?
Thanks
|
|
|
|
|
Re: [XPand] Apply oaw to xpand project error [message #956116 is a reply to message #937708] |
Wed, 24 October 2012 08:52   |
Eclipse User |
|
|
|
Hi Christian,
Can you give me a brief direction or some details reference source for your above code
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" platformUri="..">
<registerGeneratedEPackage value="autosar40.util.Autosar40Package" />
<extensionMap>
<from value="arxml" />
<to value="autosar40.util.Autosar40ResourceFactoryImpl" />
</extensionMap>
</bean>
I don't understand all tab in <bean> like: registerGeneratedEPackage, extensionMap tab
Thanks
|
|
|
|
|