ozimakov opened a new pull request, #1352:
URL: https://github.com/apache/syncope/pull/1352
### Problem
For notifications bound to `[LOGIC]:[UserLogic]:[]:[delete]:[SUCCESS]`,
templates that reference the subject user (e.g.
`${user.getPlainAttr("u_email").get().values[0]}`) were evaluated with an empty
user: after delete, `userDAO.findById` no longer returns the entity, so the
JEXL context never received a user variable. The before snapshot from
`LogicInvocationHandler` already held a full `UserTO`, but it was not used when
the persisted entity was gone.
### Solution
In `DefaultNotificationManager.createTasks`, when no Any can be loaded from
the persistence layer but before is a `UserTO`, `GroupTO`, or `AnyObjectTO`,
populate the corresponding JEXL variables (user, group, anyObject) from that
snapshot so mail templates keep working for delete success events.
### Changes
`DefaultNotificationManager.java`: fallback to before transfer objects when
any is empty.
`DefaultNotificationManagerTest.java`: unit test with `userDAO.findById`
empty and a template using plain attributes (same JEXL style as existing mail
template tests).
### Testing
```
mvn -pl core/provisioning-java -Dtest=DefaultNotificationManagerTest test
mvn -pl core/provisioning-java checkstyle:check
mvn clean test -pl core/provisioning-java -am
mvn test (full reactor)
```
### References
https://issues.apache.org/jira/browse/SYNCOPE-1744
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]