Hi ARIS-Fans,
sorry, but I need a little assistence.
I have an object. This can ba a model, an objdef, a symbol/occurance, a connection or an attribut.
Now I need to know the object type. But because some of these objects are self defined, the way over .TypeNum() does not work at all. On every server the typenum is different. Thats why I want to use the GUID of the object type. I know the GUID because in Administration/Method I can see it.
But witch function gives me the GUID of the object type?
I'm sure, it is easy. But I can't find it in the ARIS helpsite. We use ARIS 9.8 on two servers.
Many thanks in advance
Holger
Hi Holger,
I only have ARIS 10.0.12 at my hand, but worked with ARIS 9.8 in the past and I'm 99% certain it works like described here with your ARIS 9.8 too:
The Aris Script classes Model and ObjDef inherit methods from the ARIS Script class Item.
Item, ObjOcc, CxnOcc and Attr all implment a method called "KindNum()", whose result you can compare with certain Constant.CID_*** values to find out what exact kind of object you're looking at.
With this distinction being made, you're no longer looking at a generic object, instead you know exactly to which class it belongs to and which specific methods are applicable for it.
You can then probably use
var methodInfo = ArisData.ActiveFilter();
which will assign an object of the Aris Script class MethodFilter to the variable methodInfo.
If you want the Object type in a human readable format:
The class MethodFilter extends the class ArisMetaModel and thus comes with useful methods such as AttrTypeName(...), ObjTypeName(...), SymbolName(...) and ModelTypeName(...), into which you just have to plug the type number to get the name as a string.
If you want the Object type in the form of a GUID (a machine readable format):
The class MethodFilter extends the class ArisMetaModel and thus comes with useful methods such as UserDefinedAttributeTypeGUID(...) and UserDefinedModelTypeGUID(...), into which yoyu just have to plug the type number to get the GUID number as a string. Admitteldly in my ARIS 10.0.12 API documentation I'm missing a method here for UserDefinedObjectTypeGUID(...), which seems like an oversight on SoftwareAGs end.
EDIT: You can also use the method getAPIName(...) of MethodFilter with any item kind to figure out the API-Name/GUID
Either way:
How you can get the type number differs a little bit for each class, I recommend checking the individual classes to find out how to do it. Just make sure to only use the methods of individual classes after you made sure the object is of that class, otherwise you'll get terrible method not found exceptions.
Hope this helps.