Hi all,
iam currently trying to produce a process manual with the script wizard. I know how to report single objects and multiple attributes. But my goal is to ouput functions and their CONNECTED objects (in my case business rules and capabilities) including attributes in a table.
Any ideas how to achieve that with script or wizard?
Hi Roland,
I'm afraid that there's no way to get connected occurrences through Script Wizard. You should use scripting to achieve this.
1. Use the ObjOcc.getConnectedObjOccs( int symbolType) method. This returns an array of object occurrences connected to the object occurrence having the specific symbol type.
// Gets a list of the events connected to myFunction. connectedEvents = myFunction.getConnectedObjOccs([Constants.ST_EV]);
2. You can also get the connected objects occurrences finding first the connections between them.
// Gets the outgoing connections of myFunction connList = myFunction.Cxns(Constants.EDGES_OUT); // then gets the target object for each connection for(var i=0; connList.length > i; i++){ targetOcc = connList[i].TargetObjOcc(); }
Hope this helps.
Here's a more extensive example.You can also use the ARIS script help (Help menu in ABA) for further reference.
In this example is assumed that the script is excecuted from an EPC model.
Hope this helps.
// Define a user data type to store the results __usertype_outStruct = function() { this.sModel = ""; this.sFunc = ""; this.sSat = ""; this.__createNew = function() { return new __usertype_outStruct; } } function main(){ var modelList, currModel, funcList, currFunc, satelliteList, currSatellite; // List of variables var out = new Array(); // Output array var oCurrOut; modelList = ArisData.getSelectedModels(); // Gets the list of selected models for(var i=0; modelList.length > i; i++){ // For each model in the list currModel = modelList[i]; // Gets the current model funcList = currModel.ObjOccListBySymbol([Constants.ST_FUNC]); // Gets the list of functions in the model funcList = ArisData.sort(funcList,Constants.AT_ID,locale); // Sorts the list by ID for(var j=0; funcList.length > j; j++){ // For each function occurrence in the current model currFunc = funcList[j]; // Gets the current function occurrence satelliteList = currFunc.getConnectedObjOccs(Constants.ST_POS_TYPE); // Gets a list of Position Type symbols connected to the current function occurrence for(var k=0; satelliteList.length > k; k++){ // For each satellite currSatellite = satelliteList[k]; // Gets the current satellite occurrence // Stores data oCurrOut = new __usertype_outStruct(); oCurrOut.sModel = currModel.Name(locale); oCurrOut.sFunc = currFunc.ObjDef().Name(locale); oCurrOut.sSat = currSatellite.ObjDef().Name(locale); out.push(oCurrOut); // Stored data is pushed into an array } } } // At this point you shoud be able to get the out array and use it any way you like in an output document }