On 20/07/2018 04:47, [email protected] wrote:
Hi Dima, thank you for your reply.
Is there a reference that includes a more detailed description of how to use
the notifications? If I add a notification after the createApproval I am
still not clear on what I am triggering the notification with. As an
example, the reset password notification occurs on the
[CUSTOM]:[]:[]:[requestPasswordReset]:[SUCCESS] event. Is there a custom
event I should be referring to?
For the password reset I can see the /confirmPasswordReset rest operation,
so I can see why we use it there, but for the case of the createApproval it
is not obvious to me what operation I should be using to create the
notification.
Is some more detailed notifications documentation available?
Hi,
have you already found [1] and [2] in particular, which explains the
events mechanism?
Custom events (as the one you report above for password reset) are
explicitly triggered by code; standard events are instead automatically
triggered by the execution of certain predefined actions.
Standard events cover things like as user login, propagation to external
resources, pull task execution, etc.
In your own case - notification upon user activation - I would:
1. extend the workflow definition as suggested by Dima
2. attach a ServiceTask to the transition to the 'active' state (e.g.
after approval), where you trigger the custom notification: see [3] as
an example of how to invoke the notificationManager to trigger a given
notification
Supposing that you define a Notification for the
[CUSTOM]:[]:[]:[userActivated]:[SUCCESS]
event, then you can trigger it from code as
notificationManager.createTasks(
AuditElements.EventCategoryType.CUSTOM,
null,
null,
"userActivated",
AuditElements.Result.SUCCESS,
userTO,
null,
null);
HTH
Regards.
[1] http://syncope.apache.org/docs/reference-guide.html#notifications
[2] http://syncope.apache.org/docs/reference-guide.html#notification-events
[2]
https://github.com/apache/syncope/blob/2_1_X/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Notify.java#L51-L59
--
Francesco Chicchiriccò
Tirasa - Open Source Excellence
http://www.tirasa.net/
Member at The Apache Software Foundation
Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
http://home.apache.org/~ilgrosso/