Thank you Clément, I will keep my solution. Just to know, for other
developments, is it possible to take a pointer to the Java objects
instantiated by LSC? Maybe with reflection?
For instance, if the Main Identifier is not found, take the control of the
task object and change on the fly the destination service and bind to
another object.
It would be great being able to modify the synchronization behaviour based
on the lsc object evaluation.
Another thing I can think is to make use of a different destination
getOneFilter if the first one does not find the user...
Thank you,
Natan
On Tue, Apr 1, 2014 at 12:28 PM, Clément OUDOT <[email protected]> wrote:
>
>
>
> 2014-04-01 12:18 GMT+02:00 Natan Sanson <[email protected]>:
>
> Hi lsc users,
>>
>> I'm trying to do a DB to LDAP synch and I need to build this
>> synchronization rule
>>
>> If dstBean.getMainIdentifier().contains('ou=firstOu')
>>
>> <dataset>
>> <name>MyAttribute</name>
>> <policy>FORCE</policy>
>> </dataset>
>>
>> If dstBean.getMainIdentifier().contains('ou=secondOu')
>>
>> <dataset>
>> <name>MyAttribute</name>
>> <policy>KEEP</policy>
>> </dataset>
>>
>> I tried to define this flow writing
>>
>> <dataset>
>> <name>MyAttribute</name>
>> <policy>
>> if ((dstBean != null) &&
>> (dstBean.getMainIdentifier().contains('ou=firstOU')))
>> FORCE
>> else KEEP
>> </policy>
>> </dataset>
>>
>> But it seems that LSC does not evaluate JS inside the tag <policy>
>>
>> Is there any way to change the policy value during the forceValues
>> evaluation? Something like
>>
>> <dataset>
>> <name>MyAttribute</name>
>> <policy>
>> KEEP
>> </policy>
>> <forceValues>
>> if ((dstBean != null) &&
>> (dstBean.getMainIdentifier().contains('ou=firstOU'))) {
>> var myDataSetReference = *[get
>> a pointer to the right object];*
>> myDataSetReference.
>> *useAMethodToModifyThePolicyEnumerationValue("FORCE");*
>> }
>> </forceValues>
>> </dataset>
>>
>> if this is not possible the only way I see to achieve my goal is to do a
>> forceValues that places the destination value, already present
>>
>> <dataset>
>> <name>MyAttribute</name>
>> <policy>
>> FORCE
>> </policy>
>> <forceValues>
>> if ((dstBean != null) &&
>> (dstBean.getMainIdentifier().contains('ou=firstOU'))) {
>>
>> dstBean.getDatasetFirstValueById("MyAttribute");
>> }
>>
>> else srcBean.getDatasetFirstValueById("MyAttribute")
>> </forceValues>
>> </dataset>
>>
>> Assuming that the attribute is Single Valued. But this way is the worst
>> possible. I would prefer to mantain a KEEP policy when I don't need to
>> FORCE the value
>>
>> Any help is appreciated
>>
>>
> Indeed, we cannot use JS in policy. But for me your current solution is
> good: FORCE the destination values in the dataset in the case you want not
> to modify them. If LSC sees that dataset values are the same as destination
> values, no modification will be made on destination.
>
>
> Clément.
>
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org
lsc-users mailing list
[email protected]
http://lists.lsc-project.org/listinfo/lsc-users