InterRef / Model PointerInterRef / Model PointerRE: 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