Home » Modeling » EMF » EOperation at runtime
| | | | | |
Re: EOperation at runtime [message #423231 is a reply to message #423221] |
Thu, 25 September 2008 10:38 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
Sam,
Comments below.
Sam Julian wrote:
> Hi, Ed,
>
> Shame on me, Sorry :-) . I try to explain my problem.
> the aim is to augment the intrinsic Validation of the generated Ecore
> Model, let us call this Model "A".for this purpose I have provide
> several external Validation Methodes.
Not sure what such external methods are...
> These Validation methodes are based on a extrinsic
> Rules-Validation-Framework,let us call that Model "B". B is also based
> on Ecore. B shall verify the Data integrity of in "A". the question
> is: How to inject, at runtime, generated validator facility of B in A
> , without take any manupulating on the Ecore Model of A? by the way
> the EMF Validation Framework is inapplicable in my use case.
Yet the validation framework is defined for exactly this purpose.
Given that nothing in EMF does exactly what you want, you'll just need
to code something yourself. I could imagine defining an
""ExtendedConstraints" constraint on each classifier in A and
implementing those methods to invoke rules from some type of rule engine
that B plugs into. Again, the EMF validation framework is defined for
exactly this type of purpose, but if it doesn't seem to fit, you'll need
to implement your own framework.
> Sam
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: EOperation at runtime [message #423243 is a reply to message #423231] |
Thu, 25 September 2008 12:20 |
Sam Julian Messages: 29 Registered: July 2009 |
Junior Member |
|
|
Hi, Ed,
Yet the validation framework is defined for exactly this purpose.
1-I agree with you, but it dosenŽt fit to my requirement. I discuss this
also with Christian Damus.
Given that nothing in EMF does exactly what you want, you'll just need to
code something yourself.
2- I am your opinion, that is what already I have done.
----
I could imagine defining an ""ExtendedConstraints" constraint on each
classifier in A and implementing those methods to invoke rules from some
type of rule engine that B plugs into.
3- i defined the "ExtendedConstraints" in Model B and the rules engine.
what i am missing, is something releated to the EMF Idea of code
generation, that could be similar to:
EValidator validator =
EValidator.Registry.INSTANCE.getEValidator(dataType.eClass() .getEPackage());
for the moment i have a work around doing so:
aHelperBean.setExtendedConstraintsValidator(RulesWrapperConf igFactory.eINSTANCE
.createValidatorType());
this will create for each EDataType a validator Methode, provided by the
rule engine.
-------
Again, the EMF validation framework is defined for exactly this type of
purpose, but if it doesn't seem to fit, you'll need to implement your own
framework.
4- I need to define Constraint on EDataType Not on EClass. this need a
fine grained constaint Binding to the required EDataType.
----
Thanks for the support!!
Sam
|
|
|
Re: EOperation at runtime [message #423244 is a reply to message #423243] |
Thu, 25 September 2008 12:35 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
Sam,
Comments below.
Sam Julian wrote:
> Hi, Ed,
>
> Yet the validation framework is defined for exactly this purpose.
> 1-I agree with you, but it dosenŽt fit to my requirement. I discuss
> this also with Christian Damus.
I vaguely to recall such an exchange.
>
> Given that nothing in EMF does exactly what you want, you'll just need
> to code something yourself.
> 2- I am your opinion, that is what already I have done.
> ----
> I could imagine defining an ""ExtendedConstraints" constraint on each
> classifier in A and implementing those methods to invoke rules from
> some type of rule engine that B plugs into.
> 3- i defined the "ExtendedConstraints" in Model B and the rules
> engine. what i am missing, is something releated to the EMF Idea of
> code generation, that could be similar to:
>
> EValidator validator =
> EValidator.Registry.INSTANCE.getEValidator(dataType.eClass() .getEPackage());
>
> for the moment i have a work around doing so:
>
> aHelperBean.setExtendedConstraintsValidator(RulesWrapperConf igFactory.eINSTANCE
>
> .createValidatorType());
>
> this will create for each EDataType a validator Methode, provided by
> the rule engine. ------- Again, the EMF validation framework is
> defined for exactly this type of purpose, but if it doesn't seem to
> fit, you'll need to implement your own framework.
> 4- I need to define Constraint on EDataType Not on EClass. this need a
> fine grained constaint Binding to the required EDataType.
I mentioned defining them on each classifier, where both EDataTypes and
EClasses are classifiers. Maybe you could override
EObjectValidator.validate_DataValueConforms to enforce the extra
constraints you've associated with the data types...
> ----
>
> Thanks for the support!!
> Sam
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Goto Forum:
Current Time: Wed Apr 24 21:17:28 GMT 2024
Powered by FUDForum. Page generated in 0.05009 seconds
|