Forced GUI refresh and AE kick events

Discussion created by Michael_Lowry on Nov 2, 2017
Latest reply on Nov 7, 2017 by Michael_Lowry
I’ve noticed an annoying phenomenon that sometimes happens in the Java User Interface: while I am working with objects in an open Explorer window one or more of the following things will happen, without any action on my part:
  • The folder list in the Explorer window will suddenly refresh.
  • The expanded folders in the folder list will collapse all by themselves.
  • If I try to switch to another folder, this will not work and the view will switch immediately back to the previously-selected folder.
Long ago, I enabled UCDJ tracing* to try to better understand what is going on. I found that the phenomenon was correlated to an event in the trace called kick. At the time, I did not completely figure out what this ‘kick’ did, but guessed that it had to do with some sort of synchronization activity to notify the GUI of changes in the AE.

Yesterday I confirmed this hypothesis. I noticed several related new API classes added to the AE v12.0 Java Application Interface: IKickEventListener, KickEvent and KickEventType.

Based on the documentation of the last of these classes, we can see that there are several types of kick event, and one of the types is TREE_CHANGED. This no doubt refers to changes to the AE folder structure (addition, modification, or deletion of folders). My guess is that the Java GUI has runs an IKickEventListener, and listens for kick events from the Automation Engine. When a TREE_CHANGED kick event is received, the GUI automatically forces the folder tree to be reloaded from the AE in its entirety. This can take a few moments, during which the folder tree does not respond normally. The refresh of the window is also handled in a rather ungraceful way, and the GUI often fails to remember which folders were expanded prior to the reload.

Anyway, that’s my best guess of what’s going on. It would be nice if the GUI handled this sort of thing in a more user-friendly way. I suppose it will not be fixed though, given that the Java GUI has been deprecated in v12.1. Also, I know the AWI works differently in this regard, caching data on the AWI server and loading only chunks of the folder tree at a time. (I suppose behind the scenes, the AWI still runs an IKickEventListener, and reloads the whole folder tree in response to these events, but it can shield the user from jarring UI changes.)

* If you set the xml=3 trace option in uc4config.xml, you can see all of the XML traffic between the GUI and the AE.