void on()

in domain/src/main/java/demoapp/dom/domain/objects/DomainObject/xxxDomainEvent/DomainObjectXxxDomainEventControlStrategy.java [128:157]


        void on(DomainObjectXxxDomainEventPage.DomainObjectXxxDomainEventMarker ev, ServiceRegistry serviceRegistry) {
            if (ev instanceof DomainObjectXxxDomainEventPage.ActionEvent) {
                val actionEvent = (DomainObjectXxxDomainEventPage.ActionEvent) ev;
                switch (actionEvent.getEventPhase()) {
                    case EXECUTED:
                        serviceRegistry
                            .lookupService(MessageService.class)
                            .ifPresent(ms ->
                                    ms.informUser("Changed using updateText('" + actionEvent.getArguments().get(0) + "')")
                            );
                        break;
                }
            }
            if (ev instanceof DomainObjectXxxDomainEventPage.PropertyEvent) {
                val propertyEvent = (DomainObjectXxxDomainEventPage.PropertyEvent) ev;
                switch (propertyEvent.getEventPhase()) {
                    case EXECUTED:
                        serviceRegistry
                            .lookupService(MessageService.class)
                            .ifPresent(ms ->
                                    ms.informUser(
                                            String.format("Changed from %s to %s"
                                                    , propertyEvent.getOldValue()
                                                    , propertyEvent.getNewValue()))

                            );
                        break;
                }
            }
        }