ID

Hi:

I am trying to move a package to another folder and the method obj.ChangeGroup(carpetaDest) works only with groups... anyone knows a different method for packages?  

Thanks

by Kay Fischbach
Posted on Thu, 09/19/2019 - 08:36

Wait. Those "packages" you're talking about, are you talking about object definitions with the object type "Package"? As in objects with the API name OT_PACK?

The method "ChangeGroup(newGroup)" is a method of the report class "ObjDef". The report class "Group" inherits this method from ObjDef, therefore you can use someGroup.ChangeGroup(newGroup) to move one group to another group (<- all those groups I'm talking about are the "folders" you see in the ARIS Explorer).

With this this thing made clear, let's get to the gist of what I'm trying to say. "ChangeGroup(newGroup)" originally stems from the report class "ObjDef". Object definitions with the object type "Package" are used in Reports with the report class "ObjDef". Therefore it's illogical to say that "ChangeGroup(newGroup)" "only works with groups", when the original purpose of this method stems from the report class "ObjDef", where it is used to move object definitions around.

Take a look at the following report (Report context: Group; everything output related doesn't matter; the report needs permission to write to the database)

var nLocale = Context.getSelectedLanguage();
var selGroups = ArisData.getSelectedGroups(); //get the group with which you started the report

for each(var selGroup in selGroups){
    var testGroup1 = selGroup.CreateChildGroup("Test Group 1", nLocale); //in the selected original group create a sub-group called "Test Group 1"
    var testGroup2 = selGroup.CreateChildGroup("Test Group 2", nLocale); //in the selected original group create another group "Test Group 2"
    
    var testObjDef = testGroup1.CreateObjDef(Constants.OT_PACK, "Test Package Object", nLocale); //In Test Group 1 create an object definition with the object type "Package"
    
    testObjDef.ChangeGroup(testGroup2); //Move the object definition with the object type "Package" to the group "Test Group 2"
    testGroup1.ChangeGroup(testGroup2); //Move the (now empty) Test Group 1 into Test Group 2
    
    //You now should have only one Test Group 2, in which you can find the object definition that was originally created in Test Group 1 and you can find the Test Group 1 inside Test Group 2
    //You'll probably have to log off and on the database to see the changes
}

^ I'm telling you that this is a valid, working script and that the method ChangeGroup can be used for object definitions as well as for groups. You use it with groupToMove.ChangeGroup(destinationGroup) and objectDefinitonToMove.ChangeGroup(destinationGroup).

0
by Ignacio De Diego Author
Posted on Thu, 09/19/2019 - 13:17

You are right! the problem was not about the object but with the "destinationGroup", so I could use the same method anyway. thanks a lot

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