Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » [Complete OCL] Change OCL file for validation per editor instance?
[Complete OCL] Change OCL file for validation per editor instance? [message #665859] Sun, 17 April 2011 10:43 Go to next message
Joern is currently offline JoernFriend
Messages: 22
Registered: March 2010
Junior Member
Hi,

Reading the excellent slides from Ed and Axel at the EclipseCon ( https://www.eclipsecon.org/submissions/2011/view_talk.php?id =2271) I stumbled upon the chapter on external Complete OCL validation for a Xtext editor.

Without digging to deep myself, I was wandering, whether it is possible to change the (Complete) OCL file that is used for validation in a generated Xtext editor per editor instance (instead of registering them in the OCL Model Registry for all instances).

A sample use case would be a statement in the edited model (e.g. in the editor generated for states.ecore in the workshop examples):

--> snip <--
module "simple.states"
validation "states.ocl"
[...]
--> snap <--

Any comments or directions are welcome.

Best regards

Joern
Re: [Complete OCL] Change OCL file for validation per editor instance? [message #665862 is a reply to message #665859] Sun, 17 April 2011 13:23 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Joern

Certainly possible.

'validation' is a syntax in your grammar so you can support a Complete
OCL reference.

You then just need the generated Java validator to inoke the validation.
The CompleteOclEObjectValidator does this. You just need to parameterize
the resource.

Regards

Ed Willink

On 17/04/2011 11:43, Joern wrote:
> Hi,
>
> Reading the excellent slides from Ed and Axel at the EclipseCon
> ( https://www.eclipsecon.org/submissions/2011/view_talk.php?id =2271) I
> stumbled upon the chapter on external Complete OCL validation for a
> Xtext editor.
>
> Without digging to deep myself, I was wandering, whether it is
> possible to change the (Complete) OCL file that is used for validation
> in a generated Xtext editor per editor instance (instead of
> registering them in the OCL Model Registry for all instances).
> A sample use case would be a statement in the edited model (e.g. in
> the editor generated for states.ecore in the workshop examples):
>
> --> snip <--
> module "simple.states"
> validation "states.ocl"
> [...]
> --> snap <--
>
> Any comments or directions are welcome.
>
> Best regards
>
> Joern
Re: [Complete OCL] Change OCL file for validation per editor instance? [message #665876 is a reply to message #665862] Sun, 17 April 2011 19:37 Go to previous message
Axel Uhl is currently offline Axel UhlFriend
Messages: 41
Registered: July 2009
Member
Joern,

also, it's always good to keep in mind that validating the objects contained in the resource(s) you're editor/editing domain is operating on is only the tip of the iceberg. As soon as you have cross-resource references and OCL constraints navigating such references, you may have to validate other resources too.

Should that be the case, you may want to check out the new OCL Impact Analyzer available since Ingido M6 in the OCL Editors and Examples feature. See org.eclipse.ocl.examples.impactanalyzer.ImpactAnalyzerFactor y for a starting point.

Best,
-- Axel
Previous Topic:Permanent violation of invariants after closing and opening the validated file
Next Topic:Property derivation using If then else
Goto Forum:
  


Current Time: Thu Apr 25 10:20:45 GMT 2024

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

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

Back to the top