University of Duisburg-EssenProject specific questions and answers from the project at the University of Duisburg-Essen.Relation only once between two objectsOliver Justhttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=15021502019-03-13T14:50:08Z2019-03-13T13:04:58ZHello,<br /><br />we are currently refactoring our MEMO implementation in ADOxx. We found out, that we have multiple occasions, where we need multiple connections between the two classes of the same type. Unfortunatly ADOxx does not support more than one relation of the same type between the same two classes. Till now we used some type of intermediate class. For the refactoring however we do not want to use them anymore, because they make the modelling process more complicted than necessary. Image 1 shows how the implementation is before the refactoring. Image 2 the desired presentation after the refactoring. The last image show the error message shown by the modelling toolkit, when creating Image 2.<br /><br />Is there a possibility to implement this in a better way?<br />Will it be possible to create more than one relation per two objects any time soon? It would be very important for us.<br /><br />Best Regards<br />Oliver JustOliver Just2019-03-13T13:04:58ZRE: Some QuestionsWilfrid Utzhttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=14220812018-11-21T09:06:24Z2018-11-21T09:06:24ZHi Oliver,<br />thanks for the question. ADOxx supports interfacing with databases via an ODBC connection - please have a look at the link below that provides details on this kind of interfacing approach. The post also summarizes the techniques to read from files and parse the results.<br /><br />DB-ODBC Connection: <a href="https://www.adoxx.org/live/faq/-/message_boards/message/64131">https://www.adoxx.org/live/faq/-/message_boards/message/64131<br /><br /></a>In addition, it would also be possible to connect and read from webservice interfaces (e.g. if database data is exposed via webservice operations). For details on this, please have a look at the "Extended HTTP Requests" building block that provides an implementation for ReST calls (<a href="https://www.adoxx.org/live/extended-http-requests-details">https://www.adoxx.org/live/extended-http-requests-details</a>). <br />A third approach that could be feasible is to integrate not on a data level but already on functionality level (e.g. integrate via Java calls - an example for calculating random values in Java and returning them to ADOxx is available here: <a href="https://www.adoxx.org/live/faq/-/message_boards/message/353857">https://www.adoxx.org/live/faq/-/message_boards/message/353857</a>)<br /><br />Hope the pointers above help - in case of further clarification or concrete issues in a later phase, please let me know!Wilfrid Utz2018-11-21T09:06:24ZSome QuestionsOliver Justhttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=14214882018-11-20T15:03:36Z2018-11-20T15:03:36ZHello everyone,<br /><br />we are currently evaluating the possibility of connecting ADOxx with real world data. In our first “brainstorming phase” we imagined to use connections to databases for this purpose.<br />It now seems that this will not be possible, since we have only found functions for reading and writing files in the documentation. Our idea is now to create a parser that will be able to read XML documents.<br /><br />Are there best practices we maybe missed? What are your thoughts about this?<br /><br />Best regards<br />OliverOliver Just2018-11-20T15:03:36ZRE: Dynamic Height DimensionOliver Justhttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=12411272018-05-25T23:30:24Z2018-05-25T23:30:24ZDear Mateusz,<br /><br />thanks for your reply. It helped alot! Your first hint worked very well. I should have thought about the Idea myself. The Solution is so simple <img alt="emoticon" src="https://www.adoxx.org/livehttps://www.adoxx.org/ADOxxORGv3-theme/images/emoticons/roll_eyes.gif" >.<br /><br />To 2) Yeah, sorry about that. It originally was min. I experimented a bit with the implementation. It seems I have forgotten to change it back.<br />To 3) Thanks for the advice. I will change it as soon as possible.<br /><br />Best Regards<br />OliverOliver Just2018-05-25T23:30:24ZRE: Dynamic Height DimensionMateusz Dziedzichttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=12405012018-05-25T08:08:54Z2018-05-25T08:07:11ZDear Oliver,<br /><br />thank you for the detailed description. This helped to better understand your issue. In order to make the object height changeable depending on the attributes you can do the following:<br /><br />1) Draw the implementation header (line 54-70) after the last SET dim_height statement in line 215. As a consequence, the object will be drawn with the height defined at the end, which depends on the attributes.<br /><br />2) Use the min() and not the max() function in line 215.<br /><br />3) When you create new attributes they are usually empty by default. Depending on the type this can be "" e.g. for Strings and 0 e.g. for integers. This means that you do not have to set a default value “empty”, but you can just check in the if-statement if the attributes are empty. E.g. if the attribute "purpose" is a String in your case then the if-statement in line 164 would look the following: IF(var_purpose != "") {}. As I do not have your library, I tried to recreate the depicted object and made the assumption that all the attributes you used are Strings. Thus, for the script I attached all the if-statements are adjusted to String attributes. Depending on the type of the attribute you will have to change the if-statements.Mateusz Dziedzic2018-05-25T08:07:11ZRE: Dynamic Height DimensionOliver Justhttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=12346892018-05-18T22:33:44Z2018-05-18T22:33:44ZDear Mateusz,<br /><br />I'm sorry if my description was a bit unclear and complicated. I'll try to explain it more understandable.<br />I'm trying to develop something like this:<br /><img src="https://i.imgur.com/mqH1Ahx.png" /><br />The image seen above is the actual development state. My problem is the huge margin between the "assumptions" and the bottom border of the box. The Contents in the Box like "formula" or "purpose" can vary and dont need to be existent for every entity. That means I cant specify how much height the box needs. My idea was to "correct" the height of the entity after every content was added.<br />The original height is set in line 20. The variable "dim_firstContent" then keeps the updated height. When every content is added dim_firstContent should contain the perfect height for the entity.<br />In line 215 I then tried to set the "perfect height" to the original height variable.<br /><br />So basicly I tried to do something like this:<br /><img src="https://i.imgur.com/Dw0jaQG.png" /><br /><br />But as it seems the change of the original height variable doesnt have a effect for the rendering of the entity. At least not after it was first specified<br /><br />Best Regards<br />OliverOliver Just2018-05-18T22:33:44ZRE: Dynamic Height DimensionMateusz Dziedzichttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=12343342018-05-18T08:04:37Z2018-05-18T08:03:59ZDear Oliver,<br />Could you be more specific about what you actually want to implement. Maybe you could provide some screenshots of your idea and why it is not working (or the .abl file if possible) so that it is easier for others to understand and test your implementation.Mateusz Dziedzic2018-05-18T08:03:59ZDynamic Height DimensionOliver Justhttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=12322952018-05-16T11:00:50Z2018-05-16T02:08:14ZHello,<br /><br />I'm currently developing a GRAPHREP implementation.<br />I will attach the current version of my attempt as FileUpload.<br /><br />My goal was to enable the implementation to be responsive when resizing.<br />So all measures are relative and not absolute.<br />At the very end of the script I would like to set the height of the entity to the necessary size.<br />Unfortunately there is no reaction in the rendering of the entity when the height variable is changed.<br /><br />Do you guys know a Workaround for my "Problem". Do I have a mistake?<br /><br />Best Regards<br />Oliver JustOliver Just2018-05-16T02:08:14ZRE: Submenu for ToolsMateusz Dziedzichttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=11117272018-01-25T12:25:01Z2018-01-25T12:19:39ZDear Daniel,<br /><br />yes, it is possible to structure the menu items. For example if you want to have a menu point „Ansicht“ (within the modelling component of your tool), which has an item „Zoom“ and 4 subitems for „Zoom“ then you can write the following code in External Coupling (Library attributes →Add-ons → External Coupling):<br /><br /><div class="code"><span class="code-lines">1</span>ITEM "Vergrößern" modeling:"Ansicht" sub-of:"Zoom"<br /><span class="code-lines">2</span>ITEM "Verkleinern" modeling:"Ansicht" sub-of:"Zoom"<br /><span class="code-lines">3</span>ITEM "Normal" modeling:"Ansicht" sub-of:"Zoom"<br /><span class="code-lines">4</span>ITEM "Nur Text zoomen" modeling:"Ansicht" sub-of:"Zoom"<br /></div><br /><span style="color: #ffffff">.<br />.</span>Mateusz Dziedzic2018-01-25T12:19:39ZSubmenu for ToolsDaniel Heinzighttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=11102262018-01-24T15:33:07Z2018-01-24T15:31:13ZHallo there!<br /><br />We have implemented a lot of tools (executable scripts) for our modeling languages, they are all in the menubar under "Tools". Now we want to restructure, because it is confusing to have all in the menubar without a deeper structure. <br /><br />Our question: It is possible to add a deeper structure? Something like this: <br /><a href="https://i.imgur.com/TUxIuqU.jpg"><img src="https://i.imgur.com/TUxIuqU.jpg" /></a><a href="https://i.imgur.com/zSBav0P.jpg"><img src="https://i.imgur.com/zSBav0P.jpg" /></a><br /><br />It would be great if you could help us.<br /><br />Best Regards,<br /><br />Daniel Heinzig<a href="https://i.imgur.com/TUxIuqU.jpg"><br /></a>Daniel Heinzig2018-01-24T15:31:13ZRE: ADOxx Administration ManualMehmet Albayrakhttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=4811852016-03-11T14:51:06Z2016-03-11T14:43:57ZDear David,<br />Thank you for your question. The manuals that are contained within ADOxx version 1.5 are the following links:<br />https://www.adoxx.org/live/home<br />http://www.adoxx.org/live/adoxx-documentation<br />https://www.adoxx.org/live/community<br />https://www.adoxx.org/live/faq<br /><br />Concerning your particular question about the 'Attribute profile reference' please see the following link, where the different attribute types are documented.<br /><a href="https://www.adoxx.org/live/class-attribute-and-attribute-types">https://www.adoxx.org/live/class-attribute-and-attribute-types</a><br /><br />Best regards.Mehmet Albayrak2016-03-11T14:43:57ZADOxx Administration ManualDavid Becherhttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=4756432016-03-07T12:32:43Z2016-03-07T12:32:43ZHello there!<br /><br />My question is actually quite straight forward: I have a PDF-File called "ADOxx Administration Manual", which lengthly describes all the components of the Administration/Development Toolkit. However, it only applies to Version 1.0.<br /><br />Since ADOxx is available in Version 1.5, I was wondering where to found the updated version of that exact PDF file. In the newer version, e.g., PROREF (Attribute profile reference) seems to be a new data type, but in the old 1.0 version of the manual it is not included. It would also be nice to find information about other newer features.<br /><br />Is there a newer version of the PDF file and if so, can I download it somewhere? If not, where can I get more information about all the new feature? I tried a google search for "PROREF"/Attribute Profile reference, but could not find anything.<br /><br />Best regards,<br />DavidDavid Becher2016-03-07T12:32:43ZRE: Setting enumerations in ADO scriptJonas Kaiserhttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=2338612015-02-24T17:03:01Z2015-02-24T17:02:16ZThank you David, that was exactly what we were looking for.<br />Since our project comes to an end, I want to express my gratitude for the great support we received during it.<br /><br />Best regards,<br />Jonas KaiserJonas Kaiser2015-02-24T17:02:16ZSetting enumerations (2)Jonas Kaiserhttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=2313502015-02-23T06:35:33Z2015-02-23T06:35:33ZHello,<br />I already posted this question in my previous thread after the answer of my initial question. Since i got no response for it I assume, that it went unnoticed.<br /><br />Instead of changing enumerations dynamically, we need to set an enumeration on a pre defined value using ado script. Basically the same as reading enumerations, just vice versa.<br />This is very important for us, but we cannot find an answer to it.<br /><br />Best regards,<br />Jonas KaiserJonas Kaiser2015-02-23T06:35:33ZRE: Setting enumerations in ADO scriptDavid Burkehttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=2307162015-02-23T07:24:41Z2015-02-19T13:09:29ZDear Jonas, <br /><br />Please find responses to both of your queries<br /><br /><strong>Setting an Enumeration Value</strong><br /><br />Firstly, predefined (or standard) value for an enumeration attribute is initally set in the library using the Development Toolkit. <br /><br /><img src="https://www.adoxx.org/svn/all-repo/9_ADOxx_FAQ_Documentation_Libraries/Set%20enumeration%20value/BIN/Predefined%20value%20in%20%20library.JPG" /><br /><br />Once this has been set, all object instances with this attribute which are created in the Modelling Toolkit will have this value initally set. If one wishes to subsequently change the value of this enumeration attribute using an ADOscript, the appropriate command is SET_ATTR_VAL. This is the opposite of GET_ATTR_VAL which you referred to.<br /><br />Syntax<br /><br /> CC "Core" SET_ATTR_VAL objid:id AttrSpec val:anyValue [ as-string ] .<br /><br /> AttrSpec : attrid:id | attrname:strValue .<br /><br /> #-->RESULT ecode:intValue<br /><br /><br />The following library, ADOscript and sample model:<br /><br /><a href="https://www.adoxx.org/svn/all-repo/9_ADOxx_FAQ_Documentation_Libraries/Set%20enumeration%20value/BIN/Change%20Enumeration%20Value.abl">Change Enumeration Value.abl</a><br /><a href="https://www.adoxx.org/svn/all-repo/9_ADOxx_FAQ_Documentation_Libraries/Set%20enumeration%20value/DOC/Change%20enumeration%20value.adl">Change enumeration value.adl</a><br /><a href="https://www.adoxx.org/svn/all-repo/9_ADOxx_FAQ_Documentation_Libraries/Set%20enumeration%20value/SRC/ChangeEnumerationValue.asc">ChangeEnumerationValue.asc</a><br /><br />illustrate the use of this command. <br /><br />In this model we have three classes: A (triangle), B (circle) and C (square). There is also an attribute of type Enumeration called "Colour" - which classes A and B have, but C does not. There is also an ADOscript called "ChangeEnumerationValue.asc". The purpose of this script is to find all objects in the model that possess the attribute "Colour" (in this case, instances of A and B ) and change its value to another value which the user selects from a list. One can see the method of actually setting the enumeration attribute value in line 46 of the code below. <br /><br /><div class="code"><span class="code-lines"> 1</span>###################################################################################################<br /><span class="code-lines"> 2</span># Script to change the value of an enumeration attribute for all objects which have this attribute<br /><span class="code-lines"> 3</span>###################################################################################################<br /><span class="code-lines"> 4</span>CC "Modeling" GET_ACT_MODEL<br /><span class="code-lines"> 5</span>SET n_modelId: (modelid)<br /><span class="code-lines"> 6</span>IF (n_modelId = -1) {<br /><span class="code-lines"> 7</span> CC "AdoScript" ERRORBOX "Error: No model currently open"<br /><span class="code-lines"> 8</span> EXIT<br /><span class="code-lines"> 9</span>}<br /><span class="code-lines">10</span># First we retrieve all objects in the active model, and put the object ids in a list "l_objIds"<br /><span class="code-lines">11</span>CC "Core" GET_ALL_OBJS modelid: (n_modelId)<br /><span class="code-lines">12</span>SET l_objIds: (objids)<br /><span class="code-lines">13</span><br /><span class="code-lines">14</span># The attribute name whose value we wish to change is called "Colour" here, and is of type enumeration<br /><span class="code-lines">15</span># For all objects with the attribute Colour, we wish to change the current value to some new value<br /><span class="code-lines">16</span># We allow user interaction, to select what the new value should be<br /><span class="code-lines">17</span>SET n_valFound:1<br /><span class="code-lines">18</span><br /><span class="code-lines">19</span># Loop over all objects in the current model<br /><span class="code-lines">20</span>FOR s_objId in: (l_objIds) {<br /><span class="code-lines">21</span> CC "Core" GET_CLASS_ID objid: (VAL s_objId)<br /><span class="code-lines">22</span> SET n_classId: (classid)<br /><span class="code-lines">23</span> CC "Core" GET_ATTR_ID classid: (n_classId) attrname: ("Colour")<br /><span class="code-lines">24</span> SET n_attributeId: (attrid)<br /><span class="code-lines">25</span> # Check whether the current object has an attribute called "Colour"<br /><span class="code-lines">26</span> # If the current object does not have this attribute, GET_ATTR_ID returns "-1" and nothing is done,<br /><span class="code-lines">27</span> # otherwise the following IF{..} block is executed<br /><span class="code-lines">28</span> IF (attrid != -1) {<br /><span class="code-lines">29</span> # This IF {..} block presents a selection tool to select the value desired, we only do this once (using the value of n_valFound)<br /><span class="code-lines">30</span> IF (n_valFound=1) {<br /><span class="code-lines">31</span> # Read the enumeration domain (i.e. the list of options for the enumeration attribute)<br /><span class="code-lines">32</span> CC "Core" GET_FACET_ENUMERATIONDOMAIN attrid: (n_attributeId)<br /><span class="code-lines">33</span> SET s_enumerationDomain: (val)<br /><span class="code-lines">34</span> CC "Core" GET_ATTR_VAL objid: (VAL s_objId) attrname:"Colour"<br /><span class="code-lines">35</span> SET s_currentSelection: (val)<br /><span class="code-lines">36</span> # Present selection box, to set the desired value (which is then stored in s_enumVal)<br /><span class="code-lines">37</span> CC "AdoScript" LISTBOX entries: (s_enumerationDomain) toksep:"@" title:"Select attribute value" oktext:"Apply" boxtext:"Attribute value:" selection: (s_currentSelection)<br /><span class="code-lines">38</span> IF (endbutton = "ok") {<br /><span class="code-lines">39</span> SET s_enumVal: (selection)<br /><span class="code-lines">40</span> }<br /><span class="code-lines">41</span><br /><span class="code-lines">42</span> } <br /><span class="code-lines">43</span> SET n_valFound: (n_valFound + 1)<br /><span class="code-lines">44</span> <br /><span class="code-lines">45</span> # Now we set the selected value for the current object in our loop over all objects<br /><span class="code-lines">46</span> CC "Core" SET_ATTR_VAL objid: (VAL s_objId) attrname:"Colour" val: (s_enumVal)<br /><span class="code-lines">47</span> <br /><span class="code-lines">48</span> }<br /><span class="code-lines">49</span><br /><span class="code-lines">50</span>}<br /></div><br /><br />One can test the functionality of this script by going to the Modelling Toolkit and loading the provided library. In the "Tools" menu (see image below) please go to the option "Change enumeration value". One is then presented with options to set for the enumeration value. On selection, all class objects possessing this attribute have their enumeration value changed to the chosen one.<br /><br /><img src="https://www.adoxx.org/svn/all-repo/9_ADOxx_FAQ_Documentation_Libraries/Set%20enumeration%20value/BIN/Change%20enumeration%20value%20menu%20option.JPG" /><br /><br />In principle, the main point of this illustration is the use of the command to set the enumeration value, which is shown in the code above. We would suggest that if this does not answer your question, perhaps describe the specific scenario that you are having problems with and the requirements you need a solution for in more detail. We can then describe it for you more exactly. <br /><strong>Calling an ADOscript from Attribute of Type Programcall</strong><br /><br />To your second question regarding the use of a Programcall attribute to execute an ADOscript file; this is illustrated in the same library using class C mentioned above. This class has an attribute "ExecuteAdoScript" of type Programcall. <br /><br />Firstly, this is defined in the library as shown in the image. <br /><br /><img src="https://www.adoxx.org/svn/all-repo/9_ADOxx_FAQ_Documentation_Libraries/Set%20enumeration%20value/BIN/Programcall%20Facet.JPG" /><br /><br />Note that in this case we have defined an ITEM "Change Enum Val" which is linked to the ADOscript. We have imported this script to the library and hence we have the path "db:\\ChangeEnumerationValue.asc". This can also be a path to a local file "C:\\....\\...\\ChangeEnumerationValue.asc", for example. Note the use of double backslash to separate directories. <br /><br />In this case we have also selected a Predefined value while defining the attribute. This not selected automatically for you, which you may be used to from setting Enumeration attributes.<br /><br /><img src="https://www.adoxx.org/svn/all-repo/9_ADOxx_FAQ_Documentation_Libraries/Set%20enumeration%20value/BIN/Programcall%20Predefined%20value.JPG" /><br /><br />Now, in the Modelling Toolkit we can test this attribute by going to the notebook of an object of class C<br /><br /><img src="https://www.adoxx.org/svn/all-repo/9_ADOxx_FAQ_Documentation_Libraries/Set%20enumeration%20value/BIN/Notebook%20Execute.JPG" /><br />We can test the execution of the script by clicking on the green arrow. Firstly note that before clicking on the arrow, in the dropdown box underneath "Executable" in the image, we need to have selected the item that we had defined earlier - "Change Enum Val" - or the script will not execute. This should be selected by default though if we have set the Predefined value in the library as above. Secondly, if we have made a mistake when defining the location of the script, we would now get an error indicating that the script cannot be loaded. If you are getting a specific error during your attempts, please let us know what error is displayed.David Burke2015-02-19T13:09:29ZRE: Setting enumerations in ADO scriptJonas Kaiserhttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=2270292015-02-18T12:17:25Z2015-02-09T16:13:31ZFirst of all, thank you for taking the time. I have to apologize if I formulated my question vague. Instead of changing enumerations dynamically, we need to set an enumeration on a pre defined value using ado script. Basically the same as reading enumerations just vice versa.<br /><br />Besides that, how is it possible to bind an .ASC file with the EXECUTE FILE command in an attribute of type PROGRAMCALL? I've done that but it does not seem to work. Is there something to consider?<br />Thank you very much and best regards,<br /><br />Jonas KaiserJonas Kaiser2015-02-09T16:13:31ZRE: Setting enumerations in ADO scriptMehmet Albayrakhttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=2269272015-02-09T12:06:25Z2015-02-09T12:06:25ZDear Jonas Kaiser,<br /><br />Thank you for your questions. In order to solve your first question, how to define enumeration values dynamically, please have a look at the following thread.<br /><a href="http://www.adoxx.org/live/faq/-/message_boards/message/209425">http://www.adoxx.org/live/faq/-/message_boards/message/209425</a><br />There you can find a detailed documentation of the solution including a library with an implementation example.<br /><br />To solve your second issue there are two ways to represent buttons in the modeling toolkit.<br /> 1. Push-button In the Notebook<br /> 2. Define a HOTSPOT in the GraphRep<br /><br />Ad 1)<br /> ·Create an attribute of type PROGRAMCALL.<br /> ·Configure the attribute AttrRep<div class="code"><span class="code-lines">1</span> NOTEBOOK<br /><span class="code-lines">2</span> CHAPTER "Description"<br /><span class="code-lines">3</span> ATTR "Name"<br /><span class="code-lines">4</span> ATTR "%ATTRNAME%" push-button no-param<br /></div>The additional input ‘push-button no-param’ has the effect that you will have a push button in the notebook which triggers the ADOSCRIPT implementation of the PROGRAMCALL attribute.<br /><img src="" /><br /><br />Ad 2)<br /> ·Create an attribute of type PROGRAMCALL.<br /> ·Configure the attribute AttrRep<div class="code"><span class="code-lines">1</span> NOTEBOOK<br /><span class="code-lines">2</span> CHAPTER "Description"<br /><span class="code-lines">3</span> ATTR "Name"<br /><span class="code-lines">4</span> ATTR "%ATTRNAME%"<br /></div> ·Configure the attribute GraphRep by defining a HOTSPOT<br /><br />A <strong>HOTSPOT </strong>element links the rectangular region specified by <strong>x</strong>, <strong>y</strong>, <strong>w</strong> and <strong>h</strong> to the object attribute specified by the main parameter <em>attrName.</em> The element itself is invisible in the graphical representation.<br />Moving the mouse over a <strong>HOTSPOT </strong>region of an INTERREF or a PROGRAMCALL attribute lets the mouse cursor become a pointing hand. Additionally the corresponding attribute value or any specified <strong>text </strong>is shown in a balloon window.<br />Clicking on a <strong>HOTSPOT </strong>region has the same effect as clicking on the text of an <strong>ATTR </strong>element for the same attribute.<br /><strong><br />HOTSPOT </strong><em>attrName </em>[ <strong>text:</strong><em>strExpr</em> ]<br />[ <strong>x:</strong><em>xposExpr</em> ] [ <strong>y:</strong><em>yposExpr</em> ]<br />[ <strong>w:</strong><em>widthExpr</em> ] [ <strong>h:</strong><em>heightExpr</em> ]<br /> <br /><strong>Example: </strong><strong>Hotspot for a PROGRAMCALL attribute</strong><div class="code"><span class="code-lines"> 1</span>GRAPHREP<br /><span class="code-lines"> 2</span>PEN w:0.05cm<br /><span class="code-lines"> 3</span>FILL color:dodgerblue<br /><span class="code-lines"> 4</span>RECTANGLE x:-1.4cm y:-.7cm w:2.8cm h:1.4cm<br /><span class="code-lines"> 5</span>AVAL ed:" External Documentation " # External documentation<br /><span class="code-lines"> 6</span>IF (LEN ed)<br /><span class="code-lines"> 7</span> FILL color:$cafe69 # hidden message? ;-)<br /><span class="code-lines"> 8</span> POLYGON 7 x1:1.2cm y1:-0.4cm x2:1.6cm y2:-0.4cm x3:1.6cm y3:-0.5cm<br /><span class="code-lines"> 9</span> x4:2.0cm y4:-0.3cm x5:1.6cm y5:-0.1cm x6:1.6cm y6:-0.2cm<br /><span class="code-lines">10</span> x7:1.2cm y7:-0.2cm<br /><span class="code-lines">11</span> HOTSPOT "External Documentation" x:1.2cm y:-0.5cm w:0.8cm h:0.4cm<br /><span class="code-lines">12</span> text: ("Execute: " + copy (ed, 0, search (ed, "@", 0)))<br /><span class="code-lines">13</span>ENDIF<br /></div> <br /><br /><strong>Result:</strong><br /><img src="http://www.adoxx.org/live/documents/10157/110691/HOTSPOT.png/62e2844a-89de-4d79-acdc-a09d0c7db25b?t=1423487074652" />Mehmet Albayrak2015-02-09T12:06:25ZSetting enumerations in ADO scriptJonas Kaiserhttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=2261742015-02-07T14:17:36Z2015-02-07T14:17:36ZHello,<br />unfortunately i didn't find any information on how i can set specific values for enumerations with ado script. Maybe you can help me in that regard. Besides that, is it possible to add buttons in the modeling environment, which are executing ADO script code when pressing it ?<br /><br />Thank you very much,<br />Jonas KaiserJonas Kaiser2015-02-07T14:17:36ZRE: Defining constraintsDavid Burkehttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=2225182015-02-09T10:10:07Z2015-01-29T12:59:50Z Dear Jonas,<br /><br /> Firstly to mention, there is a platform implementation for functionality related to your question. In the model editor under "Global Change", (menu item "Edit" -> "Global Change") there is an option to change the value of an attribute for all objects of a particular class. One goes to "Global Change" and adds a query to "Get all objects of class..". In the next step one selects the attribute that one wants to change. This change will then effect all objects of that class.<br /><br /> However, as you noted, you wish to change this attribute for *all* classes which have the attribute "ShowTextbox". In this case, one can write some AdoScript code to do this. The main points of the code are<br /><br /> 1) Use the command "GET_ALL_OBJS" to get the IDs of all objects in the current model.<br /> 2) For each of these objects we make a call to "GET_ATTR_ID".<br /> 3) The trick is to look for what this call returns - if it returns "-1" we know that the object does not have this attribute. This allows us to only try and change the attribute "ShowTextbox" for objects that actually have this attribute.<br /><br />The code itself is shown below, and is saved in the database under the filename "Change Attribute Value for all Objects Possessing Attribute.asc".<div class="code"><span class="code-lines"> 1</span>SEND "GET_ACTIVE_MODEL" to:"Modeling" answer:modelid<br /><span class="code-lines"> 2</span>SET id_ModelId:(modelid)<br /><span class="code-lines"> 3</span># First we retrieve all objects in the active model, and put the object ids in a list "l_objIds"<br /><span class="code-lines"> 4</span>CC "Core" GET_ALL_OBJS modelid:(VAL id_ModelId)<br /><span class="code-lines"> 5</span>SET l_objIds:(objids)<br /><span class="code-lines"> 6</span><br /><span class="code-lines"> 7</span># In this case, "Yes" is represented by 1, and "No" by 0 - which is equivalent to the box being checked or<br /><span class="code-lines"> 8</span># unchecked respectively in the notebook<br /><span class="code-lines"> 9</span>SET n_yesVal:1<br /><span class="code-lines">10</span>SET n_noVal:0<br /><span class="code-lines">11</span><br /><span class="code-lines">12</span># The attribute name whose value we wish to change is called "ShowTextbox" here. We have three menu options in the model editor,<br /><span class="code-lines">13</span># "Yes" which, for all objects having the attribute "ShowTextbox", changes the value to 1 (i.e. "Yes")<br /><span class="code-lines">14</span># "No" which, for all objects having the attribute "ShowTextbox", changes the value to 0 (i.e. "No")<br /><span class="code-lines">15</span># "Toggle" which, for all objects having the attribute "ShowTextbox", changes it to 0 if it was previously 1, and 1 if it was previously 0<br /><span class="code-lines">16</span>IF (s_menuOption = "Yes") {<br /><span class="code-lines">17</span> # We loop over the objects in our active model. We perform an attempt to get the ID of the attribute "ShowTextbox" for the current object.<br /><span class="code-lines">18</span> # If this attribute doesn't exist for the current object we get a value -1 returned. If we don't get -1 the object has the attribute<br /><span class="code-lines">19</span> # and we change its value accordingly.<br /><span class="code-lines">20</span> FOR s_objId in:(l_objIds) {<br /><span class="code-lines">21</span> CC "Core" GET_CLASS_ID objid:(VAL s_objId)<br /><span class="code-lines">22</span> SET id_ClassId:(classid)<br /><span class="code-lines">23</span> CC "Core" GET_ATTR_ID classid:(id_ClassId) attrname:"ShowTextbox"<br /><span class="code-lines">24</span> IF (attrid != -1) {<br /><span class="code-lines">25</span> CC "Core" SET_ATTR_VAL objid:(VAL s_objId) attrname:"ShowTextbox" val:(n_yesVal)<br /><span class="code-lines">26</span> }<br /><span class="code-lines">27</span> <br /><span class="code-lines">28</span> }<br /><span class="code-lines">29</span> <br /><span class="code-lines">30</span>}<br /><span class="code-lines">31</span><br /><span class="code-lines">32</span>IF (s_menuOption = "No") {<br /><span class="code-lines">33</span> <br /><span class="code-lines">34</span> FOR s_objId in:(l_objIds) {<br /><span class="code-lines">35</span> CC "Core" GET_CLASS_ID objid:(VAL s_objId)<br /><span class="code-lines">36</span> SET id_ClassId:(classid)<br /><span class="code-lines">37</span> CC "Core" GET_ATTR_ID classid:(id_ClassId) attrname:"ShowTextbox")<br /><span class="code-lines">38</span> <br /><span class="code-lines">39</span> IF (attrid != -1) {<br /><span class="code-lines">40</span> CC "Core" SET_ATTR_VAL objid:(VAL s_objId) attrname:"ShowTextbox" val:(n_noVal)<br /><span class="code-lines">41</span> <br /><span class="code-lines">42</span> }<br /><span class="code-lines">43</span> <br /><span class="code-lines">44</span> }<br /><span class="code-lines">45</span> <br /><span class="code-lines">46</span>}<br /><span class="code-lines">47</span><br /><span class="code-lines">48</span>IF (s_menuOption = "Toggle") {<br /><span class="code-lines">49</span> <br /><span class="code-lines">50</span> FOR s_objId in:(l_objIds) {<br /><span class="code-lines">51</span> CC "Core" GET_CLASS_ID objid:(VAL s_objId)<br /><span class="code-lines">52</span> SET id_ClassId:(classid)<br /><span class="code-lines">53</span> CC "Core" GET_ATTR_ID classid:(id_ClassId) attrname:"ShowTextbox"<br /><span class="code-lines">54</span> <br /><span class="code-lines">55</span> IF (attrid != -1) {<br /><span class="code-lines">56</span> CC "Core" GET_ATTR_VAL objid:(VAL s_objId) attrname:"ShowTextbox"<br /><span class="code-lines">57</span> # The case of "Toggle" is similar to the above, only that we flip the value of the attribute from "Yes" to "No" and vice versa.<br /><span class="code-lines">58</span> IF (val = n_yesVal) {<br /><span class="code-lines">59</span> CC "Core" SET_ATTR_VAL objid:(VAL s_objId) attrname:"ShowTextbox" val:(n_noVal)<br /><span class="code-lines">60</span> <br /><span class="code-lines">61</span> }<br /><span class="code-lines">62</span> <br /><span class="code-lines">63</span> IF (val = n_noVal) {<br /><span class="code-lines">64</span> CC "Core" SET_ATTR_VAL objid:(VAL s_objId) attrname:"ShowTextbox" val:(n_yesVal)<br /><span class="code-lines">65</span> <br /><span class="code-lines">66</span> }<br /><span class="code-lines">67</span> <br /><span class="code-lines">68</span> }<br /><span class="code-lines">69</span> <br /><span class="code-lines">70</span> }<br /><span class="code-lines">71</span> <br /><span class="code-lines">72</span>}<br /></div><br /><br />The triggering of the script itself, and the definition of some menu items to execute it, are defined in the library attributes under "Add-ons" and then "External coupling".<br /><br /><br /> There are now three new menu options in the model editor under the "Tools" menu - "Change ShowTextbox to Yes", "Change ShowTextbox to No" and "Toggle ShowTextbox" which execute the AdoScript.<br /><br /> Please find attached a sample model file (ADL). In this case we have classes A and C, which have the attribute "ShowTextbox", and a class B which does not.<br /> For clarity, classes A and C will appear as a blue/green circle if it doesn't have its attribute "ShowTextbox" ticked and is shown with a blue/green circle with a cross<br /> through it if it does have "ShowTextbox" ticked. Class B, which doesn't have the attribute "ShowTextbox", is shown as a red triangle.<br /><br /> <span style="font-size: 16px"><strong> Download</strong></span>:<br /> <a href="https://www.adoxx.org/svn/all-repo/9_ADOxx_FAQ_Documentation_Libraries/Change%20Attribute%20Value%20for%20all%20Objects%20Possessing%20Attribute/BIN/Change%20Attribute%20Value%20for%20all%20Objects%20Possessing%20Attribute.abl">Change Attribute Value for all Objects Possessing Attribute.abl</a> <br /> <a href="https://www.adoxx.org/svn/all-repo/9_ADOxx_FAQ_Documentation_Libraries/Change%20Attribute%20Value%20for%20all%20Objects%20Possessing%20Attribute/DOC/Change%20Attribute%20Value%20for%20all%20Objects%20Possessing%20Attribute.adl">Change Attribute Value for all Objects Possessing Attribute.adl</a>David Burke2015-01-29T12:59:50ZRE: Defining constraintsJonas Kaiserhttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=2224722015-01-29T05:18:02Z2015-01-29T05:18:02ZThank you very much, that helped us quite a lot.<br />Nevertheless, we are confronted with another problem, we cannot find a solution for so far. In certain classes, we implemented an attribute called "ShowTextbox". When this attribute is set to "Yes", a textbox is displayed below the concept and represents a few attributes of this concept. We want to implement a MODI, which sets this attribute to "Yes" in any(!) class, which owns this attribute. Does a solution for that purpose exist?<br /><br />Best regards,<br />Jonas KaiserJonas Kaiser2015-01-29T05:18:02Z