Hi Everyone,
Busy working on a script in ARIS 10.0.4
It runs from a Function symbol on a VACD.
When I debugged and tested, no problem were found. However, in ARIS Connect I got an error.
Same object on the same model was used to test.
The code looks like this:
selObjModel = selObjOccs[0].Model();
ARIS Connect Error:
Cannot call method "Model" of undefined....
Does the .Model() method not work in Connect, or have they changed the statement?
Thanks for your help.
Willem
In ARIS 10.0.3 we have a problem with the ArisData.getSelectedObjOccs() method. Maybe they didn't fix it with 10.0.4 yet? (I'm not even sure if they fixed it with the current up-to-date release)
Anyways, in Connect (for ARIS 10.0.3) when we select an occurrence in the model and run a report for it, we can only retrieve the object definition of the selected occurrence (with ArisData.getSelectedObjDefs()). That's quite stupid when the object definition has multiple occurrences and we don't know from which one the report was started.
Maybe you could check if your Connect behaves similar? I'd suggest a script like this (Context can be similar to your original script - allow functions. The output format I'd recommend is txt, but you can pick anything except xls and pdf (the OutputTxt method is not supported with those) and xls/xlsx (we didn't go through the hustle to create an excel sheet and whatnot)).
var oOutput = Context.createOutputObject(); //create an output object var selObjOccs = ArisData.getSelectedObjOccs(); //get selected object occurrences var selObjDefs = ArisData.getSelectedObjDefs(); //get selected object defs for each(var selObjOcc in selObjOccs){ //iterate through the array of selected objec occurrences - each iteration one element of the array becomes selObjOcc oOutput.OutputTxt("Found Occ"); //tell us that there is an occurrene } for each(var selObjDef in selObjDefs){ //iterate through the array of selected objec defs - each iteration one element of the array becomes selObjDef oOutput.OutputTxt("Found Def"); //tell us that there is a def } oOutput.WriteReport(); //write the report to file
Feel free to extend the script to check the other ArisData.getSelected... methods.