Hi guys,
I am trying to find by script an UML2 Class by using:
db.Find(Constants.SEARCH_OBJDEF, null, Constants.AT_NAME, nLocale, OpMalGrN, Constants.SEARCH_CMP_WILDCARDS)
But I am not getting any response, even if there are 2 uml2 classes with the exact name.
What am I doing wrong?
Thanks,
Ignacio
Hi Ignacio,
many UML2 elements are "groups" in Aris, because in UML they "contain" other elements. So the search has to me performed for groups. The second issue is the second parameter (null). When searching for a UML2 class, please specify the type as second parameter: Constants.OT_UML2_CLASS.
The following short script shows it all together:
var db = ArisData.getActiveDatabase()
var nLocale = Context.getSelectedLanguage()
var oFound = db.Find(Constants.SEARCH_GROUP, Constants.OT_UML2_CLASS, Constants.AT_NAME, nLocale, "MyClass*", Constants.SEARCH_CMP_WILDCARDS)
var size = oFound.length
Dialogs.MsgBox("number of classes found: "+size)
BR, Torsten