Naming of modelling elementsNaming of modelling elementsRE: Naming of modelling elementsMateusz Dziedzichttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=7497692017-01-18T08:54:39Z2017-01-16T15:34:01ZDear Mr. Sibold,<br /><br />One way to solve the problem in Question Nr. 2 would be the following:<br />1. You could change the ATTR in Line Number 39 of the GraphRep to "ClassName" and set the Standard Value of the Attribute "Bezeichnung" to "Rolle".<br />2. To solve the issue with the limitation of elements you could add the following code to the External Coupling (Library attributes.../Add-ons):<br /><div class="code"><span class="code-lines"> 1</span>ON_EVENT "AfterCreateModelingNode"<br /><span class="code-lines"> 2</span>{<br /><span class="code-lines"> 3</span> CC "Modeling" GET_ACT_MODEL<br /><span class="code-lines"> 4</span> SETL nModelId: (modelid)<br /><span class="code-lines"> 5</span> SETL aObjIDs: ({})<br /><span class="code-lines"> 6</span> CC "Core" GET_ALL_OBJS_OF_CLASSNAME modelid: (modelid) classname:"Role"<br /><span class="code-lines"> 7</span> #-->RESULT ecode:intValue objids:list<br /><span class="code-lines"> 8</span> SETL lObjIDs: (objids)<br /><span class="code-lines"> 9</span> <br /><span class="code-lines">10</span> IF (tokcnt(lObjIDs) = 2) {<br /><span class="code-lines">11</span> PROCEDURE global LIST_TO_ARRAY list:string array:array nI:integer result:reference<br /><span class="code-lines">12</span> {<br /><span class="code-lines">13</span> IF(token(list, nI)!="") {<br /><span class="code-lines">14</span> SETL dummy: (aappend(array, VAL token(list, nI)))<br /><span class="code-lines">15</span> LIST_TO_ARRAY list: (list) array: (array) nI: (nI+1) result:array<br /><span class="code-lines">16</span> }<br /><span class="code-lines">17</span> SETL result: (array)<br /><span class="code-lines">18</span> }<br /><span class="code-lines">19</span> LIST_TO_ARRAY list: (lObjIDs) array: (aObjIDs) nI: (0) result:aObjIDs<br /><span class="code-lines">20</span><br /><span class="code-lines">21</span> SETL nCountObj: (aObjIDs.length)<br /><span class="code-lines">22</span> CC "Core" DELETE_OBJS modelid: (modelid) objids: (aObjIDs[1])<br /><span class="code-lines">23</span> #-->RESULT ecode:intValue errobjs:idList<br /><span class="code-lines">24</span> SET dummy: (aerase(aObjIDs, 1))<br /><span class="code-lines">25</span> CC "AdoScript" ERRORBOX "Error message" <br /><span class="code-lines">26</span> }<br /><span class="code-lines">27</span>}<br /></div><br />Regarding Question Nr. 1 the following solution is possible:<br />1. Create a new Attribute:<br /> Attribute name: Id<br /> Type: EXPRESSION<br /> Standard value: EXPR type:string expr:fixed: (STR objid)<br />2. Add the following code to the External Coupling(Library attributes.../Add-ons): <br /><div class="code"><span class="code-lines"> 1</span>ON_EVENT "AfterCreateModelingNode"<br /><span class="code-lines"> 2</span>{<br /><span class="code-lines"> 3</span> CC "Modeling" GET_ACT_MODEL<br /><span class="code-lines"> 4</span> SETL nModelId: (modelid)<br /><span class="code-lines"> 5</span> CC "Core" GET_ALL_OBJS_OF_CLASSNAME modelid: (modelid) classname:"Role Acute Physician"<br /><span class="code-lines"> 6</span> #-->RESULT ecode:intValue objids:list<br /><span class="code-lines"> 7</span> <br /><span class="code-lines"> 8</span> IF (tokcnt(objids)>0) {<br /><span class="code-lines"> 9</span> CC "Core" GET_ATTR_VAL objid: (VAL (token(objids,tokcnt(objids)-1))) attrname: ("Id")<br /><span class="code-lines">10</span> #-->RESULT ecode:intValue val:anyValue<br /><span class="code-lines">11</span> CC "Core" SET_ATTR_VAL objid: (VAL (token(objids,tokcnt(objids)-1))) attrname: ("Name") val: ("Acute Physician" + " - " + (val))<br /><span class="code-lines">12</span> }<br /><span class="code-lines">13</span>}<br /></div><br /><br />Best regards,<br />MateuszMateusz Dziedzic2017-01-16T15:34:01ZRE: Naming of modelling elementsPascal Siboldhttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=7242602016-11-29T09:13:11Z2016-11-29T09:13:11ZI found out, that this happens only when copying existing classes rather than creating new ones. Thus seems to be solved.<br /><br />But I still would be happy to receive an answer on points 1. and 2.<br /><br />Thanks a lot.Pascal Sibold2016-11-29T09:13:11ZNaming of modelling elementsPascal Siboldhttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=7206512016-11-23T08:32:02Z2016-11-23T08:30:05ZHello<br /><br />I noticed some "strange" behavior regarding the naming of modelling elements in the modelling toolkit and also have some questions.<br /><br />Scenario: I use the existing class "Role" from the LearnPAd library to copy it to create several new specific Roles (e.g. Physician, Nurse). There is a different behavior for the naming if I choose Role as Superclass or the element above it (__S_group__). If I choose Role as Superclass (what I would like to do in order to inherit all relations), all elements are only called "Rolle" in the modelling toolkit and the name when double-clicking it is read-only eventhough when double-clicking the element, the name attribute actually says e.g. Role Acute Physician-23606 (this value can be changed but is not shown in the model). When choosing __S_group__ as superclass, this does not happen and the name in the model is then e.g. Role Acute Physician-23606. But then all relations are not inherited.<br />For some other elements I was able to do it without a problem but for some elements, this behavior happens. So there seems to be something wrong with "Role" I guess.<br /><br />How can this be solved, that instead of "Rolle" the actual class name is shown?<br /><br />For your reference, the code of the class "Role":<br /><br />GraphRep:<br /><div class="code"><span class="code-lines"> 1</span><br /><span class="code-lines"> 2</span>GRAPHREP<br /><span class="code-lines"> 3</span>SHADOW off<br /><span class="code-lines"> 4</span><br /><span class="code-lines"> 5</span>AVAL sp:"Language"<br /><span class="code-lines"> 6</span>IF (sp = "System")<br /><span class="code-lines"> 7</span> IF (_uilang = "de")<br /><span class="code-lines"> 8</span> SET sp:"German"<br /><span class="code-lines"> 9</span> ELSE<br /><span class="code-lines">10</span> SET sp:"English"<br /><span class="code-lines">11</span> ENDIF<br /><span class="code-lines">12</span>ENDIF<br /><span class="code-lines">13</span><br /><span class="code-lines">14</span>AVAL col:"fontcolor"<br /><span class="code-lines">15</span>AVAL set-default:"no" mono:"Monochrome view"<br /><span class="code-lines">16</span>IF (mono = "yes")<br /><span class="code-lines">17</span> SET bMono:1<br /><span class="code-lines">18</span>ELSE<br /><span class="code-lines">19</span> SET bMono:0<br /><span class="code-lines">20</span>ENDIF<br /><span class="code-lines">21</span><br /><span class="code-lines">22</span>IF (bMono)<br /><span class="code-lines">23</span> SET color_lightskyblue:(rgbval("white"))<br /><span class="code-lines">24</span> SET col:(rgbval("black"))<br /><span class="code-lines">25</span> FILL color:(color_lightskyblue)<br /><span class="code-lines">26</span>ELSE<br /><span class="code-lines">27</span> SET color_lightskyblue:"lightskyblue"<br /><span class="code-lines">28</span> SHADOW off<br /><span class="code-lines">29</span> CLIP_ELLIPSE rx:.78cm ry:.68cm<br /><span class="code-lines">30</span> GRADIENT_RECT x:-.75cm y:-0.75cm w:1.5cm h:1.5cm style:downdiag color1:(rgbval (color_lightskyblue, 1.4)) color2:(rgbval (color_lightskyblue, 0.7))<br /><span class="code-lines">31</span> FILL style:null <br /><span class="code-lines">32</span> PEN w:0.08cm color:(rgbval (color_lightskyblue, 0.7)) join:miter<br /><span class="code-lines">33</span> CLIP_OFF <br /><span class="code-lines">34</span>ENDIF<br /><span class="code-lines">35</span><br /><span class="code-lines">36</span>ELLIPSE rx:.75cm ry:.65cm<br /><span class="code-lines">37</span>FONT color:(col)<br /><span class="code-lines">38</span>IF (sp = "English")<br /><span class="code-lines">39</span> ATTR "Name" y:.8cm w:c:2.8cm h:t<br /><span class="code-lines">40</span>ELSE<br /><span class="code-lines">41</span> ATTR "Bezeichnung" y:.8cm w:c:2.8cm h:t<br /><span class="code-lines">42</span>ENDIF<br /><span class="code-lines">43</span><br /><span class="code-lines">44</span>FONT "Arial" h:32pt color:black<br /><span class="code-lines">45</span>TEXT "R" y:.1cm w:c h:c<br /></div><br /><br />AttrRep:<div class="code"><span class="code-lines"> 1</span>NOTEBOOK<br /><span class="code-lines"> 2</span><br /><span class="code-lines"> 3</span>#-----------------------<br /><span class="code-lines"> 4</span>LANG "en"<br /><span class="code-lines"> 5</span>#-----------------------<br /><span class="code-lines"> 6</span>CHAPTER "Description"<br /><span class="code-lines"> 7</span>ATTR "Name"<br /><span class="code-lines"> 8</span>ATTR "Description" lines:5 <br /><span class="code-lines"> 9</span>ATTR "Comment" lines:5<br /><span class="code-lines">10</span>ATTR "Referenced Competency Profile"<br /></div><br />See also attached a screenshot from the modelling-toolkit.<br /><br />Also, I would like to change following things:<ol style="list-style: decimal inside;"><li>I would like to give the elements a default-name, which is not the same as the class name e.g. instead of Role Acute Physician-23606 I just want to name it Acute Physician-23606 (this value can be changed by the user afterwards when double-clicking. How can this be done?</li><li>For a different scenario I would like that the ID of the element is not shown anymore by default in the model and that only 1 of this element can be included in the model. Thus the model is limited to 1 element of this type. How can this be done?</li></ol>Thanks and best regards<br />PascalPascal Sibold2016-11-23T08:30:05Z