Hi Erik, I managed to reproduce the issue, using your example code. I tested both axon and guava eventbus on the current master branch. I guess its reproducible with the latest release of 1.16. as well.
Seems to be a bug with org.apache.isis.objectstore.jdo.datanucleus.service.eventbus.EventBusServiceJdo which skips event propagation, when it actually should not. (But I'm not really sure yet. Code seems to require some polishing, I guess.) Cheers, Andi On 2018/05/09 10:14:57, Erik de Hair <[email protected]> wrote: > Hi, > > For the following scenario I expected an UpdatedEvent for each entity > being updated but I only receive one for the last updated entity. Is > that by design? > > Example classes: > > @PersistenceCapable(table = "entities") > @DomainObject(updatedLifecycleEvent = Entity.UpdatedEvent.class) > public class Entity { > public static class UpdatedEvent extends > org.apache.isis.applib.services.eventbus.ObjectUpdatedEvent<Entity>{ } > > @Column(name = "activated", allowsNull = "false") > @Getter @Setter > private boolean activated; > > public void activate(){ > setActivated(true); > } > } > > @DomainService(nature=NatureOfService.DOMAIN) > public class EntitySubscriber extends AbstractSubscriber { > > @Subscribe > public void on(Entity.UpdatedEvent ev) { > // do something > } > } > > @DomainService(nature = NatureOfService.DOMAIN) > public class EntityService { > > public void activateAll(){ > List<Entity> entities = <query result>; > > for (Entity entity : entities) { > entity.activate(); > } > } > } > > Thanks, > Erik > > >
