Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » [OCLinEcore] definition of operation works in OCL console, but not in other modules like Acceleo
[OCLinEcore] definition of operation works in OCL console, but not in other modules like Acceleo [message #559009] Wed, 15 September 2010 10:15 Go to next message
Simon harrer is currently offline Simon harrerFriend
Messages: 25
Registered: August 2010
Junior Member
Hello,

I have created an operation at a Class like:
class Namespace {
   attribute prefix : String;
   attribute fully : String;
   
   operation asString() : String {
        body: prefix.concat(':').concat(fully);
    }
}


This method works only in the OCL console. But not in other systems that use the same EMF model. How can this be? Do I have to generate the code in another way to make these operations work?

Best regards,
Simon
Re: [OCLinEcore] definition of operation works in OCL console, but not in other modules like Acceleo [message #559607 is a reply to message #559009] Fri, 17 September 2010 11:31 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4150
Registered: July 2009
Senior Member
Hi Simon

The support for OCL delegates was introduced at Helios M6 and should
work provided appropriate registrations are in place which should happen
automatically.

However there a variety of ways of using EMF that not all modeling
projects support consistently.

Please make clear exactly how you were using your model and exactly how
you were invoking some other system, so that we can pinpoint the
troublesome combination.

Regards

Ed Willink


On 15/09/2010 11:15, Simon harrer wrote:
> Hello,
>
> I have created an operation at a Class like:
>
> class Namespace {
> attribute prefix : String;
> attribute fully : String;
> operation asString() : String {
> body: prefix.concat(':').concat(fully);
> }
> }
>
>
> This method works only in the OCL console. But not in other systems that
> use the same EMF model. How can this be? Do I have to generate the code
> in another way to make these operations work?
>
> Best regards,
> Simon
Re: [OCLinEcore] definition of operation works in OCL console, but not in other modules like Acceleo [message #559631 is a reply to message #559009] Fri, 17 September 2010 13:07 Go to previous message
Simon harrer is currently offline Simon harrerFriend
Messages: 25
Registered: August 2010
Junior Member
Thanks for the information. It directed me to the delegation registration code you provided earlier and is stated also here: http://wiki.eclipse.org/MDT/OCLinEcore#Standalone

I just had to add the code before the transformation/loading of the EMF resource. Then, everything worked smoothly.
Previous Topic:Error using String.toLowerCase(): Cannot find operation
Next Topic:count words or spaces in a string
Goto Forum:
  


Current Time: Sun Nov 23 03:49:38 GMT 2014

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

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