AD

I was looking for solution to search object/model/group by GUID in ARIS repository however could not find any. Well then realized by writing few lines of code it is easily possible to search in the repository by GUID.

Please find the script attached as zip file.

The script is run on database level only. When run it will ask for GUID.

 

When the GUID is found it will tell where the item is including what type of itema and where it is.

If not found it will come up witha message like this.

var g_nLoc=1033;
var db= ArisData.getActiveDatabase();
    
function main(){
    
    //Get the GUID
    var search_GUID=Dialogs.InputBox("Enter the GUID","Search by GUID","Enter the GUID value here");
    
   
    if(search_GUID!=null){
        //get the Item
        var Item_Found=db.FindGUID(search_GUID)
        
        if (Item_Found.IsValid()){
            var Item_Name       =Item_Found.Name(g_nLoc);
            var Item_Type       =Item_Found.KindNum();
            var Item_Type_Name  =getItemType(Item_Type);
            var Item_path       =getItemPath(Item_Found,Item_Type);             
            var msg_String=Item_Type_Name+" <"+Item_Name+"> is found with GUID value <"+search_GUID+">"+" in location <"+Item_path+">";
            
            Dialogs.MsgBox(msg_String);
            
        }
        else{
            Dialogs.MsgBox("Not found. Please enter a valid GUID value.");
        }
        
    }
    else{
        Dialogs.MsgBox("Please enter the GUID value.");
    }
    
}
//get the Item path
function getItemPath(searchItem,intItemType){
    
    if (intItemType==Constants.CID_OBJDEF){
        return searchItem.Group().Path(g_nLoc);
    }
    if (intItemType==Constants.CID_MODEL){
        return searchItem.Group().Path(g_nLoc);
    }
    if (intItemType==Constants.CID_GROUP){
        return searchItem.Path(g_nLoc);
    }
}
//get the Item type
function getItemType(intItemType){    
    
    if (intItemType==Constants.CID_OBJDEF){
        return "Object";
    }
    if (intItemType==Constants.CID_MODEL){
        return "Model";
    }
    if (intItemType==Constants.CID_GROUP){
        return "Group";
    }      
}

main();

 

File attachments
by Przemysław Popławski
Posted on Mon, 08/19/2013 - 11:16

Good job.

Although I suggest You to use in message special chars like "\n". It look a way better especially with long names or paths of objects.

Regards

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