[midPoint] Custom Event - notificationManager

Sylvaire kevin TIPA sylvaire-kevin.tipa at mythalesgroup.io
Thu Apr 19 09:04:06 CEST 2018


reply to myself, the notification manager can be get by :

import com.evolveum.midpoint.wf.impl.processes.common.SpringApplicationContextHolder
NotificationManager notificationManager = SpringApplicationContextHolder.getBean("notificationManagerImpl", NotificationManager.class)


I'm not sure that is the right way ... by it work



Cordialement.


Sylvaire-Kevin TIPA
Thales Services / OIC INFRAS
Devops Infrastructure Automation

        [cid:068d6bed-3cf4-403e-a790-5ed4030ae567]





THALES SERVICES SAS
44 Quai Charles de Gaulle
CS 20100
69463 Lyon Cedex 06



--------------------------------------------------
www.thalesgroup.com<http://www.thalesgroup.com>

________________________________
De : midPoint <midpoint-bounces at lists.evolveum.com> de la part de Sylvaire kevin TIPA <sylvaire-kevin.tipa at mythalesgroup.io>
Envoyé : mercredi 18 avril 2018 16:20:44
À : midpoint at lists.evolveum.com
Objet : [midPoint] Custom Event - notificationManager


Cet expéditeur n’a pas passé les vérifications relatives à la détection des fraudes et n’est peut-être pas la personne qu’il prétend être. En savoir plus sur l’ usurpation d’identités<http://aka.ms/LearnAboutSpoofing>
        Votre avis<http://aka.ms/SafetyTipsFeedback>

Hello,


I try (so hard) to generate custom event in Java, but I get a NULL pointer exception each time...


Follow the documentation, we just have this information :

Event event = new CustomEvent(lightweightIdentifierGenerator, subtype, handler, item, operation, status, channel);
notificationManager.processEvent(event, task, result);


So I create a custom Event correctly (I think) but the process event always fail ... I'm not sure about "How I can get notificationManager object"...


I work in Hook in userType / primary. Anyone know how to generate custom event ?


See my code :


NotificationManager notificationManager = new NotificationManagerImpl() //Probably wrong !

Event event = new CustomEvent(lightweightIdentifierGenerator, "CustomUserRegistrationNotifier", null, user, EventOperationType.ADD, EventStatusType.SUCCESS, null);

notificationManager.processEvent(event)




Here the log :

Caused by: java.lang.NullPointerException: null
        at com.evolveum.midpoint.notifications.impl.NotificationManagerImpl.processEvent(NotificationManagerImpl.java:102)
My event object :

>>>event  CustomEvent
    id: 1524061049969-0-1
    requester: null
    requestee: null
    subtype: CustomUserRegistrationNotifier



According to the error log, the source code with problem is in https://github.com/Evolveum/midpoint/blob/80956776707531988908314f7dc1ef47a1e9b25b/model/notifications-impl/src/main/java/com/evolveum/midpoint/notifications/impl/NotificationManagerImpl.java ligne 102 :

[https://avatars1.githubusercontent.com/u/6286905?s=400&v=4]<https://github.com/Evolveum/midpoint/blob/80956776707531988908314f7dc1ef47a1e9b25b/model/notifications-impl/src/main/java/com/evolveum/midpoint/notifications/impl/NotificationManagerImpl.java>

Evolveum/midpoint<https://github.com/Evolveum/midpoint/blob/80956776707531988908314f7dc1ef47a1e9b25b/model/notifications-impl/src/main/java/com/evolveum/midpoint/notifications/impl/NotificationManagerImpl.java>
github.com
midpoint - MidPoint Identity Manager



Task task = taskManager.createTaskInstance(OPERATION_PROCESS_EVENT);

MP : 3.6




Cordialement.


Sylvaire-Kevin TIPA
Thales Services / OIC INFRAS
Devops Infrastructure Automation

        [cid:25912ed8-c5af-43d7-91a2-e73cc3597829]





THALES SERVICES SAS
44 Quai Charles de Gaulle
CS 20100
69463 Lyon Cedex 06



--------------------------------------------------
www.thalesgroup.com<http://www.thalesgroup.com>

This message contains confidential information and is intended only for the individual(s) addressed in the message. If you are not the named addressee, you should not disseminate, distribute, or copy this e-mail. If you are not the intended recipient, you are notified that disclosing, distributing, or copying this e-mail is strictly prohibited.

This message contains confidential information and is intended only for the individual(s) addressed in the message. If you are not the named addressee, you should not disseminate, distribute, or copy this e-mail. If you are not the intended recipient, you are notified that disclosing, distributing, or copying this e-mail is strictly prohibited.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20180419/8508ec37/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Outlook-mubeirnh.png
Type: image/png
Size: 6112 bytes
Desc: Outlook-mubeirnh.png
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20180419/8508ec37/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Outlook-cosxwd0w.png
Type: image/png
Size: 6112 bytes
Desc: Outlook-cosxwd0w.png
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20180419/8508ec37/attachment-0001.png>


More information about the midPoint mailing list