Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Code generated from UML with OCL
Code generated from UML with OCL [message #625543] Fri, 16 November 2007 20:22
Lutz Wrage is currently offline Lutz WrageFriend
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
Previous Topic:Generalization of an Aggregation
Next Topic:Code generated from UML with OCL
Goto Forum:
  


Current Time: Fri Apr 19 19:55:32 GMT 2024

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

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

Back to the top