AG

Dear community, good day!

I have encountered an unknown error when using the Neighbour() method. Here's the issue: I have two arrays with instances of objects, functionArr and rolesArr. I want to check if there is a connection between each object from the arrays. I am using the following code (example):
 

for (var i=0;i<SubModelObj.functionsOccs.length;i++){
        for(j=0;j<SubModelObj.rolesOccs.length;j++){
        Dialogs.MsgBox(SubModelObj.modelInstance.Neighbour(SubModelObj.functionsOccs[i],SubModelObj.rolesOccs[j]).getDefinition().TypeNum());
        }
    }

The inner loop only runs once, displaying the relationship type number, and then throws an error "An error occurred while executing the script: An error has occurred in the report object model. Cannot save modified objects in read-only mode.".

What could be causing this error and how can I resolve it?

by Martin Schröder
Badge for 'Contributor' achievement
Posted on Wed, 07/12/2023 - 15:36

Hello Anton,

the scripting help (/abs/help/en/script/ba/#/home/r_O_Model_neighbour/en/1) reads like a warning here:

The return value, i.e. the relationship between the two object occurrences, possibly an invalid object, if both nodes in the graph are not contiguous (check results!).

So if your two arrays are filled randomly with function and role occurences there is a high probability they are not neighbours. I doubt this is an efficient evaluation, but I do not know what you are aiming at.

Regards, Martin

0

Featured achievement

Explorer
Take a tour! Learn more about the different ARIS Community areas and ARIS editions.
Recent Unlocks
  • Profile picture for user florin.spanachi
  • JU
  • SN
  • DB
  • AI
  • PacMan

Leaderboard

|
icon-arrow-down icon-arrow-cerulean-left icon-arrow-cerulean-right icon-arrow-down icon-arrow-left icon-arrow-right icon-arrow icon-back icon-close icon-comments icon-correct-answer icon-tick icon-download icon-facebook icon-flag icon-google-plus icon-hamburger icon-in icon-info icon-instagram icon-login-true icon-login icon-mail-notification icon-mail icon-mortarboard icon-newsletter icon-notification icon-pinterest icon-plus icon-rss icon-search icon-share icon-shield icon-snapchat icon-star icon-tutorials icon-twitter icon-universities icon-videos icon-views icon-whatsapp icon-xing icon-youtube icon-jobs icon-heart icon-heart2 aris-express bpm-glossary help-intro help-design Process_Mining_Icon help-publishing help-administration help-dashboarding help-archive help-risk icon-knowledge icon-question icon-events icon-message icon-more icon-pencil forum-icon icon-lock