Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Can trigger a method call for an attribute change in an EMF model?
Can trigger a method call for an attribute change in an EMF model? [message #1059569] Mon, 20 May 2013 10:07 Go to next message
Kosala Yapa is currently offline Kosala Yapa
Messages: 134
Registered: September 2010
Senior Member
Hi there,

Can I trigger a method call for an attribute change in an EMF model?

I need to call a validation method for an EMF attribute change. I am just wondering, if this type of functionality is possible with EMF models?

Any idea/help is appreciated.

Cheers,
Kosala
Re: Can trigger a method call for an attribute change in an EMF model? [message #1059586 is a reply to message #1059569] Mon, 20 May 2013 11:33 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 24570
Registered: July 2009
Senior Member
Kosala,

You can add an adapter to any EObject and listen for changes. Your
question is without much context though. What will this validation do?
How is the result of the validation used in the tool?


On 20/05/2013 4:07 PM, Kosala Yapa wrote:
> Hi there,
>
> Can I trigger a method call for an attribute change in an EMF model?
>
> I need to call a validation method for an EMF attribute change. I am
> just wondering, if this type of functionality is possible with EMF
> models?
>
> Any idea/help is appreciated.
>
> Cheers,
> Kosala
Re: Can trigger a method call for an attribute change in an EMF model? [message #1060728 is a reply to message #1059586] Tue, 28 May 2013 05:19 Go to previous messageGo to next message
Kosala Yapa is currently offline Kosala Yapa
Messages: 134
Registered: September 2010
Senior Member
Hi Ed,

Thanks.

Attribute changes in an EMF model need to trigger OCL rules validation. OCL rules validate EMF model for changed attributes, and error results(if available) are displayed on the tool.

Cheers,
Kosala
Re: Can trigger a method call for an attribute change in an EMF model? [message #1060769 is a reply to message #1060728] Tue, 28 May 2013 07:50 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 24570
Registered: July 2009
Senior Member
Kosala,

The latest version of EMF supports generating a live validator that will
revalidate all the instrinct constraints in the model after each command
stack execution. It's possible to expression such constraints using
OCL; you can look at that project's documentation.


On 28/05/2013 11:19 AM, Kosala Yapa wrote:
> Hi Ed,
>
> Thanks.
>
> Attribute changes in an EMF model need to trigger OCL rules
> validation. OCL rules validate EMF model for changed attributes, and
> error results(if available) are displayed on the tool.
>
> Cheers,
> Kosala
Previous Topic:define getter of derived volatile attribute
Next Topic:[CDO] ArrayIndexOutOfBoundsException on rollback
Goto Forum:
  


Current Time: Tue May 28 11:40:01 EDT 2013

Powered by FUDForum. Page generated in 0.01692 seconds