[midPoint] remove attr & get old value in notification
Pavol Mederly
mederly at evolveum.com
Wed Jun 24 14:08:26 CEST 2015
Hello MiSo,
the attribute removal in "pure form" seems to be a problem just now.
I've just created a jira issue for it:
https://jira.evolveum.com/browse/MID-2421
However, it is possible to create a workaround, putting empty string
('') instead of null there. See example in the mentioned jira, setting
allowEmptyValues parameter to TRUE.
As for your second question, it should be possible to do something like
this:
oldObject = event.getFocusContext().getObjectOld()
basic.getExtensionPropertyValue(oldObject, '', INTERNSHIP_NAME)
(I have not actually tried it, but it should work.)
Best regards,
Pavol
On 22. 6. 2015 8:47, Steklac Michal wrote:
> Hi,
>
> I have two question:
> 1) How can I remove attribute value? I want set value only if contains
> some substring.
> ...
> <inbound>
> <strength>strong</strength>
> <source>
> <path>$account/attributes/job_title</path>
> </source>
> <expression>
> <script>
> <language>http://midpoint.evolveum.com/xml/ns/public/expression/language#Groovy<
> <http://midpoint.evolveum.com/xml/ns/public/expression/language#Groovy%3C>/language>
> <code>
> String str = 'aaaa';
> String value = job_title;
> if(value.length() > 0 && value.contains(str)){
> return value;
> }
> //return '';
> //return null;
> </code>
> </script>
> </expression>
> <target>
> <path>$user/extension/jobTitle</path>
> </target>
> </inbound>
> ...
>
> 2) Can I get in notification old value? I get new value with
> ...
> INTERNSHIP_NAME = 'internship';
> String internship = basic.getExtensionPropertyValue(requestee, '',
> INTERNSHIP_NAME).toString();
> ...
>
> Thanks,
> MiSo
>
>
> _______________________________________________
> 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/20150624/4c90c4f2/attachment.htm>
More information about the midPoint
mailing list