Does anyone use this notification?
v2.workforcemanagement.managementunits.{id}
It is mapped to WfmMoveManagementUnitTopicMoveManagementUnitNotification and I would like to use it to see if business configuration was changed.
Plan is to cache Genesys config locally and don't ask for it on every request:
start our third party application
get current configuration Business Unit -> Management Unit -> Agents
subscribe for notification v2.workforcemanagement.managementunits.{id} (MU move)
subscribe for notification v2.workforcemanagement.agents (Agent move)
The agent move notification is pretty much OK and I can detect which MU I have to remove from cache and get the config from Genesys API.
The v2.workforcemanagement.managementunits.{id} is problematic, because it contains only single parameter "new" business unit ID.
I would need to get:
old business unit ID
new business unit ID
management unit ID, that has been moved
Is there any notification or practice how to get notification with such data?
The problem behind is to get complete agent business configuration from userId.
Business Unit -> Management- Unit -> Agent. I don't want to query Genesys API for every single request, but cache the information locally, plus subscribe to get updates and remove only updated records.
management unit ID - this one you'll have already since you would have used it to subscribe to the notification. If you have N management units, you'll need to subscribe to N notifications for each.
new business unit ID - this is included, like you mentioned
old business unit ID - this isn't included and technically we could add it to the message. However, if you're going to be caching this information on your side, why not just make the query one time to store the business unit ID per management unit, and then you will have the old business unit ID in your data store when you need it. By the way, I'm not sure I understand why you need the old business unit ID here.
In my case I do have management units ID on subscribe and getting the structure "umbrella" on startup. (BU - business unit, MU- management unit)
Then I do cache separately:
BuToMu mapping, key is BUID
MuConfigToAgents configuration and list of agents, key is MUID
When someone moves MU to other BU in Genesys UI. I need to:
delete BuToMu mapping. old BUID and new BUID keys
delete MuConfigToAgents, moved MUID
I have no reference in current event, what MU was moved and what was old BU, to make the refresh straight forward. If it is not way too complicated to include those values in event, than it would be a great help and will decrease number of requests between systems.
You are right, I can do cache and I do it. The BU -> MU relation is 1:N. So without reference of MU in event I will need to read new/old BU from Genesys config and compare it with old/new BU in my cache, find missing MU ID and perform delete. And this is backup plan, if you will say that it is not possible to change event structure.
In worst case, I will flush all BUtoMu mapping from cache and this is what I'm doing now, while I was waiting for answer on forum.
The solution exists on my side, but is not let's say "optimal".
Please consider adding of both BUID and as well MUID in event, if it is possible. It will help a lot to handle such events.