Articy Forum


https://www.articy.com:443/forum/

Partition Management

https://www.articy.com:443/forum/viewtopic.php?f=47&t=18174

Page 1 of 1

Partition Management

Posted: Wed 26. Apr 2017, 17:00
by tcarter
I'm curious about the intended use of PartitionUnloaded/PartitionUnloading. I'm wanting to adjust some settings for certain entities within a user's claimed partitions, and apply those settings to new partitions as they're claimed. I can do this with PartitionLoaded(Guid, ObjectProxy), and it works just fine. Now I'm wanting to reset those values back to some default when the user unclaims the partition. I figured that would be best done via PartitionUnloading(Guid, ObjectProxy), but after setting a breakpoint within my override function I found that it isn't called when partitions are unclaimed, but is called when reverting changes to a particular partition. Is this the intended behavior? If so, are there any callbacks for when a user unclaims a partition (with or without reverting changes)?

Re: Partition Management

Posted: Thu 27. Apr 2017, 10:32
by [Articy] Peter Sabath
Your chosen approach make totally sense for me.

That you do not get a PartitionUnloading call is the desired behavior because the unclaim or publish action do not remove the objects of that partition from memory.
So what you need is a new event notification method, that is called just before a partition is published or unclaimed.

Re: Partition Management

Posted: Fri 28. Apr 2017, 16:59
by tcarter
Thanks, Peter.
I assume a method for "publish/unclaim" isn't something I can write on my own, right? :D
Not resetting things during unclaim is fine for my project, since the correct settings get re-applied when partitions are claimed (assuming the other user is also using my plugin). I'm just wanting it for tidiness, so if you've got a to-do list for the next update, it's low priority.

Re: Partition Management

Posted: Thu 4. May 2017, 14:17
by [Articy] Peter Sabath
No you can't write/intercept partitioning related core methods.

But with 3.1 there will be an additional PartitionPublished API hook available.

Re: Partition Management

Posted: Mon 8. May 2017, 22:36
by tcarter
Side note: when users redefine partitions, it would be nice to have a callback. I'm planning on auto-generating some files for use in individual partitions, so I'll need to know when they change.

All times are UTC
Page 1 of 1