[midPoint] Correlation query problem
Pavol Mederly
mederly at evolveum.com
Tue Mar 14 00:18:59 CET 2017
Hello Brad,
this is interesting. As far as I know, there is no problem in using the
return statement. Actually, these two pieces of code:
y + '-' + m + '-' + d
and
db = y + '-' + m + '-' + d
log.error('The date of birth is {}', db)
return db
are (in my opinion) equivalent. I regularly write scripts within
midPoint objects with and without the return statement; and there are no
problems with both variants.
To be honest, although I'm not 100% sure (as I'm not a groovy expert).
I suppose the problem is (was?) probably elsewhere.
Pavol Mederly
Software developer
evolveum.com
On 14.03.2017 0:07, Brad Fardig wrote:
>
> Thanks Pavol,
>
> It is now working. I also realised that it wasn’t matching because of
> an issue with the DOB script, once I removed the logging and the
> return statement it started working.
>
> The script now looks like:
>
> <q:equal>
>
> <q:path>extension/_dob_</q:path>
>
> <c:expression>
>
> <script>
>
> <language>http://midpoint.evolveum.com/xml/ns/public/expression/language#Groovy</language>
>
> <code>
>
> DoB = basic.getAttributeValue(shadow,
> 'http://midpoint.evolveum.com/xml/ns/public/resource/instance-3', 'DoB')
>
> (d,m,y) = DoB?._tokenize_('/')
>
> y + '-' + m + '-' + d
>
> </code>
>
> </script>
>
> </c:expression>
>
> </q:equal>
>
> Should I not use a return statement within a script?
>
> Regards,
>
> Brad
>
> *From:*midPoint [mailto:midpoint-bounces at lists.evolveum.com] *On
> Behalf Of *Pavol Mederly
> *Sent:* Monday, 13 March 2017 10:26 PM
> *To:* midpoint at lists.evolveum.com
> *Subject:* Re: [midPoint] Correlation query problem
>
> Hello Brad,
>
> normIgnoreCase is OK, because givenName and lastName are so called
> polystrings (polymorphic strings; they have original and normalized
> value). And these are to be compared using polyStringNorm,
> polyStringOrig, polyStringStrict, normIgnoreCase, origIgnoreCase, and
> strictIgnoreCase rules. (Just BTW, polyStringNorm comparison is
> already case-insensitive, so I'd suggest using it instead of
> normIgnoreCase. The latter is a bit of "hack". But nevertheless, it
> should work.)
>
> Your query look right to me.
>
> I would suggest you to enable logging: TRACE for
> com.evolveum.midpoint.model.impl.sync.CorrelationConfirmationEvaluator.
>
> And then have a look for entry containing:
>
> SYNCHRONIZATION: CORRELATION: expression for results in filter
>
> If needed, you could post it here, we'll try to help you with that.
>
> Best regards,
>
> Pavol Mederly
> Software developer
> evolveum.com
>
> On 13.03.2017 12:21, Brad Fardig wrote:
>
> Having some issues with a correlation query on a csv resource with
> midpoint 3.4
>
> The issue is I’m not getting any linking with existing user
> records i.e. all records read from the CSV file are unmatched.
>
> I need to do case insensitive string matching. I’ve tried
> stringIgnoreCase but receive an error. I’ve also set the
> |http://prism.evolveum.com/xml/ns/public/matching-rule-3|
> namespace as mr but receive an error for mr:stringIgnoreCase as well
>
> I’ve tried various selection from the known matching rules here:
> https://wiki.evolveum.com/display/midPoint/Matching+Rules
>
> If anybody can provide any insight into what I’m not seeing/doing
> it will be greatly appreciated.
>
> The query is:
>
> <correlation>
>
> <q:description>
>
> match on givenName == FirstName , familyName == LastName , DoB ==
> _dob_
>
> </q:description>
>
> <q:and>
>
> <q:equal>
>
> <q:matching>|normIgnoreCase|</q:matching>
>
> <q:path>familyName</q:path>
>
> <c:expression>
>
> <c:path>$c:account/c:attributes/ri:LastName</c:path>
>
> </c:expression>
>
> </q:equal>
>
> <q:equal>
>
> <q:matching>|normIgnoreCase|</q:matching>
>
> <q:path>givenName</q:path>
>
> <c:expression>
>
> <c:path>$c:account/c:attributes/ri:FirstName</c:path>
>
> </c:expression>
>
> </q:equal>
>
> <q:equal>
>
> <q:path>extension/_dob_</q:path>
>
> <c:expression>
>
> <script>
>
> <language>http://midpoint.evolveum.com/xml/ns/public/expression/language#Groovy</language>
>
> <code>
>
> DoB = basic.getAttributeValue(shadow,
> 'http://midpoint.evolveum.com/xml/ns/public/resource/instance-3',
> 'DoB')
>
> (d,m,y) = DoB?._tokenize_('/')
>
> _db_ = y + '-' + m + '-' + d
>
> log.error('The date of birth is {}', _db_)
>
> return _db_
>
> </code>
>
> </script>
>
> </c:expression>
>
> </q:equal>
>
> </q:and>
>
> </correlation>
>
> Regards
>
> Brad
>
>
>
>
> _______________________________________________
>
> midPoint mailing list
>
> midPoint at lists.evolveum.com <mailto:midPoint at lists.evolveum.com>
>
> http://lists.evolveum.com/mailman/listinfo/midpoint
>
>
>
>
> /This email, and any attachment, is confidential and also privileged.
> If you have received it in error, please notify me immediately and
> delete it from your system along with any attachments. You should not
> copy or use it for any purpose, nor disclose its contents to any other
> person. /
>
>
>
> _______________________________________________
> 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/20170314/1d8cbb46/attachment.htm>
More information about the midPoint
mailing list