Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » audit rule doesn't work
audit rule doesn't work [message #198472] Wed, 23 July 2008 06:30 Go to next message
yeliu is currently offline yeliuFriend
Messages: 145
Registered: July 2009
Senior Member
Hello,
I have added audit rule according to instructions in GMF tutorial 3.But
it doesn't work.
My case:I want the node Kernel can have only 1 incoming arrow and 1
outgoing arrow.so I add OCL in Constraint liks this:
self.incoming->size() and self.outgoing->size()=1
and set the the right properties related Validation in .gmfgen.
What's do you think is the problem?


Many thanks!


Ye
Re: audit rule doesn't work [message #198496 is a reply to message #198472] Wed, 23 July 2008 09:40 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Ye,

try (self.incoming->size() = 1) and (self.outgoing->size() = 1)

-----------------
Alex Shatalin
Re: audit rule doesn't work [message #198577 is a reply to message #198496] Wed, 23 July 2008 13:31 Go to previous messageGo to next message
yeliu is currently offline yeliuFriend
Messages: 145
Registered: July 2009
Senior Member
Hello Alex,
However, this still doesn't work.Where else can be the reason?



Thanks a lot!


Ye
Re: audit rule doesn't work [message #198600 is a reply to message #198577] Wed, 23 July 2008 13:53 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Ye,

Try placing a breakpoint into the appropriate place in a code to see if constraint
was actually violated for any passed parameters..

-----------------
Alex Shatalin
Re: audit rule doesn't work [message #198622 is a reply to message #198472] Wed, 23 July 2008 14:12 Go to previous messageGo to next message
Armando is currently offline ArmandoFriend
Messages: 12
Registered: July 2009
Junior Member
Ye Liu <yeliu@abo.fi> ha scritto:

> Hello,
> I have added audit rule according to instructions in GMF tutorial 3.But
> it doesn't work.
> My case:I want the node Kernel can have only 1 incoming arrow and 1
> outgoing arrow.so I add OCL in Constraint liks this:
> self.incoming->size() and self.outgoing->size()=1
> and set the the right properties related Validation in .gmfgen.
> What's do you think is the problem?

Hi Ye Liu. IMO Alex wrote the constraint you need in the right form... so,
it's hard to understand where the problem is. What do you mean by "it
doesn't work"? What's the way you run your plugins?

--
The wind in my heart
The dust in my head
Re: audit rule doesn't work [message #198773 is a reply to message #198622] Thu, 24 July 2008 09:18 Go to previous messageGo to next message
yeliu is currently offline yeliuFriend
Messages: 145
Registered: July 2009
Senior Member
Hello,
By 'It doesn't work' I mean,when I regenerate the .gmfgen file,then
generate the diagram package.And run the Eclipse application,the node
Kernel still can be connected by more than one incoming channels and
outgoing channels.



Ye
Re: audit rule doesn't work [message #198911 is a reply to message #198600] Fri, 25 July 2008 08:29 Go to previous messageGo to next message
yeliu is currently offline yeliuFriend
Messages: 145
Registered: July 2009
Senior Member
Hello,
I can't find a right way to set the breakpoint.But rather I found the
extension points in the plugin.xml in the diagram code a little bit
different from the GMF tutorial.The item under clientContext is selector
instead of enablement.I wonder if this show clue to the problem.
-----------------------------------------------------------
org.eclipse.emf.validation.constraintProviders
org.eclipse.emf.validation.constraintBindings
-com.eclipse.xxx.diagram.DefaultCtx(clientContext)
--com.eclipse.xxx.diagram.providers.xxxValidationProvider$De faultCtx1(selector)



Many thanks!

ye
Re: audit rule doesn't work [message #198984 is a reply to message #198911] Fri, 25 July 2008 12:55 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

Hi, Ye,

The <selector> element is nothing but a Java alternative to the XML
expression of the <enablement> element. They are mutually exclusive and
serve the same function.

Luckily for you, the <selector> is easier to debug because you just put
a breakpoint in the referenced class :-)

Cheers,

Christian

Ye Liu wrote:
> Hello,
> I can't find a right way to set the breakpoint.But rather I found the
> extension points in the plugin.xml in the diagram code a little bit
> different from the GMF tutorial.The item under clientContext is selector
> instead of enablement.I wonder if this show clue to the problem.
> -----------------------------------------------------------
> org.eclipse.emf.validation.constraintProviders
> org.eclipse.emf.validation.constraintBindings
> -com.eclipse.xxx.diagram.DefaultCtx(clientContext)
> --com.eclipse.xxx.diagram.providers.xxxValidationProvider$De faultCtx1(selector)
>
>
>
>
> Many thanks!
>
> ye
>
Previous Topic:Saving in XML
Next Topic:configure palette dynamically
Goto Forum:
  


Current Time: Sat Jun 06 12:06:15 GMT 2020

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

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

Back to the top