[midPoint] How to remove value from valueFrom and valueTo attribs

Radovan Semancik radovan.semancik at evolveum.com
Thu Oct 20 10:35:15 CEST 2016


Hi,

It depends on the input delta in the mapping. If the input just adds the 
values then the mapping cannot really remove anything. Mappings are 
relative. They work with each value individually. If the mapping for any 
specific value returns null or empty value we interpret that as "nothing 
to be added". But we usually do not remove anything as that will break 
the relativity and it may cause consistency issues. This is what we need 
maybe 99% of the time. In this relative mode we do not expect that 
adding a value will remove another value as that's not usually the case.

Yet, there are two ways how to do it:

1) Use absolute mapping. That will take all the input values and produce 
all the output values (no relativity). Therefore if absolute mapping 
returns null it is interpreted as "this should not have any values". But 
beware: absolute mappings are brutal. Take care not to break 
consistency. But as this is a single-value property then it is probably 
OK. Concurrent modifications would overwrite the same value anyway. 
Relativity will not save us here.

2) Even better: use condition with the mapping. The expression in the 
mapping should only transform the value. It should not be used to 
control when the value should be present in the output and when it 
should not. Condition controls when the mapping is applied. Look at it 
in a different way: What you want is NOT removal of the value. What you 
want is to use the value only if some condition is true. That's what the 
mapping condition is for. MidPoint interprets the condition in a smart 
way. MidPoint knows what values are produced by the mapping. If the 
condition state changes from true to false then midPoint knows that it 
has to remove the values given by that mapping. This is a fully 
"relativistic" way. And it is consistency friendly.

-- 
Radovan Semancik
Software Architect
evolveum.com




On 10/20/2016 09:23 AM, Roman Pudil - AMI Praha a.s. wrote:
> Hi all,
> how to simply remove value (XMLGregorianCaledndar) from valueFrom and 
> valueTo attribs in mappings (in template objects)?
>
> Null, empty string and space did not helped.
>
> Thanks!
>
> Regards
>
> Roman Pudil
> solution architect
>
> gsm: [+420] 775 663 666
> e-mail:roman.pudil at ami.cz <mailto:roman.pudil at ami.cz>
>
> 			
>
> AMI Praha a.s.
> Pláničkova 11
> 162 00 Praha 6
> tel./fax: [+420] 274 783 239
> web:www.ami.cz <http://www.ami.cz>
>
> 			
>
>
> <http://www.ami.cz/reseni-a-sluzby/bezpecnost-dat/identity-management>
>
> Textem tohoto e-mailu podepisující neslibuje uzavřít ani neuzavírá za 
> společnost AMI Praha a.s.
> jakoukoliv smlouvu. Každá smlouva, pokud bude uzavřena, musí mít 
> výhradně písemnou formu.
>
>
>
>
> _______________________________________________
> 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/20161020/0e7fa38b/attachment.htm>


More information about the midPoint mailing list