Skip to main content



      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 10:55 Go to next message
Eclipse UserFriend
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] Tue, 16 May 2023 23:55 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Hierarchical constraint categories in plugin.xml [message #1859254 is a reply to message #1859169] Tue, 23 May 2023 11:28 Go to previous message
Eclipse UserFriend
Thank you!
Previous Topic:Diagnostician Validation only enforce unique Ids after saving the model
Next Topic:[CDO] Release schedule
Goto Forum:
  


Current Time: Thu May 15 19:48:25 EDT 2025

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

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

Back to the top