Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Hierarchical constraint categories in plugin.xml(How to make constraint categories hierarchical?)
Hierarchical constraint categories in plugin.xml [message #1859157] Tue, 16 May 2023 14:55 Go to next message
Thomas M is currently offline Thomas MFriend
Messages: 2
Registered: May 2023
Junior Member
Hello,

Can someone help me understand how to make categories hierarchical? I'm trying to create a category hierarchy where one category is the parent of the other. Any tips or suggestions would be appreciated!

This is what I have in the plugin.xml at the moment (See also the image "plugin_xml.png" attached):

index.php/fa/43192/0/

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
   <extension
         point="org.eclipse.emf.validation.constraintProviders">
      <category
            id="category.parent"
            mandatory="false"
            name="Parent Rules">
		    <category
		       id="category.child"
		       mandatory="false"
		       name="Child Rules">
		 	</category>
      </category>
      <constraintProvider
            cache="true">
         <constraints
               categories="category.parent">
            <constraint
                  id="parent.child"
                  isEnabledByDefault="true"
                  lang="parent.child"
                  mode="Batch"
                  name="ParentConstraint"
                  severity="ERROR"
                  statusCode="parent.child">
               <message>
                  message body text
               </message>
            </constraint>
         </constraints>
         <constraints
               categories="category.child">
            <constraint
                  id="constraint.child"
                  isEnabledByDefault="true"
                  lang="constraint.child"
                  mode="Batch"
                  name="ChildConstraint"
                  severity="ERROR"
                  statusCode="constraint.child">
               <message>
                  message body text
               </message>
            </constraint>
         </constraints>
         <package
               namespaceUri="package">
         </package>
      </constraintProvider>
   </extension>
   <extension
         point="org.eclipse.emf.validation.constraintBindings">
      <clientContext
            id="context.default">
         <selector
               class="GuidelinesSelector">
         </selector>
      </clientContext>
      <binding
            category="category.parent"
            context="context.default">
      </binding>
      <binding
            category="category.child"
            context="context.default">
      </binding>
   </extension>

</plugin>


When I run this, only the parent category and it's constraints are shown (See Constraints.png)

index.php/fa/43191/0/

Thank you,
Thomas
Re: Hierarchical constraint categories in plugin.xml [message #1859169 is a reply to message #1859157] Wed, 17 May 2023 03:55 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 32985
Registered: July 2009
Senior Member
I'm not sure the people who can answer will notice the questions. They've not enabled discussions but you might open an issue and suggest they enable that for their repo, while asking your question there:

https://github.com/eclipse/emf-validation/issues


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Hierarchical constraint categories in plugin.xml [message #1859254 is a reply to message #1859169] Tue, 23 May 2023 15:28 Go to previous message
Thomas M is currently offline Thomas MFriend
Messages: 2
Registered: May 2023
Junior Member
Thank you!
Previous Topic:Diagnostician Validation only enforce unique Ids after saving the model
Next Topic:[CDO] Release schedule
Goto Forum:
  


Current Time: Sat Nov 11 09:20:37 GMT 2023

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

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

Back to the top