Christian-Albrechts-University KielProject specific questions and answers from the project at Christian-Albrechts-University Kiel.RE: Usage of ado2Odbc.dllRichard Alex Jiménez Ortegahttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=17056842019-10-16T01:26:41Z2019-10-16T01:26:41Z<span style="font-size: 24px"><span style="color: #222222"><span style="font-family: arial, sans-serif">Did you succeed in the connection?</span></span></span>Richard Alex Jiménez Ortega2019-10-16T01:26:41ZRE: @INCLUDE with variablesMateusz Dziedzichttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=10764422017-12-11T10:41:33Z2017-12-11T10:40:54Z„The idea is to add a small pice of GraphRep at each child-classes. The main part is equal. “<br /><br />For the main part one could save the GraphRep code in a .leo file in the database. Than include the main part via @INCLUDE "db:\\MainPart_GraphRep.leo" in the GraphRep Attribute of each class. After the @INCLUDE statement one could add additional code in the child-classes.Mateusz Dziedzic2017-12-11T10:40:54ZRE: Usage of ado2Odbc.dllNedim Rifatbegovichttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=10764332017-12-11T10:20:36Z2017-12-11T10:08:41ZIn the example under https://www.adoxx.org/live/faq/-/message_boards/message/64131?p_p_auth=QKq5Dsxe the used Ports are: <span style="font-family: monospace"><span style="font-size: 16px">IP-address:192.168.0.1 Port:8080 Username:testuser Password:testpass<br /><br /></span></span><strong>TEXT</strong><br />ADOxx has standard functionality for reading text files. <br />The contents of files can be read using the command call FREAD from the "AdoScript" <span style="font-size: 16px">messageport</span>.<br />The syntax of the command call is:<br /><br /><div class="code"><span class="code-lines">1</span>CC "AdoScript" FREAD file: filename [ binary: boolValue ] [ base64: boolValue ] .<br /><span class="code-lines">2</span>--> RESULT ecode: intValue text: strValue .<br /></div>You can read the contents of a text file in a string variable using the above command call and then parse the resulting text according to its format and your needs.<br /><br /><strong>EXAMPLE - TEXT</strong><br />In the example below, the text file contains a list of <name>:<value> pairs separated by a blank space (" ") representing the configuration for a fictive server, also attached to this post<br /><br /><div class="code"><span class="code-lines">1</span>IP-address:192.168.0.1 Port:8080 Username:testuser Password:testpass</div><br />The following code snippet reads the contents of the file and saves the values of the respective attributes of an object:<br /><br /><div class="code"><span class="code-lines"> 1</span>CC "Core" GET_ATTR_VAL objid: (idMyObjID) attrname: ("Configuration File")<br /><span class="code-lines"> 2</span> # --> RESULT ecode: intValue val: strValue<br /><span class="code-lines"> 3</span><br /><span class="code-lines"> 4</span>CC "AdoScript" FREAD file: ( val )<br /><span class="code-lines"> 5</span> # --> RESULT ecode: intValue text: strValue .<br /><span class="code-lines"> 6</span>SET sTxtData: ( text )<br /><span class="code-lines"> 7</span><br /><span class="code-lines"> 8</span>FOR sParameter in: (sTxtData) sep: " " {<br /><span class="code-lines"> 9</span> SET sName: (token(sParameter,0,":"))<br /><span class="code-lines">10</span> SET sValue: (token(sParameter,1,":"))<br /><span class="code-lines">11</span> CC "Core" SET_ATTR_VAL objid: (idMyObjID) attrname: (sName) val: (sValue)<br /><span class="code-lines">12</span> # --> RESULT ecode: intValue<br /><span class="code-lines">13</span>}<br /></div><br />The example above assumes that the object ID has been determined beforehand and set to the variable "idMyObjID" and the parameter names in the text file are the exact names of the attributes (IP-address, Port, Username, Password)<br /><br /><strong>CSV</strong><br />If the text file has a CSV-format, the rows are separated by the <span style="font-size: 16px">charracter</span> "\n" and within a row, the columns are separated by ";". As an example, the following CSV data can be read in the string variable sCsvData and then parsed line by line:<br /><div class="code"><span class="code-lines">1</span>1;6;11<br /><span class="code-lines">2</span>2;7;12<br /><span class="code-lines">3</span>3;8;13<br /><span class="code-lines">4</span>4;9;14<br /><span class="code-lines">5</span>5;10;15<br /></div><strong><br />EXAMPLE - CSV</strong><br /><div class="code"><span class="code-lines"> 1</span>CC "AdoScript" FREAD file: ("sample.csv")<br /><span class="code-lines"> 2</span># --> RESULT ecode: intValue text: strValue .<br /><span class="code-lines"> 3</span>SET sCsvData: ( text )<br /><span class="code-lines"> 4</span><br /><span class="code-lines"> 5</span>SET nRow:0<br /><span class="code-lines"> 6</span>SET nColumn:0<br /><span class="code-lines"> 7</span>FOR sRow in: (sCsvData) sep: "\n" {<br /><span class="code-lines"> 8</span> SET nColumn:0<br /><span class="code-lines"> 9</span> FOR sCell in: (sRow) sep: ";" {<br /><span class="code-lines">10</span> CC "AdoScript" INFOBOX ("Row: " + STR nRow + ", Column: " + STR nColumn + ", Value: " + sCell)<br /><span class="code-lines">11</span> SET nColumn: (nColumn + 1) <br /><span class="code-lines">12</span> }<br /><span class="code-lines">13</span> SET nRow: (nRow + 1)<br /><span class="code-lines">14</span>}<br /></div>The example above does not update the model, but reads the file and provides INFOBOX output. This output can be replaced by SET_ATTR_VAL statements to update objects for each line.<br /><br /><strong>XLS</strong><br />If the data is stored in XLS files, it can be accessed by using the command CALL for calling functions stored in the DLL file "ado2Xls.dll". The DLL file is included in the ADOxx 1.3 UL1 package and can be found in the folder <ADOxx_folder>\tools\misc<span style="font-size: 16px">\ .</span><br />The function AdoXslFetchText is used for reading the data from an XSL file. The function AdoXslCloseAll() is used for closing all XSL files previously opened for reading <span style="font-size: 16px">withe</span> the function AdoXlsFetchText.<br /><br /><strong>EXAMPLE - XLS</strong><br /><div class="code"><span class="code-lines"> 1</span>SET sDLLpath: ("tools\\misc\\ado2Xls.dll")<br /><span class="code-lines"> 2</span>SET sXSLfile: ("C:\\Temp\\test.xls")<br /><span class="code-lines"> 3</span>SET sXSLsheet: ("T1")<br /><span class="code-lines"> 4</span>SET sXSLcell: ("2,2")<br /><span class="code-lines"> 5</span><br /><span class="code-lines"> 6</span>CALL dll: (sDLLpath) function:"long AdoXlsFetchText( char *strsource, char *strcell, char **pstrtext )"<br /><span class="code-lines"> 7</span> strsource: (sXSLfile + ">" + sXSLsheet) strcell: (sXSLcell)<br /><span class="code-lines"> 8</span><br /><span class="code-lines"> 9</span>CC "AdoScript" INFOBOX ("The value of the cell located at row 2, column 2 in the sheet T2 is: " + pstrtext)<br /><span class="code-lines">10</span><br /><span class="code-lines">11</span>CALL dll: (sDLLpath) function:"long AdoXlsFetch( char *strsource, char *strcell, char **pstrvalue )"<br /><span class="code-lines">12</span> strsource: (sXSLfile + ">" + sXSLsheet) strcell: (sXSLcell)<br /><span class="code-lines">13</span><br /><span class="code-lines">14</span>CALL dll: (sDLLpath) function:"long AdoXlsCloseAll()"<br /></div><br /><br /><strong>DB</strong><br />If the data is stored in a database, it can be read using the functions stored in the DLL file "ado2Odbc.dll", also included in the ADOxx 1.3 UL1 package and located in the folder <ADOxx_folder>\tools\misc<span style="font-size: 16px">\ .</span><br />Since the communication with the server is a bit more complex than reading from a file, several functions are required:<br />AdoOdbcConnect - for connecting to the database<br />AdoOdbcFetch - for reading a single value from the database<br />AdoOdbcExecute - for executing a query that returns more than one value<br />AdoOdbcFetchNext - for retrieving the next data record from the database; is always used after calling the AdoOdbcExecute function<br /><br /><strong>EXAMPLE - DB</strong><div class="code"><span class="code-lines"> 1</span>SET sDLLpath: ("tools\\misc\\ado2Odbc.dll")<br /><span class="code-lines"> 2</span>SET sODBCconnection: "testdb"<br /><span class="code-lines"> 3</span>SET sODBCusername: "testuser"<br /><span class="code-lines"> 4</span>SET sODBCpass: "testpass"<br /><span class="code-lines"> 5</span><br /><span class="code-lines"> 6</span>CALL dll: (sDLLpath) function:"long AdoOdbcConnect( char *strdbparam, char **pstrdbinst )"<br /><span class="code-lines"> 7</span> strdbparam: (sODBCconnection + " " + sODBCusername + " " + sODBCpass)<br /><span class="code-lines"> 8</span>SETL sDbHandle: (pstrdbinst)<br /><span class="code-lines"> 9</span><br /><span class="code-lines">10</span>SET sSelect: ("SELECT ID, Name, address FROM testdb01 WHERE ID>1")<br /><span class="code-lines">11</span><br /><span class="code-lines">12</span>CALL dll: (sDLLpath) function:"long AdoOdbcFetch( char *strdbinst, char *strselect, char **pstrresult )"<br /><span class="code-lines">13</span> strdbinst: (sDbHandle) strselect: (sSelect)<br /><span class="code-lines">14</span>#Only returns the first cell from the first row resulting from the SELECT statement <br /><span class="code-lines">15</span><br /><span class="code-lines">16</span>CALL dll: (sDLLpath) function:"long AdoOdbcExecute( char *strdbinst, char *strselect, char **pstrcolumns )"<br /><span class="code-lines">17</span> strdbinst: (sDbHandle)<br /><span class="code-lines">18</span> strselect: (sSelect)<br /><span class="code-lines">19</span> # --> pstrcolumns (list of column names separated by ASCII #128)<br /><span class="code-lines">20</span><br /><span class="code-lines">21</span>SET eCode:0<br /><span class="code-lines">22</span>SET sResults:""<br /><span class="code-lines">23</span>WHILE ( eCode = 0 ) {<br /><span class="code-lines">24</span> CALL dll: (sDLLpath) function:"long AdoOdbcFetchNext( char *strdbinst, long bmaskresult, char **pstrresult )"<br /><span class="code-lines">25</span> strdbinst: (sDbHandle) bmaskresult:0<br /><span class="code-lines">26</span> # --> pstrresult<br /><span class="code-lines">27</span> SET eCode: ( result )<br /><span class="code-lines">28</span> SET sResults: (sResults + "\n" + pstrresult)<br /><span class="code-lines">29</span>}<br /><span class="code-lines">30</span><br /><span class="code-lines">31</span>CC "AdoScript" EDITBOX text: (sResults) title: "Results..."<br /><span class="code-lines">32</span><br /><span class="code-lines">33</span>CALL dll: (sDLLpath) function:"long AdoOdbcClose( char *strdbinst )"<br /><span class="code-lines">34</span> strdbinst: (sDbHandle)<br /></div>Nedim Rifatbegovic2017-12-11T10:08:41ZRE: Usage of PROCEDUREMateusz Dziedzichttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=10729602017-12-07T13:04:25Z2017-12-07T12:59:51ZThe error is because of the brackets for the result parameter in the call of the GET_POOL_NAME procedure. The call should look like the following: <div class="code"><span class="code-lines">1</span>GET_POOL_NAME modelid: (my_modelid) instid: (my_instid) result: pool_name</div>Mateusz Dziedzic2017-12-07T12:59:51ZUsage of ado2Odbc.dllSwantehttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=7614612017-02-07T15:32:33Z2017-02-07T15:31:53ZHello,<br /><br />I try to connect to a Oracle 11 or 12 database using the details from here:<br />https://www.adoxx.org/live/faq/-/message_boards/message/64131?p_p_auth=QKq5Dsxe<br /><br />I don't think the AdoOdbcConnect Operation is working. Is there any documentation for the correct parameters? E.g. port and host?<br />Debug seems not to work with CALL. <br /><br />Any ideas or links to hidden documentation?<br /><br />Greetings<br />SwanteSwante2017-02-07T15:31:53ZRE: AUTOPDPSwantehttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=6573762016-09-04T09:44:57Z2016-09-04T09:44:57ZThank you WilfridSwante2016-09-04T09:44:57ZRE: AUTOPDPWilfrid Utzhttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=6570692016-09-03T10:28:42Z2016-09-03T10:28:42ZDear Swante,<br /><br />the approach you describe here is a feasible way to get your executable running. <br />Another way is to have it directly in the installation folder and get it to work without the need to copy things. The GET_PATH AdoScript command would return the installation directory and you can the execute from there (similar as the CWD returns the install dir of the tool). <br /><br />It is up to you how you would like the build engine to have the file, as part of the library you have more control as it is part of the configuration rather than the build job. Please let us know in a small read me as part of the autopdp build job how you would like us to handle the extension when configuring the job. <br /><br />Thanks, wilfridWilfrid Utz2016-09-03T10:28:42ZAUTOPDPSwantehttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=6559652016-08-31T15:20:31Z2016-08-31T15:19:25ZHello,<br /><br />I'm planing to built a standalone version soon. I've written a small executable jar which is currently in the filestroage. I've added a small Procedurece in AppInitalized which copies the jar into the temp dir (I've had right problems with cwd) and executes it via SYSTEM. This works good! <br />I've read that you can add your extension for building your standalone software. Point 1.1.3 in<br />https://www.adoxx.org/live/documents/10157/4213f6ff-1b8a-4d25-92df-0b8649f0a7b4<br /><br /> But I don't understand how to access them via AdoScript to execute the jar?<br /><br />My current apporoach:<br /><div class="code"><span class="code-lines"> 1</span>CC "AdoScript" GET_TEMP_FILENAME<br /><span class="code-lines"> 2</span>#--> RESULT filename:strValue<br /><span class="code-lines"> 3</span>SETG jar_file:(copy(filename, 0, (bsearch(filename,"\\", LEN filename))+1) + "JavaExport.jar")<br /><span class="code-lines"> 4</span><br /><span class="code-lines"> 5</span><br /><span class="code-lines"> 6</span># ---------------------------------------------------<br /><span class="code-lines"> 7</span># Execute the jar.<br /><span class="code-lines"> 8</span># @in_args string Arguments for Java call<br /><span class="code-lines"> 9</span># @in_message string Message which occour during execution<br /><span class="code-lines">10</span># @in_debug integer 1 = show Java call, else not<br /><span class="code-lines">11</span># @out_out_file string absolute path to out file<br /><span class="code-lines">12</span># @out_error_file string absolute path to err file<br /><span class="code-lines">13</span># ---------------------------------------------------<br /><span class="code-lines">14</span>PROCEDURE global EXECUTE_JAVA in_args: string<br /><span class="code-lines">15</span> in_message: string<br /><span class="code-lines">16</span> in_debug: integer<br /><span class="code-lines">17</span> in_out_file_format: string<br /><span class="code-lines">18</span> out_out_file: reference<br /><span class="code-lines">19</span> out_error_file: reference<br /><span class="code-lines">20</span>{<br /><span class="code-lines">21</span> <br /><span class="code-lines">22</span> CC "AdoScript" MSGWIN (in_message)<br /><span class="code-lines">23</span> <br /><span class="code-lines">24</span> # set stream files<br /><span class="code-lines">25</span> CC "AdoScript" GET_TEMP_FILENAME<br /><span class="code-lines">26</span> SETL out_out_file:(filename + "." + in_out_file_format)<br /><span class="code-lines">27</span> <br /><span class="code-lines">28</span> CC "AdoScript" GET_TEMP_FILENAME<br /><span class="code-lines">29</span> SETL out_error_file:(filename + ".txt") <br /><span class="code-lines">30</span> <br /><span class="code-lines">31</span> CC "AdoScript" FILE_EXISTS file: (jar_file)<br /><span class="code-lines">32</span> # -->RESULT exists: 1|0<br /><span class="code-lines">33</span> <br /><span class="code-lines">34</span> #do the file exists?<br /><span class="code-lines">35</span> IF (exists = 0) {<br /><span class="code-lines">36</span> CC "AdoScript" FILE_COPY from:(skriptPath + "JavaExport.jar") to:(jar_file)<br /><span class="code-lines">37</span> }<br /><span class="code-lines">38</span><br /><span class="code-lines">39</span> SETL statement: ("java -jar " + jar_file + " -out_file " + out_out_file + " -error_file " + out_error_file + " " + in_args)<br /><span class="code-lines">40</span> <br /><span class="code-lines">41</span> IF (in_debug = 1) {<br /><span class="code-lines">42</span> CC "AdoScript" EDITBOX text:(statement)<br /><span class="code-lines">43</span> }<br /><span class="code-lines">44</span> SYSTEM (statement)<br /><span class="code-lines">45</span> <br /><span class="code-lines">46</span> CC "AdoScript" MSGWIN hide<br /><span class="code-lines">47</span>}<br /></div>Swante2016-08-31T15:19:25Z@INCLUDE with variablesSwantehttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=5088482016-04-04T07:59:39Z2016-04-04T07:36:17ZHello,<br /><br />I want to use a GraphRep for multiple classes. So I add the complete GraphRep into "file.asc".<br />I add some global variables in the AppInitalized Event<div class="code"><span class="code-lines"> 1</span>CC "Core" GET_CLASS_ID classname:("__ModelTypeMetaData__")<br /><span class="code-lines"> 2</span> #--> RESULT ecode:intValue classid:intValue<br /><span class="code-lines"> 3</span><br /><span class="code-lines"> 4</span> SETL debug:("Yes")<br /><span class="code-lines"> 5</span> IF (debug = "Yes") {<br /><span class="code-lines"> 6</span> SETG skriptPath:("C:\\<my_path>\\")<br /><span class="code-lines"> 7</span> }<br /><span class="code-lines"> 8</span> ELSE {<br /><span class="code-lines"> 9</span> SETG skriptPath:("db:\\")<br /><span class="code-lines">10</span> }<br /><span class="code-lines">11</span> CC "Core" SET_ATTR_VAL objid:(classid) attrname:("Script path (source)") val:(skriptPath)<br /></div><br />I tested:<br /><br />doesn't work ("Script path" is a reference in __D-construct__ )<div class="code"><span class="code-lines">1</span>GRAPHREP layer:-2 sizing:asymmetrical<br /><span class="code-lines">2</span>AVAL scriptPath:"Script path"<br /><span class="code-lines">3</span>@INCLUDE (scriptPath+"file.asc")<br /></div><br />doesn't work<br /><div class="code"><span class="code-lines">1</span>GRAPHREP layer:-2 sizing:asymmetrical<br /><span class="code-lines">2</span>SET scriptName:"C:\\<my_path>\\file.asc"<br /><span class="code-lines">3</span>@INCLUDE (scriptName)<br /></div><br />works - but this is useless<br /><div class="code"><span class="code-lines">1</span>GRAPHREP layer:-2 sizing:asymmetrical<br /><span class="code-lines">2</span>@INCLUDE ("C:\\<my_path>\\file.asc")<br /></div><br />Is there any trick to fix this?<br /><br />Edit:<br />The idea is to add a small pice of GraphRep at each child-classes. The main part is equal.<br /><br />Greetings<br />SwanteSwante2016-04-04T07:36:17ZUsage of PROCEDURESwantehttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=4656292016-02-24T17:44:19Z2016-02-24T17:44:19ZHello,<br /><br />I've got problems with the call of PROCEDUREs. I don't see any usage of the reference prameter in the documentation.<br /><br />What I understand:<br /><em>Attribute parameters </em>with <em>value parameters </em>is a normal read-only IN-Paramter (Call by value)<br /><em>Attribute parameters </em>with <em>reference parameters </em>is read-write IN-OUT-Paramter (Call by reference)<br /><br />I try to define a global PROCEDURE which should be called in some EVENTs.<br /><div class="code"><span class="code-lines"> 1</span>#===============================================<br /><span class="code-lines"> 2</span>#---- INIT GLOBAL VARS<br /><span class="code-lines"> 3</span>ON_EVENT "AppInitialized"<br /><span class="code-lines"> 4</span>{<br /><span class="code-lines"> 5</span> PROCEDURE global GET_POOL_NAME modelid: integer instid: integer result: reference<br /><span class="code-lines"> 6</span> {<br /><span class="code-lines"> 7</span> #get the class_id of the object<br /><span class="code-lines"> 8</span> CC "Core" GET_CLASS_ID objid:instid<br /><span class="code-lines"> 9</span> SET class_id: (classid)<br /><span class="code-lines">10</span> <br /><span class="code-lines">11</span> #get pool class_id<br /><span class="code-lines">12</span> CC "Core" GET_CLASS_ID classname:("Pool")<br /><span class="code-lines">13</span> SET pool_class_id:(classid)<br /><span class="code-lines">14</span> <br /><span class="code-lines">15</span> #only NOT pools should go on<br /><span class="code-lines">16</span> IF (class_id <> pool_class_id) {<br /><span class="code-lines">17</span> CC "Core" GET_ATTR_VAL objid: (instid) attrname: ("Position")<br /><span class="code-lines">18</span> SET my_position: (val)<br /><span class="code-lines">19</span> SET result:("Drin")<br /><span class="code-lines">20</span> }<br /><span class="code-lines">21</span> ELSE {<br /><span class="code-lines">22</span> SET result:("Draußen")<br /><span class="code-lines">23</span> }<br /><span class="code-lines">24</span><br /><span class="code-lines">25</span> }<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>ON_EVENT "CreateInstance"<br /><span class="code-lines">30</span>{<br /><span class="code-lines">31</span> SET my_classid: (classid)<br /><span class="code-lines">32</span> SET my_instid: (instid)<br /><span class="code-lines">33</span> SET my_modelid: (modelid)<br /><span class="code-lines">34</span> SET pool_name: ("")<br /><span class="code-lines">35</span> <br /><span class="code-lines">36</span> GET_POOL_NAME modelid:(my_modelid) instid:(my_instid) result:(pool_name)<br /><span class="code-lines">37</span><br /><span class="code-lines">38</span> CC "Core" GET_ATTR_ID classid: (my_classid) attrname: ("Pool name")<br /><span class="code-lines">39</span> SET pool_name_attrid: (attrid)<br /><span class="code-lines">40</span> CC "Core" SET_ATTR_VAL objid: (my_instid) attrid: (pool_name_attrid) val: (pool_name) <br /><span class="code-lines">41</span>}<br /></div><br /><br />When opening a model the error-message(s) pops up. (see attached)<br /><br />How do i define a reference attribute?<br /><br />Greetings,<br />SwanteSwante2016-02-24T17:44:19ZRE: InterRef / Model PointerSwantehttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=4590672016-02-15T06:58:13Z2016-02-15T06:58:13ZI've done it with:<div class="code"><span class="code-lines">1</span><br /><span class="code-lines">2</span>EXPR type:string expr:(try(aval (VAL (irtmodels ("Referenced Process")), "Ad-hoc"),"No")) <br /></div><br />Works pretty well.Swante2016-02-15T06:58:13ZRE: InterRef / Model PointerMehmet Albayrakhttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=4442952016-01-21T13:03:01Z2016-01-21T13:02:41ZYou can create an attribute of type record and list the values of the attributes in a table. <br />Note that, when you use the command "SET_ATTRIBUTE_VAL" the 'objid' is the rowid of the corresponding row. This is obtained as a result of the command "ADD_REC_ROW". Your code would look like:<br /><br /><div class="code"><span class="code-lines">1</span>CC "Core" ADD_REC_ROW objid: (nObjId) attrid: (nRecAttrId)<br /><span class="code-lines">2</span>SET nRecRowId: (rowid)<br /><span class="code-lines">3</span><br /><span class="code-lines">4</span>CC "Core" SET_ATTR_VAL objid: (nRecRowId) attrname: (sColumnName) val: (sAddHocVal)<br /></div><br />The rest is similar to the above AdoScript. If you have any difficulties with the implementation please do not hesitate to ask.Mehmet Albayrak2016-01-21T13:02:41ZRE: InterRef / Model PointerSwantehttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=4437002016-01-20T15:50:30Z2016-01-20T15:50:30ZI've tested your suggestion.<br />It works fine when hust using one sub-process. But when using at least two sub-processing reffering to the same process. Activating one will set it for both sub-processes. Is there a way to embed the reference into a new class with it's own GraphRep? So I need not to modify the attribute in the sub-process directly.<br /><br />I will try a new way:<br />Implement a Sub-Process Modeltype. Add "Adhoc" to AttRep und design GraphRep.<br />Remove Adhoc from AttrRep in the sub-process class. When Reffering to this model just overwrite sub-process-instance attributes to display the correct collapsed attributes (~).Swante2016-01-20T15:50:30ZRE: InterRef / Model PointerMehmet Albayrakhttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=4418422016-01-19T11:11:04Z2016-01-19T10:45:16Z1) Yes, there is a way to do:<br />In order to adjust attribute values of the Sub-process to the attribute values of the referring "Sub-Process"-instance you can work with event handler. E.g. the event handler "ActivateModel" is always triggered if one model is activated. Therefore if you follow the model pointer of the "Sub-process"-instance this event is triggered as you activate the referenced model. The following AdoScript code ,which is also integrated in the attached library, is an example that reads the value of the "AdHoc" attribute of the "Sub-Process"-instance and edits the value of the referenced process.<br /><br /><br /><br /><div class="code"><span class="code-lines"> 1</span>ON_EVENT "ActivateModelWindow" {<br /><span class="code-lines"> 2</span>#save the pregiven parameters<br /><span class="code-lines"> 3</span> SET nModelId: (modelid)<br /><span class="code-lines"> 4</span>#get ALL incoming references and assign the result to variables<br /><span class="code-lines"> 5</span> CC "Core" GET_INCOMING_INTERREFS modelid: (nModelId)<br /><span class="code-lines"> 6</span> SET nRefCount: (refcount)<br /><span class="code-lines"> 7</span> SET sRefText: (reftext)<br /><span class="code-lines"> 8</span>#if there is no incoming references than exit the algorithm<br /><span class="code-lines"> 9</span> IF (nRefCount=0) {<br /><span class="code-lines">10</span> EXIT<br /><span class="code-lines">11</span> }<br /><span class="code-lines">12</span><br /><span class="code-lines">13</span># Parse the above outcome<br /><span class="code-lines">14</span> LEO parse: (sRefText) get-int-value:nAttrId:"srcattrid"<br /><span class="code-lines">15</span> LEO parse: (sRefText) get-int-value:nObjId:"srcobjid"<br /><span class="code-lines">16</span> LEO parse: (sRefText) get-int-value:nRefModelId:"srcmodelid"<br /><span class="code-lines">17</span># Get attribute id of the interref "Referenced subprocess"<br /><span class="code-lines">18</span> CC "Core" GET_CLASS_ID classname:"Sub-Process"<br /><span class="code-lines">19</span> SET nSubProcessClassId: (classid)<br /><span class="code-lines">20</span> CC "Core" GET_ATTR_ID classid: (nSubProcessClassId) attrname:"Referenced subprocess"<br /><span class="code-lines">21</span> SET nRSp_AttrId: (attrid)<br /><span class="code-lines">22</span># If the referencing interref is of type "Referenced subprocess" <br /><span class="code-lines">23</span># than read the value of the "Sub-process"-instance and wirte it into the referenced model<br /><span class="code-lines">24</span> IF (nAttrId=nRSp_AttrId) {<br /><span class="code-lines">25</span># if the model is not opened -> exit <br /><span class="code-lines">26</span> CC "Modeling" IS_OPENED modelid: (nRefModelId)<br /><span class="code-lines">27</span> SET nIsOpened: (isopened)<br /><span class="code-lines">28</span> IF (nIsOpened = 0) {<br /><span class="code-lines">29</span> EXIT<br /><span class="code-lines">30</span> } <br /><span class="code-lines">31</span> CC "Core" GET_ATTR_VAL objid: (nObjId) attrname:"AdHoc"<br /><span class="code-lines">32</span> SET sAttrVal: (val)<br /><span class="code-lines">33</span> CC "Core" GET_ATTR_ID classid: (nModelId) attrname:"AdHoc"<br /><span class="code-lines">34</span> SET nM_AdHoc_AttrId: (attrid)<br /><span class="code-lines">35</span> CC "Core" SET_ATTR_VAL objid: (nModelId) attrid: (nM_AdHoc_AttrId) val: (sAttrVal)<br /><span class="code-lines">36</span> }<br /><span class="code-lines">37</span>}<br /></div><br /><br />2) Yes this is a good approach.<br />The question is, if you want to adjust attribute values of two different instances (model, object); "When do you wnat to trigger it?"<br />- If it should be adjusted after the model is activated than .... see above.<br />- If you want the adjustment dynamically when the "Sub-Process"-instance-attribute is changed than you can use the events "SetAttributeValue" or "AfterEditAttributeValue". The implementation would be similar as above.<br /><br />You can find the online AdoScript documentation, where you can find all the events and the Adoscript commands at the following link:<br /><a href="https://www.adoxx.org/live/adoscript-documentation">https://www.adoxx.org/live/adoscript-documentation<br /><br /></a>Mehmet Albayrak2016-01-19T10:45:16ZInterRef / Model PointerSwantehttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=4418172016-01-19T10:09:02Z2016-01-19T10:09:02ZHello,<br /><br /> I've got a problem during developing my own BPMN 2.0 Approach.<br /><br /><strong>What I've got:</strong><br /><br /> #(Small Part)<br /> MODELTYPE "Well-formed BPMN 2.0"<br /> from:none<br /> plural:"Well-formed BPMN 2.0"<br /> attrrep:"Well-formed AttrRep"<br /> graphrep:"Well-formed GraphRep"<br /> INCL "Sub-Process"<br /><br /> The problem is the sub-process. I want to make more "sexy" and look more like it should look like.<br /><br /> My (important) attributes for Sub-Process:<br /> - The InterRef Attribute<br /> REFDOMAIN max:1<br /> MODREF<br /> mt: "Well-formed BPMN 2.0"<br /> max:1<br /><br /> - ModelPointer with default-value: "Well-formed BPMN 2.0"<br /> - Enumeration (Yes/No) "Ad-hoc"<br /><br /> -> The "show submodel" functionality works good. <br /><br /><br /><strong>What I need / My idea:</strong><br /> I defined in __ModelTypeMetaData__ an enumeration attribute "Ad-hoc" - default "No". It should not be changed in AttrRep. In GraphRep I just display it for debugging in the background. Works!<br /><br /> But when pressing "show submodel" I want to SET the referenced model __ModelTypeMetaData__ "Ad-hoc" attribute with the attribute value from the referring class (something like a function call?)<br /><br /> There are more Attributes to set for changing the border to dodded-line or show some markers (Ad-hoc, compression, loops). <br /><br /> Is there a way to do so?<br /> Is this a good approach or is there a better way?<br /><br /> Greetings<br /> SwanteSwante2016-01-19T10:09:02Z