Restrict number of contained elements in GroupRestrict number of contained elements in GroupRE: Restrict number of contained elements in GroupWilfrid Utzhttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=9248372017-06-26T11:33:27Z2017-06-26T11:33:27ZHi,<br /><br />yes, ADOxx allows you to define such restrictions using Class Cardinalities that can be defined for each class using the "Class cardinality" attribute. <br /><br /><strong>Background: Container/Aggregation Classes</strong><br />For container elements this is also possible, as any class derived from __D_aggregation__ has an in an invisible relation class associated and is created between the container (=Group) and any instance of class put inside. This relation is called "Is inside" and you can also use a) queries to find the relation as there is not visualization (e.g. AQL Statement: <div class="code"><span class="code-lines">1</span>({"INSTANCE_NAME":"Group"}<-"Is inside") OR ({"INSTANCE_NAME":"Group"}->"Is inside"))</div>or <br />move the group with all contained elements by holding down the SHIFT key when selecting the group and moving it) THis helps you to check whether the relation is available.<br /><br /><strong>Class Cardinalities</strong><br />To restrict the maximum number of conainted objects, you have to define a cardinality rule like below:<div class="code"><span class="code-lines">1</span>RELATION "Is inside"<br /><span class="code-lines">2</span>max-incoming:5<br /><span class="code-lines">3</span>max-outgoing:5<br /></div><br />This rule needs to be defined in the container class, class attribute "Class cardinalities". An example using the BPMN library from here is shown in the screenshot attached (Restricting the containment to 5 elements for a Group instance).<br />Further details on the syntax of the class cardinalities are available here: <a href="https://www.adoxx.org/live/class-cardinalities">https://www.adoxx.org/live/class-cardinalities</a> and also in the FAQ section in multiple <a href="https://www.adoxx.org/live/faq/-/message_boards/search?_19_formDate=1498475702814&_19_redirect=https%3A%2F%2Fwww.adoxx.org%2Flive%2Ffaq%3Fp_p_id%3D19%26p_p_lifecycle%3D0%26p_p_state%3Dnormal%26p_p_mode%3Dview%26p_p_col_id%3Dcolumn-1%26p_p_col_count%3D1&_19_breadcrumbsCategoryId=0&_19_searchCategoryId=0&_19_keywords=cardinalities">threads</a>.<br /><br /><strong>Cardinalities Check Trigger</strong><br />The trigger for a rule check can be configured. By default it is manual, meaning the modeller needs to a) have a model open and b) clicks on "Model" -> "Check cardinalities" (see screenshot attached). In case you want to trigger it during the modelling, you can update this as a configuration the in the library attribute "Default configuration" of the dynamic library in chapter "Modelling".<br /><br /><div class="code"><span class="code-lines">1</span>CHECK_CARDINALITIES before-save: boolVal after-modeling-action: boolVal </div>where boolVal is 0 or 1. An example configuration for an "before-save" check is shown in the attached screenshot.<br />The effect is that each modelling step and/or when a model is saved the check is run.Wilfrid Utz2017-06-26T11:33:27ZRestrict number of contained elements in Grouphttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=9248262017-06-26T11:23:14Z2017-06-26T11:23:04ZI would like to restrict a specific class that acts as a container to a certain number of instances contained (for example only 5 instances). Is this possible in ADOxx.2017-06-26T11:23:04Z