AS

Hello,

I have to find all models where function has an occurrence. I'm looking for functions (I'm done with it), but I could not move further. I wanted to use object function OccList(), but how to get models for these occurrences?

Thanks.

by Shashi Pal
Posted on Wed, 09/11/2013 - 08:19

Hi  Albina,

you could try this

var g_nloc=Context.getSelectedLanguage();

var oselectedObject=ArisData.getSelectedObjDefs();

for(var i=0;i<oselectedObject.length;i++){

    var modellist=new Array();

    occurentobject=oselectedObject[i].OccList();

   

    for(var j=0;j<occurentobject.length;j++){

       

        if(modellist.contains(occurentobject[j].Model().Name(g_nloc) ) == false){

           

            modellist.push(occurentobject[j].Model().Name(g_nloc));

                      

        }

    }

   

}

 

please import Common files/commonUtils.js  otherwise it will give error in contains .

regards

0
by Ilya Seletkov
Posted on Wed, 09/11/2013 - 08:53

Hi!

There could be models with identical names. It is better to use model GUID as a key or ArisData.Unique() method to ensure models in list are unique.

var oFuncDef = ...
var oLV = new Object;
var aModels = new __map(); //defined in convertertools.js
oLV.aOccs = oFuncDef.OccList();
for (var i=0; i<oLV.aOccs.length; i++)
{
oLV.oOcc = aOccs[i];
oLV.oModel = oLV.oOcc.Model();
if (!aModels.ContainsKey(oLV.oModel.GUID())
{
//This model has not been found yet
aModels.Insert(oLV.oModel.GUID(), oLV.oModel);
}
}
delete oLV.aOccs;

Hope, this helps.

0
by Albina Schupak Author
Posted on Wed, 09/11/2013 - 10:42

Thanks a lot for your responses. It will work, I'm sure, but I have a question: Aris's Help says that function Model() returns the model "in which the occurrence is drawn as a model". That is what I need?

 

Thanks.

0
by Ilya Seletkov
Posted on Wed, 09/11/2013 - 12:18

Yes it is. The phrase "as model" means that function return type is "model".

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
  • SS
  • MZ
  • Profile picture for user kbiront
  • Profile picture for user Tony Iliev
  • Profile picture for user amandeep.7.singh
  • 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