ARIS Community - We Love BPM

Report for object with no occurence in live models?

jgmorcilla's picture
by Julie Grace in Reports & Macros posted on 2017-06-23

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

1259 Views
0 Likes
4 Comments
Sorry there are no tags
There are no attachments
Sumeet Satwani posted on 2017-06-26

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();

Julie Grace posted on 2017-06-26

Hi Sumeet!

Thanks for this! :)

Gerald Schroeder posted on 2017-06-26

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

Robert Goldenbaum posted on 2017-06-27

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