On 25/09/2014 17:29, Guido Wimmel wrote:
Hi,
up to Syncope 1.1.4, notifications could be sent based on the performed tasks
as reported back by the UserWorkflowAdapter (e.g. UserController.create():
notificationManager.createTasks(created.getResult().getKey(),
created.getPerformedTasks()).
Since Syncope 1.1.5, this was apparently changed (via SYNCOPE-423) such that the event
passed to the notification manager to determine which notification is sent is only based
on the method name in the ...Controller-Class. Even if you execute a workflow task via
UserWorkflowController.executeWorkflowTask(), you only get
"executeWorkflowTask" as an event.
Is this correct? If so, is there another way currently to use the performed
task to decide which notifications are sent?
Hi Guido,
as you correctly report above, with Syncope 1.1.5+ (including 1.2.X) the
notification mechanism has completely changed and is now much more
powerful than it used to be: you can get notified of nearly any event
occurring in the system (by empowering aspect programming).
But as you know, power comes at a price: sending notifications from
workflow is now slightly different.
As part of SYNCOPE-135 - which I should be able to resolve today - I
have developed a simple general-purpose notification triggering utility
[1] available to be invoked from within Activiti workflow; as you can
see, such class can be easily backported to 1.1.X (or even copied over
with minimal modifications to any overlay project for Syncope 1.1.5+).
Basically, the idea is to define notification for CUSTOM events - see
[2] (first notification defined there) - and then to trigger such
notifications from within workflow by using the Notify task as said
above; naturally, you'll need to match the event string provided for the
CUSTOM notification with the 'event' workflow variable to trigger the
desired notification.
At least an explaining wiki page is worthwhile for this new mechanism;
backporting [1] to branch 1_1_X is also desirable.
Regards.
[1]
https://svn.apache.org/repos/asf/syncope/branches/1_2_X/core/src/main/java/org/apache/syncope/core/workflow/user/activiti/task/Notify.java
[2]
https://svn.apache.org/repos/asf/syncope/branches/1_2_X/core/src/main/resources/content.xml
--
Francesco Chicchiriccò
Tirasa - Open Source Excellence
http://www.tirasa.net/
Involved at The Apache Software Foundation:
member, Syncope PMC chair, Cocoon PMC, Olingo PMC
http://people.apache.org/~ilgrosso/