Code generated from UML with OCL [message #625543] |
Fri, 16 November 2007 20:22 |
Lutz Wrage Messages: 181 Registered: July 2009 |
Senior Member |
|
|
Today I tried to generate code from a metamodel defined in UML. I ran
into a problem when I added OCL expressions that contain line breaks.
The code generator doesn't handle this well because I ended up with
invalid Java code. Here's what I get when generating code for class
Namespace from the UML metamodel.
String ...__EOCL_EXP = "result = self.member->forAll( memb |
self.member->excluding(memb)->forAll(other |
memb.isDistinguishableFrom(other, self)))";
The OCL expression is copied into the Java file as is including line
breaks, which leads to compile errors. Is this a bug, or is there a way
to get the code generator to strip line breaks from OCL expressions? If
possible, I would like to keep the OCL in my metamodel formatted for
better readability.
I use Eclipse 3.3.0, UML2 2.1.1, EMF 2.3.1.
Thanks,
Lutz
|
|
|
Powered by
FUDForum. Page generated in 1.84658 seconds