JG

Hi!

Our objects (Roles, DKOs, etc) are kept on libraries and part of the housekeeping that we do is to check whether the object is still used on the live models. If not, we're supposed to removed it from the libraries. Currently, I check it using the report "Output occurrences of objects" after which I have to manually scan which is a very time-consuming task.

Do we have other available reports that can just give me a report which can directly tell me which has no occurrence to live models?

Thanks in advance!

BR,

Julie

by Sumeet Satwani
Posted on Mon, 06/26/2017 - 10:51

Hi Julie,

You can try the below script, its working for me :

 

function main(){

     

var oCurrentDatabase=ArisData.getSelectedDatabases()[0];

var arrSelectedGroups= ArisData.getSelectedGroups();

var g_nLoc = Context.getSelectedLanguage();



   g_oOutfile = Context.createOutputObject(Context.getSelectedFormat(), Context.getSelectedFile());

   g_oOutfile.Init(g_nLoc);

var Obj = oCurrentDatabase.Find(Constants.SEARCH_OBJDEF);

 

var  len=Obj.length

for(var a = 0; a <Obj.length; a ++){

  var Objocc= Obj[a].OccList();

var l=Objocc.length;

if(l==0){

g_oOutfile.OutputLn( Obj[a].Name(Context.getSelectedLanguage()) +" ; " +  Obj[a].Group().Path(Context.getSelectedLanguage()), "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, 0);

}}

 

g_oOutfile.WriteReport(Context.getSelectedPath(), Context.getSelectedFile());

}

main();

0
by Julie G. Author
Posted on Mon, 06/26/2017 - 15:09

Hi Sumeet!

Thanks for this! :)

0
by Gerald Schroeder
Posted on Mon, 06/26/2017 - 17:38

Hi Julie,

I want just mention that removing objects without occurences on models is a job that reorg does.

We use it every nite via scheduled job an the design/connect server. The result is logged too.

BR Gerald

0
by Robert Goldenbaum
Badge for 'Question Solver' achievement
Posted on Tue, 06/27/2017 - 09:08

Well, but both solutions won't help you with models that are still in a library model.

You would have to go through the occurrences of the object and check if they have any occurrence e.g. in an epc or fad...

for(var a = 0; a <Obj.length; a ++){

   bValidFound = false;

  var ObjoccList= Obj[a].OccList();

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

       oObjOcc = oObjOccList[i];

       if (oObjOcc.Model().TypeNum() == Constants.MT_EEPC || oObjOcc.Model().TypeNum() == Constants.MT_FUNC_ALLOC_DGM){

             bValidFound = true;

             break;

       }

  }

  if (!bValidFound){

      // delete object or report it to word etc.

 }

}

BR Robert

0

Featured achievement

Question Solver
Share your expertise and have your answer accepted as best reply.
Recent Unlocks
  • CP
  • BZ
  • Profile picture for user TEF_Bernd
  • ПЦ
  • CR
  • 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