Hi all,
We are trying to generate ARIS Connect link inside a report like Publisher. There are some selected models and we want to generate the link for the model inside the report, so the user can click on it and be able to go to the ARIS Connect Model Diagram tab. Is there any convention or direct function code for this?
Hi,
The Connect links looks like this:
http://<servername>/#<tenant>/item/c.<factSheet>.<DBName>.<GUID>.<Version>
Where :
- server name is the url of your server
- tenant is the tenant name (usually 'default')
- factSheet is the name of the factsheet of the Connect item (like process, system, ...)
- DBName is the name of the Database
- GUID is the guid of the model
- Version is usually -1 if you publish the workspace
The only tricky part is the factsheet name, which depends on your customizing / connect configuration
Regards,
Didier
I have recently created a report that makes up the url because we needed to convert our Process List from Publisher URLs, to Connect URL's having migrated.
Generating the script is a relatively straight forward activity that can be achieved in the scripting. Nowak, is entirely correct in the make up the url - however, the GUID is not the actual model GUID, it is a compressed version of it.
To generate the Compressed GUID you'll need something like:
function compressGuid(guid) {
var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
var compressedGuid = "";
var bucket = 0;
var bits = 0;
for (var i = 0; i < guid.length(); i++) {
var rValue = guid.charAt(i)
if (rValue >= 48 && rValue <=57)
fValue = rValue - 48;
else if (rValue >= 97 && rValue <= 102)
fValue = 10 + rValue - 97;
else if (rValue >= 65 && rValue <= 90)
fValue = 10 + rValue - 65;
else
continue;
bucket = (bucket << 4) + fValue;
bits+=4;
if (bits >= 6) {
bits-=6;
sValue = bucket >> bits;
bucket = bucket ^ (sValue << bits);
compressedGuid += code.charAt(sValue);
}
}
if (bits > 0) {
compressedGuid += code.charAt(bucket << (6 - bits));
}
return compressedGuid;
}
and for the model types, you will need to create a function in your report that will string replace the model type for the correct factsheet ( or item as Connect knows it).
Hope this helps.
Hi,
There were a couple of errors in Dave's code, but the attached code is verified to work in ARIS 9.8.7. Also, I've created a convenience function getLink(sGUID, sFactsheet, iVersion) which allows you to pass in a string GUID and optional factsheet & version, and return an encoded URL. Note that when a factsheet is not defined in a Connect link, it simply goes for the default factsheet for that item.
function compressGuid(guid) { var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; var compressedGuid = ""; var bucket = 0; var bits = 0; //for (var i = 0; i < guid.length(); i++) { for (var i = 0; i < guid.length; i++) { //var rValue = guid.charAt(i) var rValue = guid.charCodeAt(i); if (rValue >= 48 && rValue <=57) fValue = rValue - 48; else if (rValue >= 97 && rValue <= 102) fValue = 10 + rValue - 97; else if (rValue >= 65 && rValue <= 90) fValue = 10 + rValue - 65; else continue; bucket = (bucket << 4) + fValue; bits+=4; if (bits >= 6) { bits-=6; sValue = bucket >> bits; bucket = bucket ^ (sValue << bits); compressedGuid += code.charAt(sValue); } } if (bits > 0) { compressedGuid += code.charAt(bucket << (6 - bits)); } return compressedGuid; } function getLink(sGUID, sFactsheet, iVersion) { var CONNECT_URL = "http://lubuntu-aris:1080"; var g_nloc = Context.getSelectedLanguage(); if (iVersion == null) iVersion = -1; (sFactsheet == null) ? sFactsheet = "" : sFactsheet = sFactsheet + "."; var oDatabase = ArisData.getActiveDatabase(); var sTenantName = ArisData.getTenantName(); var serverName = oDatabase.ServerName ( ); var sDBName = oDatabase.Name(g_nloc); sDBName = sDBName.replace(".", "~d"); var linkURL = CONNECT_URL + "/#" + sTenantName + "/item/c." + sFactsheet + sDBName + "." + compressGuid(sGUID) + "." + iVersion; var encodedURL = encodeURI(linkURL); return encodedURL; } getLink("c590a5e0-5508-11e7-0ccd-001c42aee4f1", null, null) // returns: http://lubuntu-aris:1080/#default/item/c.ARISApp%20-%20ARIS%20Notifier%20-%20Filter.xZCl4FUIEecMzQAcQq7k8Q.-1
Thanks: this worked very well for getting nice reports on content linked to their presentation in ARIS Connect! One adjustment: I needed to switch back from guid.length to guid.length() for the GUID's I got from the Model.GUID() method. Somewhat inconsistent representations, I believe!