Hi All
I am new to ARIS reports, one of our reports called Risk and Control matrix which extracts the risk and control object connected into an EPC or activity. When I run the report it gives me the following error " cannot find method ObjDef of undefined". What could be the issue? The script is run at a model level used to work fine before I am using 7.2. See the script below.
/ Entry Point
function main()
{
var oL2Objects = ArisData.getSelectedObjOccs();
var sGroupLevelName = '';
//var sAssignedModels = oL2Objects[0].ObjDef.GetAssignments(g_mtBusArch);
var sAssignedModels = oL2Objects[0].ObjDef().AssignedModels(g_mtBusArch);
var bGovernanceLevelPassed = false;
var oHighLevelValues;
var oSuperiorObjDefs;
var oModel;
var oValueChainName = "[Value Chain Name]";
Thank you
Hello,
You created a script to run on a object occurrence, not on a model, select an object occurrence and the function will work.
The line : ArisData.getSelectedObjOccs(); return an array containing all occurrences selected. If you select a model, the array will be empty and the element number [0] of your array will be undefined.
Best Regards
Thanx Tricarico
Even when I select the the object occurrence, it gives me the same error. The report should provides a Business Processes Activities risks, and associated controls and these are in are connected in an activity which is a object definition and the risk and controls are object occurrences. See the error below
Kind Regards
Well, what he meant is that if the start context of the report is model, and in the script you are using the start object occurrences, then you would get an error as you have described earlier...
What is the start context of the script and what is the complete code ?
BR Robert
Thank you to both of you for the responses, the report start at a function or by selecting an object. I tried changing the fist line to var oL2Objects = ArisData.getSelectedObjDef(); now it complains that it cannot find the function and I make sure that I select object that has assignments. The script is very long I have attached it. I hope this make sense.
Thank you
Sinalo
Hello Sinalo,
a quick guess - the function name according to ARIS Script Help:
Report class ArisData - Method getSelectedObjDefs
getSelectedObjDefs ( )
Returns all selected object definitions if the report is started on one or more object definitions, object occurrences or object definition shortcuts.
So maybe you just missed an 's'?
BR Gerald