<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 09/27/2013 09:46 PM,
Belleville-Rioux, Vincent wrote:<br>
</div>
<blockquote
cite="mid:0AD36E0192997748BD28BC68B14C75D0036465@Lettre.gst.uqam.ca"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<style type="text/css"></style>
<style type="text/css"></style>
<style type="text/css"></style>
<div style="direction: ltr;font-family: Tahoma;color:
#000000;font-size: 10pt;">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.
</div>
</blockquote>
<br>
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.<br>
<br>
<blockquote
cite="mid:0AD36E0192997748BD28BC68B14C75D0036465@Lettre.gst.uqam.ca"
type="cite">
<div style="direction: ltr;font-family: Tahoma;color:
#000000;font-size: 10pt;">
<div><br>
</div>
<div>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.</div>
</div>
</blockquote>
<br>
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
(<a class="moz-txt-link-freetext" href="http://docs.oracle.com/javase/7/docs/api/javax/xml/datatype/XMLGregorianCalendar.html">http://docs.oracle.com/javase/7/docs/api/javax/xml/datatype/XMLGregorianCalendar.html</a>).
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 (<a class="moz-txt-link-freetext" href="https://jira.evolveum.com/browse/MID-1622">https://jira.evolveum.com/browse/MID-1622</a>).
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.<br>
<br>
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
<a class="moz-txt-link-freetext" href="https://wiki.evolveum.com/display/midPoint/Script+Expression+Functions">https://wiki.evolveum.com/display/midPoint/Script+Expression+Functions</a>).<br>
<br>
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
<a class="moz-txt-link-freetext" href="https://wiki.evolveum.com/display/midPoint/Mapping#Mapping-TimeConstraints">https://wiki.evolveum.com/display/midPoint/Mapping#Mapping-TimeConstraints</a>).
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.<br>
<br>
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.<br>
<br>
<pre class="moz-signature" cols="72">--
Radovan Semancik
Software Architect
evolveum.com
</pre>
</body>
</html>