Skip to main content



      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 06:15 Go to next message
Eclipse UserFriend
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 07:31 Go to previous messageGo to next message
Eclipse UserFriend
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 09:07 Go to previous message
Eclipse UserFriend
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: Fri Jul 25 00:30:40 EDT 2025

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

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

Back to the top