Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Validation Plugin, Contraint not executed(Papyrus EMF Validation Plugin, Client Context is executed but not constraint)
Validation Plugin, Contraint not executed [message #1828708] Wed, 17 June 2020 08:12 Go to next message
Christoph Lehr is currently offline Christoph LehrFriend
Messages: 24
Registered: June 2020
Junior Member
Hi all,

I'm currently developing a Papyrus Plugin which should validate some aspects of a UML Model in order to check if a transformation is possible or if errors would occur.

I created a plugin based on the Validation Plugin example of EMF and I can select my constraint if it shall be executed and the ClientContext is also executed. But my constraint is not executed. I added my plugin.xml to the attachments.

My ClientContext just returns true and my Constraint currently only creates a Successstatus, is there anything else I have to do, that my constraint is executed when I click on one of the Validation entries in the context menu?

Thanks for your help
BR Christoph
  • Attachment: plugin.xml
    (Size: 1.59KB, Downloaded 90 times)
Re: Validation Plugin, Contraint not executed [message #1828825 is a reply to message #1828708] Fri, 19 June 2020 10:50 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

Hi, Christoph,

Have you tried running your scenario with the org.eclipse.emf.validation debug tracing options enabled in your launch config? That may help to indicate what is going wrong.

But looking at your plugin.xml, I see two possible problems:

- your category binding references the context by ID "context". It has been a long time, so I don't recall really, but it could be that the framework automatically qualifies your context ID declaration with the bundle symbolic name, so you may have to reference it as "org.eclipse.emf.validation.opcua.context" (assuming that org.eclipse.emf.validation.opcua is your bundle name, which it shouldn't be because it's in the EMF namespace)
- but more significant is that you may need to bind your constraints to Papyrus's client-context. Hopefully the debug tracing will show if that's a problem, or else you can step through ClientContextManager::getClientContextsFor(EObject) to see what contexts are detected for the selection that you're validating in Papyrus

HTH,
Christian
Re: Validation Plugin, Contraint not executed [message #1828867 is a reply to message #1828825] Sat, 20 June 2020 13:36 Go to previous messageGo to next message
Christoph Lehr is currently offline Christoph LehrFriend
Messages: 24
Registered: June 2020
Junior Member
Hi,

thanks for your reply Christian.

I enabled the debug tracing but I don't find out why the constraint is not executed. I saw that the constraint is successfully parsed, but that's it. I added the log as attachement.

The Namespaces is work in progress I just copied the example and renamed some paths.

I renamed the context but it didn't affect the execution of the constraint.

I searched for the papyrus Client Context, but I didn't find anything useful. Do you know where I can find the path?
I tried stepping through the BatchValidator I saw that my ClientContext is added to the list, but in validate the constraint is not listed in the filtered constraints or the myConstraints lists. Do you have an idea why the constraint is not in there?

BR Christoph
  • Attachment: log.txt
    (Size: 344.95KB, Downloaded 80 times)
Re: Validation Plugin, Contraint not executed [message #1828870 is a reply to message #1828867] Sat, 20 June 2020 14:22 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

Hi, Christoph,

Indeed, I see that the tracing seems not to include anything useful about constraint bindings and client contexts. That could be a nice contribution to the framework.

Anyways, I don't find a Papyrus-specific client-context, either. There is a PapyrusClientSelector that matches objects contained in a ModelSet, but if it had ever been used before, it isn't now.
The only plausible contexts that I see are:

- org.eclipse.papyrus.uml.profile.clientContext seems to be for editing profiles
- org.eclipse.papyrus.emf.facet.custom.sdk.core.validation.context seems to be enabled unconditionally. I don't know what its purpose is

But I suspect that either the integration of this validation framework in Papyrus is broken or it just doesn't define its own application-specific context, so it is up to you to implement it. I'm not sure what else to say except to step through the ClientContextManager in the debugger as I suggested before.

Sorry,
Christian
Re: Validation Plugin, Contraint not executed [message #1828884 is a reply to message #1828870] Sun, 21 June 2020 09:27 Go to previous message
Christoph Lehr is currently offline Christoph LehrFriend
Messages: 24
Registered: June 2020
Junior Member
Hi Christian,

I will try the other contexts as soon as I'm back to work and update my post.
Thanks for your help.

BR Christoph
Previous Topic:Validation - what did I miss?
Next Topic:Registering Static Profile - Profile not listed
Goto Forum:
  


Current Time: Tue Apr 23 13:21:35 GMT 2024

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

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

Back to the top