[midPoint] RE : RE : RE : Namespace problem
Radovan Semancik
radovan.semancik at evolveum.com
Mon Sep 30 14:44:36 CEST 2013
On 09/27/2013 09:46 PM, Belleville-Rioux, Vincent wrote:
> Please ignore my previous message as I found that we can't have more
> than one extension schema at the same time. I merged my added
> attributes to the extension-whatever.xsd and it now works.
Yes. In 2.2 you are effectively limited to only one extension schema per
object type. Paul Heaney already pointed that out couple of days ago and
I have fixed it. The fix is in our support branch and will be part of
2.2.1 and 2.3 releases.
>
> I however have another question : how can we compare dates in
> mappings? I want to try and do a conditional mapping where the user
> start date is checked against today to see if the account should or
> should not be mapped to the role.
It depends on the datatypes of properties that you are comparing.
MidPoint is a fully typed system and it will convert the datatypes as
necessary. If you have specified xsd:dateTime datatype for both
properties then they will appear as XMLGregorianCalendar Java class in
the script expressions. Therefore you can use methods of
XMLGregorianCalendar to compare them
(http://docs.oracle.com/javase/7/docs/api/javax/xml/datatype/XMLGregorianCalendar.html).
Getting current date and time may be a bit tricky. I have just realized
that our function library lacks a convenient function for this. I will
add it (https://jira.evolveum.com/browse/MID-1622). Maybe the best way
to implement it in version 2.2 is to get system time in milliseconds
using System class, convert the dates from XMLGregorianCalendar to
milliseconds and compare them as longs.
If your datatypes are strings then you have to do the conversion
yourself. There are formatDateTime and parseDateTime functions in basic
library to help with that (see
https://wiki.evolveum.com/display/midPoint/Script+Expression+Functions).
However, there may be a drawback in using time in mappings. The mappings
are evaluated only if some mapping input changes. As time is not a
mapping input then the mapping may not be re-evaluated for a long time.
As mappings are always re-evaluated during reconciliation your approach
may work if you plan to run reconciliation often. However that may be
quite hard on the resources. MidPoint is designed not to rely on
reconciliation too much. We have experimented with time-based mappings
in version 2.2 (see
https://wiki.evolveum.com/display/midPoint/Mapping#Mapping-TimeConstraints).
The experiment went quite well therefore this may be a better way for
you. However, for version 2.2 this only works in activation mappings. We
plan to extend support for this also to other mappings if there is a
demand for it.
Also, roles are assigned to users by assignment data structure
(AssignmentType). This data structure has an "activation" section that
allows to specify the time from which the assignment should be
considered active. We have expected this and it is part of the schema.
We have similar mechanisms for user and account activation. In such case
midPoint takes care of correct timing of mapping re-evaluation and
re-provisioning. The bad news is that it is not yet implemented for
assignment evaluation. However the implementation should be quite easy
and if you have a good case for it I guess we can squeeze it in our
roadmap somewhere.
--
Radovan Semancik
Software Architect
evolveum.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20130930/6f29e834/attachment.htm>
More information about the midPoint
mailing list