SW

Hi All,

I'm trying to understand ARIS script a little more, I've been looking through the Script help file and have come across:

getParentObjOcc()

According to the help this is: "Objects in objects: Returns the object in which this object occurrence is contained."

I'm trying to understand how a object gets "contained" within another? I've imported some visio diagrams, and I've created a simple report to try and automatically create connections based on the objects contained in another object. 

The code so far is as follows:

  var objects = ArisData.getSelectedObjOccs();
 for(var i=0; i<objects.length; i++ )
 {
        objects[i].ObjDef().CreateCxnDef(objects[i].getParentObjOcc().ObjDef(), 283) 
 }

 

The issue I have is that it works on some of the diagrams which I have previously played around with, but on the freshly imported models it doesn't return an ObjDef from getParentObjOcc().

Any ideas?

by Robert Goldenbaum
Badge for 'Question Solver' achievement
Posted on Tue, 04/25/2017 - 16:33

Hi Scott,

the parent obj occ is used for this object in object-thing. But basically, this is just an object, that has an implicit connection to its contained objects. The connection is there on definition level, but you cannot see it in the model. Only when you move the child object outside of the parent object will the connection be displayed.

So in your source code, you are trying to create a connection of the child to the parent. But if it already has a parent, you will already have a connection. If not, then you won't get the parent. This explains why it works on existing models (there you already have those connections), but not on new models (where the visio import just places two objects above each other without creating a connection).

So if you want to create those connections in your imported models, you would have to check which objects are laid above the others. You can do this only via the X/Y position and width/height of the occs...

BR Robert

0

Featured achievement

Rookie
Say hello to the ARIS Community! Personalize your community experience by following forums or tags, liking a post or uploading a profile picture.
Recent Unlocks

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