Is there a way in ARIS Script to select objects that are definition copies? I am looking for a method that would return the same collection as though I were using 'Find' in the Explorer in Business Architect with the following parameters:
Find what = Objects
Type = (all objects)
Default symbol = Process Interface
Rick Beddoe
Cargill Aris Technical Analyst
Minneapolis, MN, USA
Hello!
Try to use the "Find" method of the database object. The definition copies always have the same type and name. For example:
var oDB = ArisData.getActiveDatabase(); var sName = "Name"; var aObjDefs = oDB.Find(Constants.SEARCH_OBJDEF, Constants.OT_FUNC, Constants.AT_NAME, -1, sName, Constants.SEARCH_CMP_EQUAL);
Hope, this helps.
Thanks Ilya,
I am trying to select ALL objects (not objects of a spcific name) with the symbol type of Process Interface. The find (as well as createSearchItem) don't seem to have the ability to search for objects based on their Default symbol.
Rick Beddoe
Cargill Aris Technical Analyst
Minneapolis, MN, USA
Aha. That's it. I should have known. Sometimes it is hard to see the forest for the trees.
Here's what I did:
//oGroup is the selected group //JSLINQ is from the JSLINQ library var oDataBase = oGroup.Database(); var aObjDefs = oDataBase.Find(Constants.SEARCH_OBJDEF, Constants.OT_FUNC); var aPIObjs = JSLINQ(aObjDefs) .Where(function(oPIObj){return oPIObj.getDefaultSymbolNum()==94;}) .Select(function(oPIObj){return oPIObj;}) .ToArray();
Thanks again for the response Ilya.
Rick Beddoe
Cargill Aris Technical Analyst
Minneapolis, MN, USA
Hi Anosh,
You would still use the Find function on the database. Create an array of the object types you're looking for:
var oDataBase = oGroup.Database(); var aObjDefs = oDataBase.Find(Constants.SEARCH_OBJDEF, [Constants.OT_FUNC,Constants.OT_EVT]);
Rick Beddoe
Cargill Aris Technical Analyst
Minneapolis, MN, USA