#=============================================================# # This Library attribute must contain at least one charracter # #=============================================================# #---- INIT GLOBAL VARS ON_EVENT "AppInitialized" { } ON_EVENT "AfterEditAttributeValue" { #preset: modelid, instid, attridattrtypeid # Only for use case diagrams CC "Core" GET_MODEL_INFO modelid:(modelid) IF (modeltype = "Use Case Diagram") { # Update logic CC "Core" GET_INCOMING_INTERREFS modelid:(modelid) # Parse the LEO text the first time to get the number of elements in it LEO parse:(reftext) get-elem-count:elemcount # Go through each element in the LEO text FOR curelem from:0 to:(elemcount - 1) { # Access the information of the current element LEO parse:(reftext) set-cur-elem-index:(curelem) get-int-value:srcobjid:"srcobjid" get-int-value:srcmodelid:"srcmodelid" # to update instance attributes, the model must be loaded - check if so CC "Core" IS_MODEL_LOADED modelid:(srcmodelid) SET isInitialLoaded:(isloaded) IF (NOT (isInitialLoaded)) { CC "Core" LOAD_MODEL modelid:(srcmodelid) } #set the change value and save model CC "Core" SET_ATTR_VAL objid:(srcobjid) attrname:"State" val:"Changed" CC "Core" SAVE_MODEL modelid:(srcmodelid) #if initially closed, close again IF (NOT (isInitialLoaded)) { CC "Core" DISCARD_MODEL modelid:(srcmodelid) } } } } ITEM "Shell window" modeling:"Extras" SET endbutton:"ok" WHILE (endbutton = "ok") { CC "AdoScript" EDITBOX text:(adoscript) title:"Enter the code you want to test..." oktext:"Go!" IF (endbutton = "ok") { SET adoscript:global:(text) EXECUTE (text) } }