Only use DefaultValue in MappedAttributeDefinition if Dependency in not empty

David Huebner david.huebner at daasi.de
Fri Jun 2 07:31:40 EDT 2017


Hi all,

here is what I want to do:
There are two ADs, each has its own DataConnector.
A user (which is unique over both ADs, so only one DataConnector 
produces values) can have 0..n memberOf attributes.
I want to check if any of them matches some list. However, this should 
only happen, if the user was found in one (specific) of the two ADs.

If it does match, use that value.
If it does not, return a Default value.
If the DataConnector did not produce any value (i.e. the User is in the 
other AD), return nothing.

I'm using an AttributeDefinition with like this:
<Dependency ref=someInput">
<DefaultValue>Some Value</DefaultValue>
<ValueMap>
   <ReturnValue>Val1</ReturnValue>
   <SourceValue>Val1</SourceValue>
   <ReturnValue>Val2</ReturnValue>
   <SourceValue>Val2</SourceValue>
</ValueMap>

My issue is, that I always get the DefaultValue, so even if the 
Dependency did not produce any values (i.e. the user is not in the AD I 
use the DataConnector of), I still get the DefaultValue.

Reading through the explanation for DefaultValue I do understand why 
that happens, but can't really find a way to work around that and 
achieve what I explained.

A ScriptedAttributeDefinition would probably work, but I wonder if I am 
missing something to make it work with a MappedAttributeDefinition.

Thanks!

-- 
David Hübner, Solutions Engineer

DAASI International GmbH
Europaplatz 3
D-72072 Tübingen
Germany

phone: +49 7071 407109-0
fax:   +49 7071 407109-9
email: david.huebner at daasi.de
web:   www.daasi.de

Sitz der Gesellschaft: Tübingen
Registergericht: Amtsgericht Stuttgart, HRB 382175
Geschäftsleitung: Peter Gietz



More information about the users mailing list