Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » EMFForms Validation using Complete OCL(How can OCL rules be used with EMForms?)
EMFForms Validation using Complete OCL [message #1692187] Tue, 14 April 2015 08:33 Go to next message
Uwe San is currently offline Uwe SanFriend
Messages: 119
Registered: January 2012
Senior Member
Hi,

I haven't been able to find a tutorial on using validation rules defined in Complete OCL with EMFForms. Can OCL be used with EMFForms?

I have a small application showing a tree editor generated by EMF and a forms view generated by EMFForms. Since my application loads the OCL bundles, the tree editor's context menu allows me to load an OCL document and to trigger a validation such that I can see the validation markers on the tree items. Unfortunately, no markers appear on the form elements.

Do I need to trigger the validator separately for the form view in this example?

Thanks,
Uwe
Re: EMFForms Validation using Complete OCL [message #1692193 is a reply to message #1692187] Tue, 14 April 2015 08:51 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6629
Registered: July 2009
Senior Member
Hi

You might try OCL->Validate which does a bit of extra validation when
the default Diagnostician fails to extend. This is usually just for UML.

If the markers appear on the tree items, it is probably a bug if the
Forms do not show them where they should also be shown.

Try posting a full example otherwise you fall between two teams each of
which will expect the other to respond.

Regards

Ed Willink


On 14/04/2015 09:33, Uwe San wrote:
> Hi,
>
> I haven't been able to find a tutorial on using validation rules
> defined in Complete OCL with EMFForms. Can OCL be used with EMFForms?
>
> I have a small application showing a tree editor generated by EMF and
> a forms view generated by EMFForms. Since my application loads the OCL
> bundles, the tree editor's context menu allows me to load an OCL
> document and to trigger a validation such that I can see the
> validation markers on the tree items. Unfortunately, no markers appear
> on the form elements.
>
> Do I need to trigger the validator separately for the form view in
> this example?
>
> Thanks,
> Uwe
Re: EMFForms Validation using Complete OCL [message #1692366 is a reply to message #1692193] Wed, 15 April 2015 10:57 Go to previous messageGo to next message
Uwe San is currently offline Uwe SanFriend
Messages: 119
Registered: January 2012
Senior Member
Hi,

thanks for your reply.

Running OCL->Validate did not have any effect.

Please find a full example in the attached zip file. You can run the sample application contained in the oclemfforms.sampleapp project, create a new project and a new Sample model element using the wizards.

There is an OCL file in the resources directory of the oclemfforms.sampleapp project which you can load into the application in order to test the validation mechanism. You should see a warning marker on a model element with an empty description attribute. Note that there is no marker in either of the two for editors.

Thanks for your assistance. I'd appreciate your feedback.

Regards,
Uwe
Re: EMFForms Validation using Complete OCL [message #1692381 is a reply to message #1692366] Wed, 15 April 2015 12:12 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6629
Registered: July 2009
Senior Member
Hi

On 15/04/2015 11:57, Uwe San wrote:
> Hi,
>
> thanks for your reply.
>
> Running OCL->Validate did not have any effect.
>
> Please find a full example in the attached zip file. You can run the sample application contained in the oclemfforms.sampleapp project, create a new project and a new Sample model element using the wizards.
>
Maybe I can, but so can you, and you will do it right.

I'm sorry I do not have time to debug vague instructions.

Provide a clear repro.

Regards

Ed Willink
Re: EMFForms Validation using Complete OCL [message #1692401 is a reply to message #1692366] Wed, 15 April 2015 13:27 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi,

I am not really familiar with the OCL integration here. EMF Forms uses
the default EMF validation mechnism. Does OCL push its results into it
or is the integration with the tree a custom extension?

Best regards

Jonas

Am 15.04.2015 um 12:57 schrieb Uwe San:
> Hi,
>
> thanks for your reply.
>
> Running OCL->Validate did not have any effect.
>
> Please find a full example in the attached zip file. You can run the sample application contained in the oclemfforms.sampleapp project, create a new project and a new Sample model element using the wizards.
>
> There is an OCL file in the resources directory of the oclemfforms.sampleapp project which you can load into the application in order to test the validation mechanism. You should see a warning marker on a model element with an empty description attribute. Note that there is no marker in either of the two for editors.
>
> Thanks for your assistance. I'd appreciate your feedback.
>
> Regards,
> Uwe
>


--
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: EMFForms Validation using Complete OCL [message #1692411 is a reply to message #1692401] Wed, 15 April 2015 13:52 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6629
Registered: July 2009
Senior Member
Hi

I think we're both 'standard', but without seeing a live example or even
a screenshot, I have no idea what is actually being reported.

My guess is that perhaps the EMF Forms knows where diagnostics occur and
so fails to spot those that appear from elsewhere into the Resource.errors.

Regards

Ed Willink



On 15/04/2015 14:27, Jonas Helming wrote:
> Hi,
>
> I am not really familiar with the OCL integration here. EMF Forms uses
> the default EMF validation mechnism. Does OCL push its results into it
> or is the integration with the tree a custom extension?
>
> Best regards
>
> Jonas
>
> Am 15.04.2015 um 12:57 schrieb Uwe San:
>> Hi,
>>
>> thanks for your reply.
>>
>> Running OCL->Validate did not have any effect.
>>
>> Please find a full example in the attached zip file. You can run the sample application contained in the oclemfforms.sampleapp project, create a new project and a new Sample model element using the wizards.
>>
>> There is an OCL file in the resources directory of the oclemfforms.sampleapp project which you can load into the application in order to test the validation mechanism. You should see a warning marker on a model element with an empty description attribute. Note that there is no marker in either of the two for editors.
>>
>> Thanks for your assistance. I'd appreciate your feedback.
>>
>> Regards,
>> Uwe
>>
>
Re: EMFForms Validation using Complete OCL [message #1692415 is a reply to message #1692381] Wed, 15 April 2015 14:14 Go to previous messageGo to next message
Uwe San is currently offline Uwe SanFriend
Messages: 119
Registered: January 2012
Senior Member
Hi Ed and Jonas,

here are the steps for reproduction:

  1. Import the four projects contained in the zip file into your Eclipse workspace.
  2. Open the SampleApp.product file in the oclemfforms.sampleapp project.
  3. Click on the "Launch an Eclipse application" link to run the sample application.
  4. Once the application is showing up, right-click in the Project Explorer and choose "New -> Project..."
  5. In the wizard, choose "General -> Project" and click on "Next".
  6. Enter any project name and click on "Finish" to close the wizard.
  7. Drag and drop the files My.sample and Sample.ocl from the resources directory of the oclemfforms.sampleapp project into the project you just created in the sample application.
  8. In the Project Explorer, double-click on the My.sample file. An editor should show up containing one object of type Element. Note that this object's description attribute is empty. You can see that by opening the "Enhanced Properties" view in the stacked view below the editor.
  9. Right-click on the Element object and choose "OCL -> Load Document" from the context menu.
  10. In the dialog, click on the "Browse Workspace..." button and pick the Sample.ocl file contained in the project you created in step 6.
  11. Right-click on the Element object again and choose "Validate" from the context menu. A validation should be triggered such that the Element object is decorated by a warning marker in the tree view.
  12. Look at the "Enhanced Properties" view and observe that there are no markers on any UI elements.


I hope these instructions will help you reproduce my problem. Let me know if you have any questions.

Thanks,
Uwe
Re: EMFForms Validation using Complete OCL [message #1692428 is a reply to message #1692415] Wed, 15 April 2015 15:45 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6629
Registered: July 2009
Senior Member
Hi

In my development workspace:


On 15/04/2015 15:14, Uwe San wrote:
> Hi Ed and Jonas,
>
> here are the steps for reproduction:
>
> Import the four projects contained in the zip file into your Eclipse
> workspace.
> Open the SampleApp.product file in the oclemfforms.sampleapp project.
> Click on the "Launch an Eclipse application" link to run the sample
> application.
java.lang.RuntimeException: No application id has been found.
at
org.eclipse.equinox.internal.app.EclipseAppContainer.startDefaultApp(EclipseAppContainer.java:242)
at
org.eclipse.equinox.internal.app.MainApplicationLauncher.run(MainApplicationLauncher.java:29)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)

On 15/04/2015 15:14, Uwe San wrote:
> Hi Ed and Jonas,
>
> here are the steps for reproduction:
>
> Import the four projects contained in the zip file into your Eclipse
> workspace.
> Open the SampleApp.product file in the oclemfforms.sampleapp project.
> Click on the "Launch an Eclipse application" link to run the sample
> application.
> Once the application is showing up, right-click in the Project
> Explorer and choose "New -> Project..."
> In the wizard, choose "General -> Project" and click on "Next".
> Enter any project name and click on "Finish" to close the wizard.
> Drag and drop the files My.sample and Sample.ocl from the resources
> directory of the oclemfforms.sampleapp project into the project you
> just created in the sample application.
> In the Project Explorer, double-click on the My.sample file. An editor
> should show up containing one object of type Element. Note that this
> object's description attribute is empty. You can see that by opening
> the "Enhanced Properties" view in the stacked view below the editor.
> Right-click on the Element object and choose "OCL -> Load Document"
> from the context menu.
> In the dialog, click on the "Browse Workspace..." button and pick the
> Sample.ocl file contained in the project you created in step 6.
> Right-click on the Element object again and choose "Validate" from the
> context menu. A validation should be triggered such that the Element
> object is decorated by a warning marker in the tree view.
> Look at the "Enhanced Properties" view and observe that there are no
> markers on any UI elements.
>
>
> I hope these instructions will help you reproduce my problem. Let me
> know if you have any questions.
>
> Thanks,
> Uwe
Re: EMFForms Validation using Complete OCL [message #1692429 is a reply to message #1692428] Wed, 15 April 2015 16:09 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6629
Registered: July 2009
Senior Member
Hi

Just spotted a Console Log full of errors.

You seem to require me to install all sorts of things I don't use.

m2e, jem, wst,

Please provide a more relevant example.

Regards

Ed Willink


On 15/04/2015 16:45, Ed Willink wrote:
> Hi
>
> In my development workspace:
>
>
> On 15/04/2015 15:14, Uwe San wrote:
>> Hi Ed and Jonas,
>>
>> here are the steps for reproduction:
>>
>> Import the four projects contained in the zip file into your Eclipse
>> workspace.
>> Open the SampleApp.product file in the oclemfforms.sampleapp project.
>> Click on the "Launch an Eclipse application" link to run the sample
>> application.
> java.lang.RuntimeException: No application id has been found.
> at
> org.eclipse.equinox.internal.app.EclipseAppContainer.startDefaultApp(EclipseAppContainer.java:242)
> at
> org.eclipse.equinox.internal.app.MainApplicationLauncher.run(MainApplicationLauncher.java:29)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:497)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
>
> On 15/04/2015 15:14, Uwe San wrote:
>> Hi Ed and Jonas,
>>
>> here are the steps for reproduction:
>>
>> Import the four projects contained in the zip file into your Eclipse
>> workspace.
>> Open the SampleApp.product file in the oclemfforms.sampleapp project.
>> Click on the "Launch an Eclipse application" link to run the sample
>> application.
>> Once the application is showing up, right-click in the Project
>> Explorer and choose "New -> Project..."
>> In the wizard, choose "General -> Project" and click on "Next".
>> Enter any project name and click on "Finish" to close the wizard.
>> Drag and drop the files My.sample and Sample.ocl from the resources
>> directory of the oclemfforms.sampleapp project into the project you
>> just created in the sample application.
>> In the Project Explorer, double-click on the My.sample file. An
>> editor should show up containing one object of type Element. Note
>> that this object's description attribute is empty. You can see that
>> by opening the "Enhanced Properties" view in the stacked view below
>> the editor.
>> Right-click on the Element object and choose "OCL -> Load Document"
>> from the context menu.
>> In the dialog, click on the "Browse Workspace..." button and pick the
>> Sample.ocl file contained in the project you created in step 6.
>> Right-click on the Element object again and choose "Validate" from
>> the context menu. A validation should be triggered such that the
>> Element object is decorated by a warning marker in the tree view.
>> Look at the "Enhanced Properties" view and observe that there are no
>> markers on any UI elements.
>>
>>
>> I hope these instructions will help you reproduce my problem. Let me
>> know if you have any questions.
>>
>> Thanks,
>> Uwe
>
Re: EMFForms Validation using Complete OCL [message #1692469 is a reply to message #1692429] Thu, 16 April 2015 06:25 Go to previous messageGo to next message
Uwe San is currently offline Uwe SanFriend
Messages: 119
Registered: January 2012
Senior Member
That's a pity. Do you have the EMFForms dependencies in your target platform or workspace?

The other dependencies you mentioned were unnecessary for the application, indeed. They were adding when I clicked "Add Required Plug-ins" in my product file. This mechanism seems to add more plug-ins than actually required. Sorry for that.

Please find attached an updated version of the projects. I hope the new product file relies only on plug-ins present in your target platform and/or workspace.

Thanks,
Uwe
Re: EMFForms Validation using Complete OCL [message #1692471 is a reply to message #1692469] Thu, 16 April 2015 06:31 Go to previous messageGo to next message
Uwe San is currently offline Uwe SanFriend
Messages: 119
Registered: January 2012
Senior Member
If you can't manage to run the sample application from your workspace, here's an executable version: https://www.dropbox.com/s/rpbo3l4bcfxpfwu/oclemfforms.zip?dl=0

Simply extract the ZIP file and double-click the eclipse.exe file to run the sample application.
Re: EMFForms Validation using Complete OCL [message #1692497 is a reply to message #1692469] Thu, 16 April 2015 09:13 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6629
Registered: July 2009
Senior Member
<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi<br>
<br>
My attempts to run in my development workspace were a disaster.
Using Luna 4.4.2 was better although I still had to remove four
seemingly redundant dependencies, and adjust the lower bounds on
EMF Forms to 1.5.0, and switch to Java 7.<br>
<br>
The I get something that seems to be what you are describing.<br>
<br>
<img src="https://www.eclipse.org/forums/index.php?t=getfile&amp;id=21559" alt=""><br>
<br>
It seems that OCL has done its job by installing a
ComposedEValidator in the EValidatorRegistry so that EMF includes
the additional Complete OCL validation within the normal
EValidation activities.<br>
<br>
I don't know whether EMF Forms should show a warning or not.<br>
<br>
If it should, then a possible reason is that EMF Forms is not
re-using the ResourceSet; to avoid accidental damage to innocent
applications sharing the only EValidatorRegistry, the
ComposedEValidator only composes in the ResourceSet for which
Complete OCL was loaded.<br>
<br>
NB. If you open the Problems View you will see that the warning
icon is missing. Perhaps EMF Forms is working fine but just
showing an invisible warning icon.<br>
<br>
    Regards<br>
<br>
        Ed Willink<br>
<br>
<br>
On 16/04/2015 07:25, Uwe San wrote:<br>
</div>
<blockquote cite="mid:mgnkku$uvj$1@xxxxxxxxe.org" type="cite">
<pre wrap="">That's a pity. Do you have the EMFForms dependencies in your target platform or workspace?

The other dependencies you mentioned were unnecessary for the application, indeed. They were adding when I clicked "Add Required Plug-ins" in my product file. This mechanism seems to add more plug-ins than actually required. Sorry for that.

Please find attached an updated version of the projects. I hope the new product file relies only on plug-ins present in your target platform and/or workspace.

Thanks,
Uwe
</pre>
</blockquote>
<br>
</body>
</html>
  • Attachment: fciiiahj.png
    (Size: 16.27KB, Downloaded 97 times)
Re: EMFForms Validation using Complete OCL [message #1692502 is a reply to message #1692497] Thu, 16 April 2015 09:36 Go to previous messageGo to next message
Uwe San is currently offline Uwe SanFriend
Messages: 119
Registered: January 2012
Senior Member
Hi Ed,

thanks for taking the time to analyse the problem. It seems like the problem is not on the OCL side so I hope someone from the EMFForms team will comment on this issue.

I don't think it's just a missing icon because as far as I know the EMFForms validation marker icon is different from the icon used in the problems view and the generated form shows validation errors by painting text fields red etc., none of which I can see in my application. It might be a question of updating the form, though, because as you can see, the standard Eclipse Properties view does not show any validation markers either.

Thanks,
Uwe
Re: EMFForms Validation using Complete OCL [message #1692838 is a reply to message #1692411] Mon, 20 April 2015 07:19 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi Ed,

to make sure we are talking about the same thing:

In the sample integration Uwe provided, if we call
Diagnostician.validate(anyEObject), will the returned Diagnostic contain
constraint violations triggered by OCL rules?

Best regards

Jonas


Am 15.04.2015 um 15:52 schrieb Ed Willink:
> Hi
>
> I think we're both 'standard', but without seeing a live example or even
> a screenshot, I have no idea what is actually being reported.
>
> My guess is that perhaps the EMF Forms knows where diagnostics occur and
> so fails to spot those that appear from elsewhere into the Resource.errors.
>
> Regards
>
> Ed Willink
>
>
>
> On 15/04/2015 14:27, Jonas Helming wrote:
>> Hi,
>>
>> I am not really familiar with the OCL integration here. EMF Forms uses
>> the default EMF validation mechnism. Does OCL push its results into it
>> or is the integration with the tree a custom extension?
>>
>> Best regards
>>
>> Jonas
>>
>> Am 15.04.2015 um 12:57 schrieb Uwe San:
>>> Hi,
>>>
>>> thanks for your reply.
>>>
>>> Running OCL->Validate did not have any effect.
>>>
>>> Please find a full example in the attached zip file. You can run the
>>> sample application contained in the oclemfforms.sampleapp project,
>>> create a new project and a new Sample model element using the wizards.
>>>
>>> There is an OCL file in the resources directory of the
>>> oclemfforms.sampleapp project which you can load into the application
>>> in order to test the validation mechanism. You should see a warning
>>> marker on a model element with an empty description attribute. Note
>>> that there is no marker in either of the two for editors.
>>>
>>> Thanks for your assistance. I'd appreciate your feedback.
>>>
>>> Regards,
>>> Uwe
>>>
>>
>


--
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: EMFForms Validation using Complete OCL [message #1693041 is a reply to message #1692502] Tue, 21 April 2015 11:52 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi Uwe,

I can have a look, but could you kindly update the sample code based on
Ed Feedback, so I do not spend much time on dealing with set-up issues?

Best regards

Jonas

Am 16.04.2015 um 11:36 schrieb Uwe San:
> Hi Ed,
>
> thanks for taking the time to analyse the problem. It seems like the
> problem is not on the OCL side so I hope someone from the EMFForms team
> will comment on this issue.
>
> I don't think it's just a missing icon because as far as I know the
> EMFForms validation marker icon is different from the icon used in the
> problems view and the generated form shows validation errors by painting
> text fields red etc., none of which I can see in my application. It
> might be a question of updating the form, though, because as you can
> see, the standard Eclipse Properties view does not show any validation
> markers either.
>
> Thanks,
> Uwe


--
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: EMFForms Validation using Complete OCL [message #1693043 is a reply to message #1693041] Tue, 21 April 2015 12:06 Go to previous messageGo to next message
Uwe San is currently offline Uwe SanFriend
Messages: 119
Registered: January 2012
Senior Member
Hi Jonas,

thanks for taking care of this issue, I really appreciate it.

If you take the version of the ZIP file I attached to this message, the product file should contain only the dependencies needed to reproduce the problem.

If the sample does not run out of the box for you, you can use the built version from here to run the sample.

Let me know if you have further questions.

Thanks,
Uwe
Re: EMFForms Validation using Complete OCL [message #1693378 is a reply to message #1693043] Thu, 23 April 2015 15:26 Go to previous messageGo to next message
Eugen Neufeld is currently offline Eugen NeufeldFriend
Messages: 63
Registered: March 2012
Member
Hi Uwe,
I think that the problem is, that the Diagnostic that is generated by OCL doesn't contain the feature. To be more precise: A Diagnostic has an data-field which is a list. When EMF validates stuff, it fills this list with the EObject on position 0 and the Feature on position 1. By using this information we can map the error exactly on a rendered field.
If I remember it correctly, then OCL doesn't provide the feature in this list. Thus the error cannot be mapped. So if you want to get this running you must bring OCL to add the EObject and the Feature it validated to this data list.

I wasn't able to reproduce the error yet, as I have to install a lot of stuff into my IDE. Could you provide a target-definition which contains all the necessary features?
In the built product, the extended properties view was missing. Furthermore the ocl file from the example project couldn't be loaded.

Cheers,
Eugen
Re: EMFForms Validation using Complete OCL [message #1693427 is a reply to message #1693378] Fri, 24 April 2015 07:11 Go to previous messageGo to next message
Uwe San is currently offline Uwe SanFriend
Messages: 119
Registered: January 2012
Senior Member
Hi Eugen,

thank you for your analysis which matches the observations I've had so far. The more I understand about the issue, the less likely I think the problem is on the EMFForms side because the regular properties view (org.eclipse.ui.views.PropertySheet) does not show the validation decorations either after an OCL validation was triggered. This behaviour cannot only be seen in my sample application but also when validating a dynamic model instance with OCL in the Sample Reflective Ecore Model Editor in Eclipse. No decorations there either.

Sorry the built product did not show the enhanced properties view, I forgot to include one ex4xmi file in the build. I uploaded another ZIP file which does show the enhanced properties view. You can find it here.
To make the OCL file work, you need to add it to your project in the sample application and then load it via the "Browse workspace" option in the load dialog.

In addition to that I uploaded a TP definition file here. I hope this will allow you to start the sample app from your Eclipse workspace.

Thanks,
Uwe
Re: EMFForms Validation using Complete OCL [message #1693439 is a reply to message #1693427] Fri, 24 April 2015 09:17 Go to previous messageGo to next message
Eugen Neufeld is currently offline Eugen NeufeldFriend
Messages: 63
Registered: March 2012
Member
Hi Uwe,
thank you for your update.
The target definition points to the current eclipse instance. I don't have OCL and all the needed dependencies in my Eclipse so the target definition doesn't help Smile.
But I could reproduce the problem with your new product and the description on how to load the OCL file.

If you want to make sure, that our current assumption is correct, you can debug the validation handling in emfforms. For this I would recommend to set a breakpoint in org.eclipse.emf.ecp.view.internal.validation.ValidationServiceImpl#validateAndCollectSettings . You can then simply check what information the resulting diagnostic (or its children) contains.

I suspect, that OCL won't work out of the box with EMFForms. In order to get it working, you will have to either change the way OCL generated Diagnostics or change the way EMFForms parses the information about where to add the diagnostic to.

Cheers,
Eugen
Re: EMFForms Validation using Complete OCL [message #1693446 is a reply to message #1693439] Fri, 24 April 2015 09:52 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6629
Registered: July 2009
Senior Member
Hi

Your diagnosis seems extremely plausible. Unfortunately the
Diagnostic.data[] content is not specified; there is just a custom and
practice, so OCL does what makes the Sample Ecore Model Editor look
good. Clearly EMF Forms needs more, so OCL can be enhanced accordingly.
The only way that EMF Forms can reconstruct the missing information is
to re-execute the OCL validation directly and I'm sure the EMF Forms
team will be delighted to add a dependency on OCL just to fix this.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=465397 raised.

Regards

Ed Willink

On 24/04/2015 10:17, Eugen Neufeld wrote:
> Hi Uwe, thank you for your update. The target definition points to the
> current eclipse instance. I don't have OCL and all the needed
> dependencies in my Eclipse so the target definition doesn't help :).
> But I could reproduce the problem with your new product and the
> description on how to load the OCL file.
> If you want to make sure, that our current assumption is correct, you
> can debug the validation handling in emfforms. For this I would
> recommend to set a breakpoint in
> org.eclipse.emf.ecp.view.internal.validation.ValidationServiceImpl#validateAndCollectSettings
> . You can then simply check what information the resulting diagnostic
> (or its children) contains.
>
> I suspect, that OCL won't work out of the box with EMFForms. In order
> to get it working, you will have to either change the way OCL
> generated Diagnostics or change the way EMFForms parses the
> information about where to add the diagnostic to.
> Cheers,
> Eugen
Re: EMFForms Validation using Complete OCL [message #1693454 is a reply to message #1693446] Fri, 24 April 2015 10:42 Go to previous messageGo to next message
Uwe San is currently offline Uwe SanFriend
Messages: 119
Registered: January 2012
Senior Member
Hi,

It seems like we have identified the root cause of the initial problem. Thank you to everyone who spent time on this!

As Ed said, I think it would more make sense to fix this issue on the OCL side rather than on the EMFForms side, in particular because this issue affects the regular properties view as well, so it is not specific to EMFForms.

Eugen, please let me know if you would like me to provide another TP definition (a more helpful one than previously) in case you are going to investigate this issue any further.

Cheers,
Uwe
Re: EMFForms Validation using Complete OCL [message #1693495 is a reply to message #1693454] Fri, 24 April 2015 14:23 Go to previous message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi,

I think as the issue seems clear now, we do not need another TP.

Best regards

Jonas

Am 24.04.2015 um 12:42 schrieb Uwe San:
> Hi,
>
> It seems like we have identified the root cause of the initial problem.
> Thank you to everyone who spent time on this!
>
> As Ed said, I think it would more make sense to fix this issue on the
> OCL side rather than on the EMFForms side, in particular because this
> issue affects the regular properties view as well, so it is not specific
> to EMFForms.
>
> Eugen, please let me know if you would like me to provide another TP
> definition (a more helpful one than previously) in case you are going to
> investigate this issue any further.
>
> Cheers,
> Uwe


--
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Previous Topic:[Texo] Runs in Eclipse but not in deployed jar
Next Topic:[Edapt] Migrate programmatically - Incorrect strategy?
Goto Forum:
  


Current Time: Fri Apr 10 20:35:49 GMT 2020

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

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

Back to the top