<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Hello,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">I try (so hard) to generate custom event in Java, but I get a NULL pointer exception each time...
<br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Follow the documentation, we just have this information :
<br>
</p>
<p style="margin-top:0;margin-bottom:0"></p>
<div class="container" title="Hint: double-click to select code">
<div class="line number1 index0 alt2"><code class="java plain">Event event = </code>
<code class="java keyword">new</code> <code class="java plain">CustomEvent(lightweightIdentifierGenerator, subtype, handler, item, operation, status, channel);</code></div>
<div class="line number2 index1 alt1"><code class="java plain">notificationManager.processEvent(event, task, result);</code></div>
</div>
<p></p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">So I create a custom Event correctly (I think) but the process event always fail ... I'm not sure about "How I can get
<code class="java plain">notificationManager</code> object"... <br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">I work in Hook in userType / primary. Anyone know how to generate custom event ?<br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">See my code : <br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"><span>NotificationManager notificationManager = new NotificationManagerImpl() //Probably wrong ! </span></p>
<p style="margin-top:0;margin-bottom:0"><span>Event event = new CustomEvent(lightweightIdentifierGenerator, "CustomUserRegistrationNotifier", null, user, EventOperationType.ADD, EventStatusType.SUCCESS, null);</span></p>
<p style="margin-top:0;margin-bottom:0"><span>notificationManager.processEvent(event)
<br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span><br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span><br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span><br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span>Here the log : <br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span></p>
<div>Caused by: java.lang.NullPointerException: null<br>
at com.evolveum.midpoint.notifications.impl.NotificationManagerImpl.processEvent(NotificationManagerImpl.java:102)</div>
My event object : <br>
</span>
<p></p>
<p style="margin-top:0;margin-bottom:0"><span></p>
<div>>>>event CustomEvent<br>
id: 1524061049969-0-1<br>
requester: null<br>
requestee: null<br>
subtype: CustomUserRegistrationNotifier</div>
<br>
</span>
<p></p>
<p style="margin-top:0;margin-bottom:0"><span><br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span>According to the error log, the source code with problem is in <a href="https://github.com/Evolveum/midpoint/blob/80956776707531988908314f7dc1ef47a1e9b25b/model/notifications-impl/src/main/java/com/evolveum/midpoint/notifications/impl/NotificationManagerImpl.java" class="OWAAutoLink" id="LPlnk898856" previewremoved="true">https://github.com/Evolveum/midpoint/blob/80956776707531988908314f7dc1ef47a1e9b25b/model/notifications-impl/src/main/java/com/evolveum/midpoint/notifications/impl/NotificationManagerImpl.java</a>
ligne 102 : </p>
<div id="LPBorder_GT_15240611599080.4927771797040431" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_15240611599020.5398541411585995" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);" role="presentation" cellspacing="0">
<tbody>
<tr style="border-spacing: 0px;" valign="top">
<td id="ImageCell_15240611599040.811618755774556" style="width: 250px; position: relative; display: table-cell; padding-right: 20px;" colspan="1">
<div id="LPImageContainer_15240611599040.003132357078344805" style="background-color: rgb(255, 255, 255); height: 250px; position: relative; margin: auto; display: table; width: 250px;">
<a id="LPImageAnchor_15240611599040.597060201650834" style="display: table-cell; text-align: center;" href="https://github.com/Evolveum/midpoint/blob/80956776707531988908314f7dc1ef47a1e9b25b/model/notifications-impl/src/main/java/com/evolveum/midpoint/notifications/impl/NotificationManagerImpl.java" target="_blank"><img style="display: inline-block; max-width: 250px; max-height: 250px; height: 250px; width: 250px; border-width: 0px; vertical-align: bottom;" id="LPThumbnailImageID_15240611599040.7259316360750482" width="250" height="250" src="https://avatars1.githubusercontent.com/u/6286905?s=400&v=4"></a></div>
</td>
<td id="TextCell_15240611599040.08718670032233933" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;" colspan="2">
<div id="LPRemovePreviewContainer_15240611599040.40756474927958974"></div>
<div id="LPTitle_15240611599040.3353754313915821" style="top: 0px; color: rgb(54, 159, 71); font-weight: 400; font-size: 21px; font-family: "wf_segoe-ui_light", "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_15240611599060.9585511984768772" style="text-decoration: none;" href="https://github.com/Evolveum/midpoint/blob/80956776707531988908314f7dc1ef47a1e9b25b/model/notifications-impl/src/main/java/com/evolveum/midpoint/notifications/impl/NotificationManagerImpl.java" target="_blank">Evolveum/midpoint</a></div>
<div id="LPMetadata_15240611599060.5440761773250483" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: 400; font-family: "wf_segoe-ui_normal", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
github.com</div>
<div id="LPDescription_15240611599060.329645598351604" style="display: block; color: rgb(102, 102, 102); font-weight: 400; font-family: "wf_segoe-ui_normal", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
midpoint - MidPoint Identity Manager</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
</span>
<p></p>
<p style="margin-top:0;margin-bottom:0"><span></p>
<div><span class="pl-smi">Task</span> task <span class="pl-k">=</span> taskManager<span class="pl-k">.</span>createTaskInstance(<span class="pl-c1">OPERATION_PROCESS_EVENT</span>);<br>
<br>
MP : 3.6<br>
</div>
</span><br>
<p></p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, "EmojiFont", "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<br>
<p style="margin-top:0; margin-bottom:0">Cordialement. </p>
<table class="MsoNormalTable" style="width:100.0%; border:none; border-top:solid #00BBDF 3.0pt" width="100%" cellspacing="0" cellpadding="0" border="1">
<tbody>
<tr>
<td style="border:medium none; padding:0cm; width:301px" valign="top"></td>
</tr>
</tbody>
</table>
<table class="ms-rteTable-clear" style="border-collapse:collapse; table-layout:fixed; border:1px solid transparent" cellspacing="0">
<tbody>
<tr class="ms-rteTableEvenRow-clear" style="border-collapse:collapse; border:1px solid transparent; background-color:rgba(255,255,255,0.85)">
<td class="ms-rteTableEvenCol-clear" style="border-collapse:collapse; width:208px; border:1px solid transparent">
<b><span style="background-color:rgb(255,255,255); color:rgb(0,111,201)">Sylvaire-Kevin TIPA</span></b><br>
<div><i><span style="font-size:10pt; color:rgb(117,123,128)">Thales Services / OIC INFRAS</span><br>
</i><span style="font-size:10pt; color:rgb(117,123,128)"><i>Devops Infrastructure Automation</i></span></div>
</td>
<td class="ms-rteTableOddCol-clear" colspan="1" style="border-collapse:collapse; width:23px; border:1px solid transparent">
<br>
</td>
<td class="ms-rteTableEvenCol-clear" style="border-collapse:collapse; width:188px; border:1px solid transparent" align="right">
<img class="EmojiInsert" src="cid:25912ed8-c5af-43d7-91a2-e73cc3597829"><br>
</td>
</tr>
<tr class="ms-rteTableOddRow-clear" style="border-collapse:collapse; border:1px solid transparent; background-color:rgba(255,255,255,0.85)">
<td class="ms-rteTableEvenCol-clear" style="border-collapse:collapse; border:1px solid transparent">
<br>
</td>
<td class="ms-rteTableOddCol-clear" colspan="1" style="border-collapse:collapse; border:1px solid transparent">
<br>
</td>
<td class="ms-rteTableEvenCol-clear" style="border-collapse:collapse; border:1px solid transparent">
<br>
</td>
</tr>
<tr class="ms-rteTableEvenRow-clear" style="border-collapse:collapse; border:1px solid transparent; background-color:rgba(255,255,255,0.85)">
<td class="ms-rteTableEvenCol-clear" style="border-collapse:collapse; border:1px solid transparent">
<div><span style="color:rgb(117,123,128)">THALES SERVICES SAS</span><br>
<span style="color:rgb(117,123,128)">44 Quai Charles de Gaulle</span><br>
<span style="color:rgb(117,123,128)">CS 20100</span><br>
<span style="color:rgb(117,123,128)">69463 Lyon Cedex 06</span></div>
</td>
<td class="ms-rteTableOddCol-clear" colspan="1" style="border-collapse:collapse; border:1px solid transparent">
<br>
</td>
<td class="ms-rteTableEvenCol-clear" style="border-collapse:collapse; border:1px solid transparent">
<br>
</td>
</tr>
</tbody>
</table>
<span style="font-size:8pt; color:rgb(117,123,128)">--------------------------------------------------<br>
<a href="http://www.thalesgroup.com" class="OWAAutoLink" id="LPNoLP">www.thalesgroup.com</a><br>
</span><i></i>
<p></p>
</div>
</div>
</div>
<p style="font-size:8pt; line-height:10pt; font-family: 'Cambria','times roman',serif;">
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.
</p>
</body>
</html>