Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Sapphire » Dynamic Validation(Attaching Validations at Def level)
Dynamic Validation [message #753822] Sat, 29 October 2011 00:08 Go to next message
Kamesh Sampath is currently offline Kamesh SampathFriend
Messages: 213
Registered: July 2009
Senior Member
I have scenario where the model definitions are reused via standard Java OOPS concepts.

So ideally in this scenario is not possible for me to attach a common validation Service for a property @ model level as that will will make it common for all.

So what i want is to attach the validations @ SDEF level, where in can define Sapphire EL based validations or Validation Service, that gets triggers only for that property instance similar to how we define actions/handlers @ property level in SDEF.

Is it possible right now ? If not can we have this feature included ?
Re: Dynamic Validation [message #753859 is a reply to message #753822] Sat, 29 October 2011 15:40 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
Validation is squarely in the domain of the model. I don't see allowing it at the sdef level.

Keep in mind that your ValidationService can be context aware, so you can make it abort validation and return ok if certain environmental state is detected or even apply different logic depending on the situation. Another option is to use model element extension. If model element B extends model element A, then B can supplement metadata on A's properties, including attaching additional services. If you went this route, you would instantiate A in one context and B in the other.

- Konstantin
Re: Dynamic Validation [message #753862 is a reply to message #753859] Sat, 29 October 2011 15:52 Go to previous messageGo to next message
Kamesh Sampath is currently offline Kamesh SampathFriend
Messages: 213
Registered: July 2009
Senior Member
That's nice! that's exactly i wanted, if i am able to supplement the metadata in the extended models then in don't really see the dyna validation ..

Is there any samples in the plugins samples where i can look in for the metadata substitution ? if not can you please explain how to do that with an sample ?

~Kamesh
Re: Dynamic Validation [message #753872 is a reply to message #753862] Sat, 29 October 2011 17:48 Go to previous message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
There are several examples available. One is IHelpGallery/IExtendedHelpGallery in the samples project. In that example, documentation is being supplemented in the extending element, but you can do the same thing with service attachments.

- Konstantin
Previous Topic:Model Refresh
Next Topic:Sapphire Seralization
Goto Forum:
  


Current Time: Tue Apr 23 08:19:40 GMT 2024

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

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

Back to the top