| 
| constraint's severity [message #29042] | Thu, 21 June 2007 02:13  |  | 
| Eclipse User  |  |  |  |  | Originally posted by: asma.charfi.com 
 Hi,
 
 I created a  plugin that  validate my UML model(when I right click at
 element it validate all constraints even those defined in abstract
 stereotype and defined in the sub-elements) but my boss want that I
 associate a severety to my constraints (errors,warning...)
 in this case, should I use the emf validation (to graft my code in the
 validate method of the OCLUMLconstraint class) or I can make it all alone in
 my plugin?
 another question:
 I can see that we can associate a severety to one constraint when defining
 it in plugin.xml
 but if we have many constraints, should we create a constraint provider to
 each one (cause I want a different message for each invalide constraint)
 (my boss want me to use emf validation cause it's developped by eclipse team
 although my plugin is working :-(((
 
 thanks
 asma
 |  |  |  | 
| 
| Re: constraint's severity [message #29151 is a reply to message #29042] | Thu, 21 June 2007 06:38   |  | 
| Eclipse User  |  |  |  |  | Originally posted by: cdamus.ca.ibm.com 
 Hi, Asma,
 
 If I recall correctly, you are defining Constraints on Stereotypes in
 Profiles.  A "UML-ish" way to solve your problem might be to tag these
 Constraints with severities and error messages using a Stereotype with
 suitable properties, in a Profile that you apply to your Profiles
 containing your constraints.  Profiles are a kind of Package, so you can
 apply Profiles to them for the purpose of stereotyping elements (such as
 constraints) within them.  You could even use UML2's new capability of
 statically defining profiles to define a convenient Java API (like any
 other EPackage) for your constraint evaluation to find the severity and
 the error message that it needs when reporting problems.
 
 If you want to hook your support for validating the constraints of applied
 stereotypes into the EMF Validation framework, then you can implement a
 custom constraint provider after the fashion of the example in the
 org.eclipse.emf.validation.examples.ocl plug-in.  It gets OCL constraints
 from a *.ocl text file; yours would just find them on the stereotypes as
 you are doing now.
 
 Cheers,
 
 Christian
 
 
 charfi asma wrote:
 
 > Hi,
 
 > I created a  plugin that  validate my UML model(when I right click at
 > element it validate all constraints even those defined in abstract
 > stereotype and defined in the sub-elements) but my boss want that I
 > associate a severety to my constraints (errors,warning...)
 >  in this case, should I use the emf validation (to graft my code in the
 > validate method of the OCLUMLconstraint class) or I can make it all alone in
 > my plugin?
 > another question:
 > I can see that we can associate a severety to one constraint when defining
 > it in plugin.xml
 > but if we have many constraints, should we create a constraint provider to
 > each one (cause I want a different message for each invalide constraint)
 > (my boss want me to use emf validation cause it's developped by eclipse team
 > although my plugin is working :-(((
 
 > thanks
 > asma
 |  |  |  | 
|  | 
| 
| Re: constraint's severity [message #30076 is a reply to message #29302] | Mon, 25 June 2007 15:46  |  | 
| Eclipse User  |  |  |  |  | Originally posted by: cdamus.ca.ibm.com 
 Hi, Asma,
 
 You can use the examples provided with the EMF Validation Framework SDK to
 study how the framework functions and as guides to implementing your own
 solutions.  However, this code is copyright, so you should probably check
 with your lawyers about conditions on actually modifying this code and
 redistributing it in your company's products.
 
 Having said that, you are mostly correct:  understanding this example code
 and modifying it to extract constraints from the profile instead of a *.ocl
 file is sufficient, but is not necessary  :-)  You can always write your
 own code that does pretty much the same thing, in the end.
 
 Cheers,
 
 Christian
 
 
 charfi asma wrote:
 
 > Hi christian,
 >
 > stereotyping constraints is a good idea and I like it very much! but I
 > have to use EMF validation first.
 >
 > to use emf validation, and if I understood well, it is then enough to
 > understand the 4 classes that are in
 > org.eclipse.emf.validation.examples.ocl and to modify them to be able to
 > extract the constraints from the profile instead of the fichier.ocl?
 > if it is that, then I will start by using this method.
 > thank youChristian
 >
 > "Christian W. Damus" <cdamus@ca.ibm.com> a �rit dans le message de news:
 > 6d7dbe8d750b88b40a2515ce4a4c3e6d$1@www.eclipse.org...
 >> Hi, Asma,
 >>
 >> If I recall correctly, you are defining Constraints on Stereotypes in
 >> Profiles.  A "UML-ish" way to solve your problem might be to tag these
 >> Constraints with severities and error messages using a Stereotype with
 >> suitable properties, in a Profile that you apply to your Profiles
 >> containing your constraints.  Profiles are a kind of Package, so you can
 >> apply Profiles to them for the purpose of stereotyping elements (such as
 >> constraints) within them.  You could even use UML2's new capability of
 >> statically defining profiles to define a convenient Java API (like any
 >> other EPackage) for your constraint evaluation to find the severity and
 >> the error message that it needs when reporting problems.
 >>
 >> If you want to hook your support for validating the constraints of
 >> applied stereotypes into the EMF Validation framework, then you can
 >> implement a custom constraint provider after the fashion of the example
 >> in the
 >> org.eclipse.emf.validation.examples.ocl plug-in.  It gets OCL constraints
 >> from a *.ocl text file; yours would just find them on the stereotypes as
 >> you are doing now.
 >>
 >> Cheers,
 >>
 >> Christian
 >>
 >>
 >> charfi asma wrote:
 >>
 >>> Hi,
 >>
 >>> I created a  plugin that  validate my UML model(when I right click at
 >>> element it validate all constraints even those defined in abstract
 >>> stereotype and defined in the sub-elements) but my boss want that I
 >>> associate a severety to my constraints (errors,warning...)
 >>>  in this case, should I use the emf validation (to graft my code in the
 >>> validate method of the OCLUMLconstraint class) or I can make it all
 >>> alone in my plugin?
 >>> another question:
 >>> I can see that we can associate a severety to one constraint when
 >>> defining it in plugin.xml
 >>> but if we have many constraints, should we create a constraint provider
 >>> to each one (cause I want a different message for each invalide
 >>> constraint)
 >>> (my boss want me to use emf validation cause it's developped by eclipse
 >>> team although my plugin is working :-(((
 >>
 >>> thanks
 >>> asma
 >>
 |  |  |  | 
Powered by 
FUDForum. Page generated in 0.04004 seconds