andrea-patricelli commented on a change in pull request #213:
URL: https://github.com/apache/syncope/pull/213#discussion_r491930178



##########
File path: 
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPATaskDAO.java
##########
@@ -436,7 +413,13 @@ public int count(
     @Transactional(rollbackFor = { Throwable.class })
     @Override
     public <T extends Task> T save(final T task) {
-        return entityManager().merge(task);
+        T merged = entityManager().merge(task);
+
+        // propagate the event only for Propagation tasks
+        if (merged instanceof PropagationTask) {
+            publisher.publishEvent(new TaskCreatedUpdatedEvent<>(this, merged, 
AuthContextUtils.getDomain()));

Review comment:
       Yes, I left the implementation in a way "open" also to other tasks. 
There are some cases in which would be useful also to have `NotificationTask` 
on ES.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to