If I need to add another group to an already created groups. I need to create an array of the names of these groups and call setPublicGroups for current zone
If I do that what happens to the rooms that were already attached to the created groups?
Example:
List of groups: group_1, group_2, group_3
Add groups to the area through the setPublicGroups method. Add several rooms into each group.
1. I need to add a new group group_4 (ie I can't use setPublicGroups method). So I need to create a room and tie it to the new group for creating this group in the area?
2. If I use setPublicGroups method all of the rooms that were added to the group group_1, group_2, group_3 will disappear?
3. For removing the group I have to delete all the rooms in this group?
First of all, please don't use the setPublicGroups() method. It is for internal use only, by the API.
For creating a new room group, yes, you just create a new room, and as the group id, you set "group_4".
And yes, I think the room group is removed when all of its rooms are also removed.
If I need to add another group to an already created groups. I need to create an array of the names of these groups and call setPublicGroups for current zone
If I do that what happens to the rooms that were already attached to the created groups?
Room groups are never removed, because they are just "keys". They basically don't take real space.
It is like the name of a road. If you build a few houses along that road you can then tell people how to get there by providing the address... Lapo Street ... for example If you destroy all houses then who cares about the name of that street anymore?
One more note. In general groups are not meant to be totally dynamic, if you have planned your application a bit you should know beforehand which groups you will need.
It would be nice if you could remove them though, just for the sake of organization. They show up in the admin tool and if there are a lot of "dead" ones cluttering up the dropdown isn't so nice, and also if you you have code that searches rooms by roomGroup, it would be nicer to not loop through a bunch of roomGroups that don't exist. That said, I suppose restarting the server can fix it of snow.
Carl Lydon wrote:It would be nice if you could remove them though, just for the sake of organization. They show up in the admin tool and if there are a lot of "dead" ones cluttering up the dropdown isn't so nice, and also if you you have code that searches rooms by roomGroup, it would be nicer to not loop through a bunch of roomGroups that don't exist. That said, I suppose restarting the server can fix it of snow.
Groups are defined at Zone Level, so you can always remove those that are no longer needed.
In terms of performance the unused groups don't cause any issue.
Good point. At the moment you will need a restart, but if you're doing it because you want to remove groups I wouldn't recommend it for the reasons I explained in my previous post.
We have a new feature coming with the next 2.12 release which will allow you to manage groups dynamically from your Extension code. So no restart required.
Room groups are never removed, because they are just "keys". They basically don't take real space.]term paper for sale
It is like the name of a road. If you build a few houses along that road you can then tell people how to get there by providing the address... Lapo Street ... for example If you destroy all houses then who cares about the name of that street anymore?
One more note. In general groups are not meant to be totally dynamic, if you have planned your application a bit you should know beforehand which groups you will need.
Quite an interesting approach to explain that I planned all the groups for my application beforehand, just like you said. But my last application project was actually a mess (and I had to work on other variants) because I didn't managed to complete migration from 2.10 to 2.12 successfully. Anyway, that was my mistake.
Edit: Sorry for the bump, just noticed the topic is quite old.