Hi,
I am new to Aris reports and macros. Glad to be here communicating with all you expert.
I now trying to re-writing a legacy VB script which export process definitions to excel. My goal is to create a report in ARIS Business Architect 7.1 with javascript which can generate the same report as VB script.
In the VB script, it get an 'object ID' of numeric type through a COM object. The code is
<code>
Set oProcessDefList = CreateObject("ARIS.OBJDEFLIST." & cARISVersion)
...
oObjDef = oProcessDefList.Get(nI)
...
oWorksheet.Cells(nRow, A).value = oObjDef.ObjectID()
</code>
The ObjectID() method in the last line returns a number and put it into a cell.
In javascript, I tried Item.GUID(), Item.ObjectID() and Item.OID() method to get object ID. None of them returns the same value as what VB script returns. I also tried some attributes like AT_EGOV_ELAK_ID, AT_ID, AT_OBJ_ACS_ID,AT_RBE_OBJ_ID, and AT_EXTERNAL_ID, still not correct. It seems in new version of Aris, the object ID of numeric type is no longer supported.
My question is if there is a way to get the numeric object ID with javascript. Or if it is possible to create COM object in javascript like it is in VB script?
Any tips is appreciated. Thanks in advance.
Regards,
Will
Hi Will,
the method to use is "Item.ObjectID()" which returns the objectID as a string.
If you really need to create an array in JavaScript just use var myArray = new Array() or the short form, for example if you have 2 ObjOccs (occ1 and occ2), which should be placed in an array:
var myArray = [occ1, occ2]
You should not need to use the Microsoft-specific COM in JavaScript. You can create excel output using the built-in Excel support (Context.createExcelWorkbook(...)).
I hope this helps. Feel free to ask if youo have any furter questions.
BR, Torsten
Hi Torsten,
Thanks for your help and sorry for late to reply.
I have tried the method "Item.ObjectID()" which returns a String, but what I need is object ID of numeric type.
Maybe I failed to express my problem clearly. Let me try again. Previouse version of ARIS, say ARIS 5.0, supports two types of objectID. The string one looks like "aa####bb##" just the same as what we got by using "Item.ObjectID()" and the other one is numeric like 183000. The numeric objectID is retrieved through a Microsoft-specific COM object. As my company have decided to update ARIS to version 7.1, I can no longer get the numeric objectID which is critical to our other applications. That's why I have to find the method returning numerci objectID or to find a way to use COM object in ARIS script.
Really appreciate your help.
Regards,
Will
Hi Will,
there is a way to get the old-style OID:
use Item.OID() which returns an array of 4 integers:
[0] is always 0
[1] is the first integer you'll need
[2] is the second integer you'll need
[3] has not been used in ARIS 5
the old OID was a concatenation of value[2] and value[1] using string format "%u%u".
BR,
Torsten
Hi Torsten,
The method works! Thank you so much!
Regards,
Will