[midPoint] get extended attribute in notification

Steklac Michal Michal_Steklac at datalan.sk
Sun May 3 15:52:12 CEST 2015


Hi,

I made an example in which obtains the value of the attribute family name and attribute internship. Attribute value family name received. When I trying to get the value for attribute internship, then I get null.

----------------------------------------------------------------------
* code to get family name
...
def NS_FOO = 'http://midpoint.evolveum.com/xml/ns/test/foo-1.xsd';
delta = ObjectDelta.summarize(((ModelEvent) event).getUserDeltas());
if(delta != null){
log.info("delta = " + delta.toString());
QName USER_FAMILYNAME_QNAME = new QName(NS_FOO,"familyName");
if(delta.findPropertyDelta(USER_FAMILYNAME_QNAME)!=null){
log.info("familyname="+requestee.getFamilyName());
}
}
...
* output
...
2015-05-03 15:24:43,391 [RESOURCEOBJECTCHANGELISTENER] [midPointScheduler_Worker-5] INFO (com.evolveum.midpoint.expression): delta = ObjectDelta(UserType:cbd8aee0-802e-43ef-a1c7-30cb79c811f0,MODIFY: Property
Delta( / fullName, REPLACE), PropertyDelta( / familyName, REPLACE), PropertyDelta(metadata / {.../common/common-3}modifyChannel, REPLACE), PropertyDelta(metadata / {.../common/common-3}modifyTimestamp, REPLA
CE), ReferenceDelta(metadata / {.../common/common-3}modifierRef, REPLACE))
2015-05-03 15:24:43,397 [RESOURCEOBJECTCHANGELISTENER] [midPointScheduler_Worker-5] INFO (com.evolveum.midpoint.expression): familyname=Malá
...
----------------------------------------------------------------------

----------------------------------------------------------------------
* code to get intership, which is extension attribute
...
def NS_FOO = 'http://midpoint.evolveum.com/xml/ns/test/foo-1.xsd';
delta = ObjectDelta.summarize(((ModelEvent) event).getUserDeltas());
if(delta != null){
log.info("delta = " + delta.toString());
QName USER_INTERNSHIP_QNAME = new QName(NS_FOO, "internship", "extension");
log.info("delta.findPropertyDelta(USER_INTERNSHIP_QNAME)!=null    " + (delta.findPropertyDelta(USER_INTERNSHIP_QNAME)!=null).toString());
if(delta.findPropertyDelta(USER_INTERNSHIP_QNAME)!=null){
log.info("internship="+basic.getExtensionPropertyValue(requestee, 'http://evolveum.com/my', 'internship'));
}
}
...
* output
...
2015-05-03 15:32:57,490 [RESOURCEOBJECTCHANGELISTENER] [midPointScheduler_Worker-4] INFO (com.evolveum.midpoint.expression): delta = ObjectDelta(UserType:cbd8aee0-802e-43ef-a1c7-30cb79c811f0,MODIFY: Property
Delta(extension / internship, REPLACE), PropertyDelta(metadata / {.../common/common-3}modifyChannel, REPLACE), PropertyDelta(metadata / {.../common/common-3}modifyTimestamp, REPLACE), ReferenceDelta(metadata
/ {.../common/common-3}modifierRef, REPLACE))
2015-05-03 15:32:57,491 [RESOURCEOBJECTCHANGELISTENER] [midPointScheduler_Worker-4] INFO (com.evolveum.midpoint.expression): delta.findPropertyDelta(USER_INTERNSHIP_QNAME)!=null    false
...
----------------------------------------------------------------------

Please tell me what I'm doing wrong.

Thanks,
Miso

On So, 2015-05-02 at 20:51 +0000, Steklac Michal wrote:
Hi,

i have extend schema with attribute internship. It is possible get their value in notification.

This works for me for attribute givenName
...
QName USER_GIVENNAME_QNAME = new QName(NS_FOO,"givenName");
    if(delta.findPropertyDelta(USER_GIVENNAME_QNAME)!=null){
    attr = attr+'\nmeno='+requestee.getGivenName();
}
...

Thanks
MiSo

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


More information about the midPoint mailing list