Skip to content

Add sample for UIEventPublisher #71

Description

@alexbudarov

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions