[midPoint] Send notification on assigning or removing selected roles

Marco Benucci m.benucci at nsr.it
Tue May 16 11:57:13 CEST 2017


Hi,

I have to send a notification when some roles are assigned or removed.
These roles are particular entitlements from an AD and they all have a 
prefix in their name (REF_<roleName>), they are more or less 60 roles.
I'm trying to use a GeneralNotifier, using the expressionFilter for 
filtering theese particular events.

I saw that i can find the Delta using the event with

delta = ObjectDelta.summarize(((ModelEvent) event).getFocusDeltas());

but from here I cannot find the name of the roles involved in the 
modifications...

I tryed:

import com.evolveum.midpoint.notifications.impl.NotificationFuctionsImpl;
import com.evolveum.midpoint.notifications.impl.formatters.TextFormatter;

def textFormatter = new TextFormatter();
def NotificationFuctionsImpl = new NotificationFuctionsImpl();
def hiddenPaths = NotificationFunctionsImp.getAuxiliaryPaths();

def formattedDelta = textFormatter.formatObjectModificationDelta(delta, 
hiddenPaths, false);

Now, removing a role, the textFormatter.formatObjectModificationDelta 
works and I can detect what roles are involved (if any), but adding a 
role, provoke a nullPointerException...

This is the stackTrace.
https://pastebin.com/jsK2KRNy


Is there an alternatives in doing this? How can I detect if a subset of 
roles is involved during an user modification?

Thank you,
Marco



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20170516/a5027834/attachment.htm>


More information about the midPoint mailing list