Class NotificationsFragment

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<com.vaadin.flow.component.orderedlayout.VerticalLayout>
io.jmix.flowui.fragment.Fragment<com.vaadin.flow.component.orderedlayout.VerticalLayout>
io.jmix.bpmflowui.view.modeler.properties.notification.NotificationsFragment
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasStyle, FacetOwner, FragmentOwner, Serializable

public class NotificationsFragment extends Fragment<com.vaadin.flow.component.orderedlayout.VerticalLayout>
Reusable properties-panel section displaying the notifications declared on a BPMN element (a user task or a service task). Persists the list on the modeler side as repeated <jmix:notification> extension elements on the owning element, replacing the whole set on every change.

Owns its notificationsDc collection: the host does not provide any data, it only calls setModeler(BpmnModeler) and setParentModelElement(HasNotifications) after embedding the fragment.

See Also:
  • Field Details

  • Constructor Details

    • NotificationsFragment

      public NotificationsFragment()
  • Method Details

    • setModeler

      public void setModeler(BpmnModeler modeler)
    • setParentModelElement

      public void setParentModelElement(HasNotifications parentModelElement)
      Binds the fragment to the BPMN element that owns the notifications and populates the grid. Whether the element is a user task (full event/recipient set) or a plain service task (initiator/expression recipients only, no event) is derived from the element's own type, via instanceof UserTaskModel, and passed to NotificationEdit when a row is created or edited.
      Parameters:
      parentModelElement - the owning BPMN element model
    • onNotificationsTableCreate

      @Subscribe("notificationsTable.create") public void onNotificationsTableCreate(ActionPerformedEvent event)
    • onNotificationsTableEdit

      @Subscribe("notificationsTable.edit") public void onNotificationsTableEdit(ActionPerformedEvent event)
    • onNotificationsDcCollectionChange

      @Subscribe(id="notificationsDc", target=DATA_CONTAINER) public void onNotificationsDcCollectionChange(CollectionContainer.CollectionChangeEvent<NotificationModel> event)
    • isUserTaskScope

      protected boolean isUserTaskScope()
    • updateNotificationsInModeler

      protected void updateNotificationsInModeler()
    • putIfNotEmpty

      protected void putIfNotEmpty(Map<String,Object> properties, String name, String value)
    • getParentDataContext

      protected DataContext getParentDataContext()
      Returns the DataContext to use as the parent when opening NotificationEdit. The fragment's own <data> block is not marked provided, so per the fragment data-loading rules it gets its own DataContext unless the host already has one, in which case it transparently shares the host's instance. Both hosts of this fragment (UserTaskPropertiesFragment, SendNotificationTaskPropertiesFragment) define their own data, so in practice this resolves to the host view's DataContext. The host-view lookup is kept as a defensive fallback in case that ever changes.