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:
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.flowui.fragment.Fragment
Fragment.ReadyEvent -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DialogWindowsprotected BpmnModelerprotected CollectionContainer<NotificationModel> protected DataGrid<NotificationModel> protected HasNotificationsFields inherited from class io.jmix.flowui.fragment.Fragment
fragmentActions, fragmentData, fragmentFacets, parentController, uiComponents -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected DataContextReturns theDataContextto use as the parent when openingNotificationEdit.protected booleanvoidonNotificationsDcCollectionChange(CollectionContainer.CollectionChangeEvent<NotificationModel> event) voidvoidprotected voidvoidsetModeler(BpmnModeler modeler) voidsetParentModelElement(HasNotifications parentModelElement) Binds the fragment to the BPMN element that owns the notifications and populates the grid.protected voidMethods inherited from class io.jmix.flowui.fragment.Fragment
addReadyListener, findInnerComponent, getFragmentActions, getFragmentData, getFragmentFacets, getInnerComponent, getParentController, initContent, onAttach, onDetach, setFragmentActions, setFragmentData, setFragmentFacets, setParentController, setUiComponentsMethods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElementMethods inherited from class com.vaadin.flow.component.Component
addListener, bindVisible, findAncestor, fireEvent, from, get, getEventBus, getId, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setTestId, setVisible, whenAttachedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface io.jmix.flowui.facet.FacetOwner
getIdMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Field Details
-
notificationsTable
-
notificationsDc
-
dialogWindows
-
modeler
-
parentModelElement
-
-
Constructor Details
-
NotificationsFragment
public NotificationsFragment()
-
-
Method Details
-
setModeler
-
setParentModelElement
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, viainstanceof UserTaskModel, and passed toNotificationEditwhen 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
-
getParentDataContext
Returns theDataContextto use as the parent when openingNotificationEdit. The fragment's own<data>block is not markedprovided, so per the fragment data-loading rules it gets its ownDataContextunless 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'sDataContext. The host-view lookup is kept as a defensive fallback in case that ever changes.
-