YD

Hello Community,

I have a question regarding to the retrieval of parent model.

If I have a ObjDef now and I would like to get the model to which the object belongs, how should I do that ?

Thanks in advance!

Best

by Kay Fischbach
Posted on Mon, 03/11/2019 - 15:56

The parent models are models in which occurrences exist that have your ObjDef as an object definition, aren't they?

Since your ObjDef can have multiple occurrences in multiple different models, there isn't "the" parent model, instead it's a list of models that can contain

  • no models (if you deleted the only occurrence without deleting the object definition)
  • one model (if you freshly created the occurrence and object definition, and didn't reuse the object definition in another model for another occurrence yet)
  • multiple models (if you re-used the object definition at least once in another model)

The way I would solve your problem:

  1. Get a list of all object occurrences of your ObjDef
  2. Create an empty array
  3. For each found object occurrence just push the containing model into the previously created array
  4. In the end use the ArisData.Unique(...) method to ensure your array contains each model only one time at most

Should work something like this

var selObjDefs = ArisData.getSelectedObjDefs();

for each (var singleObjDef in selObjDefs){
    var arrayForModelCollection = [];
   
    var occList =  singleObjDef.OccList();
   
    for each(var singleObjOcc in occList){
        arrayForModelCollection.push(singleObjOcc.Model());
    }
   
    var arrayOfUniqueModels = ArisData.Unique(arrayForModelCollection)
   
   
}

 

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