[midPoint] Conditional synchronization errors
Wojciech Staszewski
wojciech.staszewski at diagnostyka.pl
Mon Nov 6 11:59:01 CET 2017
Thank you very much!
Now it >>almost<< works OK and I already know why.
I was trying to compare string attribute which contains national and some special characters like '/'.
When I compare simple boolean, integer or whatever it works. I have to figure out how to correct the condition to make it work.
Best regards,
WS
W dniu 06.11.2017 o 09:35, Ivan Noris pisze:
> Hi Wojciech,
>
> condition for <objectSynchronization> and condition for <correlation>
> are different. During the training I usually describe it like this:
>
> 1. condition for <objectSynchronization> means, that if it's true when
> evaluating shadow (account), the <objectSynchronization> section will be
> applied for that object and that kind and intent will be set for that
> object. This condition is the key to set proper kind/intent upon
> synchronization. If you have just one kind/intent, you don't need this
> condition.
>
> 2. condition for <correlation> means if the correlation filter will be
> applied. I use it for example to correlate by employeeNumber, but
> ignoring accounts with empty employeeNumber attribute as it could be
> evaluated as DISPUTED or even try to link the account to midpoint
> "administrator" (which does not have employeeNumber).
>
> I think you may even have more than one correlation expressions, but I
> don't have a sample ready.
>
>
> Personally I have never used combination of "declare default namespace",
> just for example "declare namespace
> ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3";"
>
> But as I'm checking my own real objects from 3.6, this should be enough
> (without namespace at all)
>
> <condition>
> <script>
> <code>
> name = basic.getAttributeValue(shadow,
> "login")
> //log.info("XXX Synchronization condition
> for account/default; name (getName()) = {}; name (getAttributeValue) =
> {}; evaluated to {}", shadow.getName(), name, !name?.startsWith('_'))
> return !name?.startsWith('_')
> </code>
> </script>
> </condition>
>
> I suggest you to use without defining namespace (at least for you
> provided example) and it should work. Regarding the error, it looks like
> a bug, but I hope someone from the devel team will know more. Of course
> you can create a new jira.
>
> Best regards,
>
> Ivan
>
>
> On 06.11.2017 09:19, Wojciech Staszewski wrote:
>> Hi all!
>>
>> I have some problems with condition rule in the synchronization for split accounts into few intents.
>> I follow the example provided in Evolveum github, eg. here:
>> https://github.com/Evolveum/midpoint/blob/master/testing/consistency-mechanism/src/test/resources/request/resource-modify-synchronization.xml
>>
>> <condition>
>> <script>
>> <code>
>> declare default namespace "http://midpoint.evolveum.com/xml/ns/public/common/common-3";
>> basic.getAttributeValue(account, 'employeeNumber') != null
>> </code>
>> </script>
>> </condition>
>>
>> When I'm using <condition> in the form from this example (the only change is the attribute name) and enter Resource>Accounts>Resource
>> midPoint is restarting (ie. Tomcat is resetting and midPoint is reloading).
>>
>> In the log I have error:
>>
>> Script11.groovy: 2: expecting EOF, found 'default' @ line 2, column 21.
>> declare default namespace "http://midpoint.evolveum.com/xml/ns/public/common/common-3";
>>
>> As you can see, Groovy doesn't like namespace declaration.
>> When I remove the declaration, the condition doesn't work either. All accounts have no intent at all.
>>
>> BTW: Where the <condition> section should be placed? Inside <correlation> or directly in <synchronization> section?
>> I tried to make condition using Wizard and the condition was placed in <synchronization> section, just before <correlation>.
>> In the example above <condition> is inside <correlation>. In such case Wizard can't see it and condition edit form is empty.
>>
>> Thanks!
>> Wojciech Staszewski.
>> _______________________________________________
>> midPoint mailing list
>> midPoint at lists.evolveum.com
>> http://lists.evolveum.com/mailman/listinfo/midpoint
>
More information about the midPoint
mailing list