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


Reply via email to