Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Error:anotebk-889
Answer
3/31/16 1:12 PM
Hello,
I extend a tool so as to implement semantic annotations in Business Process Models (BPMN 2.0) with automated suggestions. Specifically, the tool will retrieve and recommend annotations on Tasks and SubProcceses of a business process model using an ontology based data matching strategy.The user will have the choice either to select one of the automated suggestions (select and click "ok") or manually to select an annotation using the "Semantic Annotation" chapter of instance's notebook (see the attached file "automaticallySuggestedAnnotations").In the second case of manually selection, when the user click the "cancel" button of the "Select a Concept" box, i want the notebook of the processed task on chapter "Semantic annotation" to display on the screen automatically so as the user could manually select an annotation with an ontology.I have written the below code for this reason (see the ELSE code):
 1IF (endbutton = "ok"){     
 2  SET s_selected_annotation: (selection)
 3  CC "Core" REMOVE_ALL_INTERREFS objid: (s_selected_objid)  attrid: (semanticAnnotID)     
 4  CC "Core" ADD_INTERREF attrid: (semanticAnnotID) objid:  (s_selected_objid) tmodelname: (sModelName) tmodeltype: "Ontology  Model" tclassname: "Class" tobjname: (s_selected_annotation)
 5}
 6ELSE{     
 7  CC "AdoScript" INFOBOX "Annotation could not be set  automatically, select one manually"
 8  CC "Modeling" CLOSE_ALL_NOTEBOOKS modelid: (g_modelid)     
 9  CC "Modeling" EXEC_NOTEBOOK objid: (s_selected_objid)     
10  CC "Modeling" SHOW_NOTEBOOK_CHAPTER objid: (s_selected_objid)  chapter:7 chapter-page:1
11}


But the follow error code is displayed. Error Code: anotebk:889 (see the attached file "ADOxx runtimeError889") and then a crush dump file is created (see the attached file "crashDumpFile").
I also send the full code of event "AfterEditAttributeValue" that i have written until now. The code that it has problem is below the comment with the number 13 and 24.

[font='Courier New', Courier, monospace]I would appriciate any help!!
Attachment

Attachment

Attachment

Attachments: anotbk889_Error.PNG (65.3k), automaticallySuggestedAnnotations.PNG (73.3k), crashDumpFile.PNG (48.9k), event_AfterEditAttributeValue.asc (12.7k)

RE: Error:anotebk-889
Answer
3/31/16 1:27 PM as a reply to Ioanna Ramoutsaki.
The problem relates to the command CLOSE_ALL_NOTEBOOKS. The event AfterEditAttributeValue is triggered if the attribute ‘Name' is changed. But only if you close the notebook or change to another attribute scope. Therefore closing the notebook (within the AdoScript) when it the event is triggered within its scope results in the runtime error.

If you change the name of the instance without opening the  notebook (e.g. through the tabular view) you should not have any errors, as the scope of the script is not within the notebook.

Therefore we have implemented a solution that enables delayed AdoScript exeuction, essentially saving the AdoScript, waiting for the action within the notebook is completed and closed and then dynamically executing it. The functionality saves your AdoScript that should be executed in the ‘AfterEditAttributeValue’  in a global variable called ‘mDelayedAdoScript’ (as a map). This variable is declared within the event AppInitialized and is empty until the name of a task or sub-process instance is changed. This AdoScript is triggered when the notebook of the appropriate instance is closed. The check if the notebook is open and the execution of the saved AdoScript is done by the event ‘MOCTimer’. This event is triggered every 55ms and works as a timer (that we saved before in the variable mDelayedAdoScript) only if the notebook is closed. You can download the library and the AdoScripts at the folllowing link:
Download Link

Additionally we have added a debug logger to track the commands in the ‘Event Logging’ window dynamically - please feel free to remove this development functionality in case you have completed your implementation task.