UI Events and UIEventPublisher is a wonderful mechanism that allows to make UI that instantly updates itself after something happens on middleware (e.g. a BPM service task changes the entity; or some long @Async operation finishes its work).
But UIEventPublisher isn't used in any screens generated by Studio. And it's not presented in Samples.
Because of that, it is often underused by developers, not known by analysts.
My suggestions for a good sample:
- Event should be published from a middleware method that runs in background, using publishEventForUsers() - so that it isn't obvious how to rewrite the code without UI event
- The part of UI that updates its state on the event - should be read-only, because otherwise it is unobvious what to do if user has made some dirty changes in the form
- Event must contain some "UUID relatedEntityId" attribute, and the screen checks this attribute to ensure that the event belongs to this view (developers often forget about this)
UI Events and UIEventPublisher is a wonderful mechanism that allows to make UI that instantly updates itself after something happens on middleware (e.g. a BPM service task changes the entity; or some long
@Asyncoperation finishes its work).But UIEventPublisher isn't used in any screens generated by Studio. And it's not presented in Samples.
Because of that, it is often underused by developers, not known by analysts.
My suggestions for a good sample: