I thought I'd give this one more try, and was *really* excited because I
finally got the syntax errors to go away. I found the oAW sample that does
this.
The original ext file:
oaw_v4\samples\samples.emfSM41\oaw4.demo.emf.statemachine.generator\src\trafo.ext
The advice file:
oaw_v4\samples.42\schulung\schulung.generator-v2\src\toEnglish.ext
Here's what I have now:
import sculptordsl;
import sculptormetamodel;
extension transformation::DslTransformation;
/**
* Add extra fields and constants to Entity. Get values from Dsl object.
*/
around transformation::DslTranformation::transform(DslEntity domainObject) :
let e = (Entity)ctx.proceed():
e.setA(domainObject.a) ->
e.setB(domainObject.b) ->
e.setC(domainObject.c) ->
e.setD(domainObject.d) ->
e.constants.addAll(domainObject.constants.transform()) -> e;
/**
* Define Constant. Get values from Dsl object.
*/
create sculptormetamodel::Constant this transform(DslConstant constant) :
setDoc(constant.doc) ->
setName(constant.name) ->
setValue(constant.value) ->
(constant.valueRef != null ?
setValueRef(constant.valueRef.transform()) :
null
);
That code makes sense now that I have it. But it looks like my advices
still aren't getting executed. The only place that I can set a breakpoint
is the create method for the constant, and that never gets hit.
My device is specified like this:
<component adviceTarget="dslTransformation"
class="oaw.xtend.XtendAdvice">
<extensionAdvice value="transformation::my::SpecialTransformation"
/>
</component>
The file path is specified correctly, because if you don't, the generator
throws an exception. I don't know why this isn't working. I should
probably just accept that this can't be done like I want for some mysterious
reason, but this code looks just like the oAW example! It's taunting me.
If anybody has any insight, I'd really appreciate it!
Thanks,
Polly
amphoras wrote:
>
> ah, I see what you're saying. Yes, that is true. I have not added new
> fields to every class. Maybe it's not so bad then.
>
> Thanks,
> Polly
>
>
>
>
--
View this message in context:
http://www.nabble.com/-Sculptor--Using-AOP-on-DslTransformation.ext-tp18968553s17564p18988236.html
Sent from the Fornax-Platform mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Fornax-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fornax-developer