[midPoint] cannot use extensions in notification body?

Jason Everling jeverling at bshp.edu
Tue Jan 8 21:11:58 CET 2019


Seriously, it was the semi-colon for each body expression :/ . 2 hours of
fiddling with this, when I wrote the new expressions I must have added it.
Why doesn't it work with a semi-colon?

This doesn't work

body = ''

if (basic.getExtensionPropertyValue(requestee, 'http://the.namespace.com',
'attr1') == 'someValue') {
    body = "This messege";
} else if (basic.getExtensionPropertyValue(requestee, '
http://the.namespace.com', 'attr2') == 'someValue') {
   body = "Different messege";
} else {
   body = "Last messege";
}

But this does,

body = ''

if (basic.getExtensionPropertyValue(requestee, 'http://the.namespace.com',
'attr1') == 'someValue') {
    body = "This messege"
} else if (basic.getExtensionPropertyValue(requestee, '
http://the.namespace.com', 'attr2') == 'someValue') {
   body = "Different messege"
} else {
   body = "Last messege"
}

JASON


On Tue, Jan 8, 2019 at 1:59 PM Pálos Gustáv <gustav.palos at evolveum.com>
wrote:

> Hi,
>
> I use the same way to get extension attributes at least
> in simpleUserNotifier bodyExpression.
> Try to log his value (is not empty?), maybe you have a problem with the
> comparison, try basic.stringify(...) or equal()...
>
> Best regards,
>
> Gustav
>
> ut 8. 1. 2019 o 20:46 Jason Everling <jeverling at bshp.edu> napísal(a):
>
>> I was working on updating some ancient notifications we have,
>> streamlining them, and noticed when using an extension attribute it doesn't
>> work or when it sends it sends a blank body even though the attribute
>> values are correct
>>
>> For example, the below doesn't work in body expression but they work fine
>> in subject expression, is there a different way to do it in body?
>>
>> body = ''
>>
>> if (basic.getExtensionPropertyValue(requestee, 'http://the.namespace.com',
>> 'attr1') == 'someValue') {
>>     body = "This messege"
>> } else if (basic.getExtensionPropertyValue(requestee, '
>> http://the.namespace.com', 'attr2') == 'someValue') {
>>    body = "Different messege"
>> } else {
>>    body = "Last messege"
>> }
>> _______________________________________________
>> midPoint mailing list
>> midPoint at lists.evolveum.com
>> http://lists.evolveum.com/mailman/listinfo/midpoint
>>
>
>
> --
> Gustáv Pálos
> Identity Engineer
> evolveum.com
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20190108/676a0476/attachment.htm>


More information about the midPoint mailing list