Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Property validation rules
Property validation rules [message #1769944] Sun, 06 August 2017 18:29 Go to next message
sonny selhorst is currently offline sonny selhorstFriend
Messages: 60
Registered: May 2015
Member
Dear,

I am trying to add a property validation rule, but it isn't working. I have added the property as a Target. Is it correct if I refer to it as 'self' in order to audit it?

It's quite simple: an element in my metamodel has a cardinality (EString), which can only be a positive integer or *, which means it's unbounded.

If a user enters a negative number, it displays an error upon validation that the cardinality must be a number larger than 0 or unbounded.

I tried aql:self=* or self.toInteger()>0 but it doesn't display any error in my diagram.

Thank you in advance,

Kind regards,
Sonny
Re: Property validation rules [message #1770018 is a reply to message #1769944] Mon, 07 August 2017 14:45 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane BegaudeauFriend
Messages: 458
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi,

In your situation, self will be the semantic element defined by the semantic candidate expression of the group. It is the same "self" as in the valueExpression of your widget.

Regards,

Stephane Begaudeau, Obeo
Re: Property validation rules [message #1770019 is a reply to message #1769944] Mon, 07 August 2017 14:47 Go to previous messageGo to next message
Florian Barbin is currently offline Florian BarbinFriend
Messages: 270
Registered: August 2010
Senior Member
Hi Sonny,

In that case the self variable will reference the semantic element, not the property.

Regards,

Florian
Re: Property validation rules [message #1770036 is a reply to message #1770019] Mon, 07 August 2017 16:12 Go to previous messageGo to next message
sonny selhorst is currently offline sonny selhorstFriend
Messages: 60
Registered: May 2015
Member
Thank you very much, I was able to solve the problem.

Have a great day!
Re: Property validation rules [message #1856242 is a reply to message #1770036] Tue, 29 November 2022 09:50 Go to previous message
Denis Nikiforov is currently offline Denis NikiforovFriend
Messages: 346
Registered: August 2013
Senior Member
Hi

Is it possible to get and validate an input text of a widget?

For example, how can I display a validation error, if a user entered a wrong value for a numeric attribute?
Previous Topic:[ANN] Sirius 7.0.6
Next Topic:How to add new PaletteToolEntry to PaletteToolBar?
Goto Forum:
  


Current Time: Wed Dec 11 11:08:34 GMT 2024

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

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

Back to the top