[midPoint] Convert from gregorian calendar to Oracle Timestamp
Paulo Fernandes de Souza Junior
PFSJ at senado.leg.br
Fri Nov 20 12:33:53 CET 2020
Hi,
We use this
<source>
<c:path>activation/validFrom</c:path>
</source>
<expression>
<script xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xsi:type="c:ScriptExpressionEvaluatorType">
<code>
import java.text.SimpleDateFormat;
import java.text.DateFormat;
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
return df.format(com.evolveum.midpoint.util.MiscUtil.asDate(validFrom));
</code>
</script>
</expression>
<condition>
<script xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xsi:type="c:ScriptExpressionEvaluatorType">
<code>
validFrom != null
</code>
</script>
</condition>
Paulo Fernandes de Souza JĂșnior
NQPPPS
Senado Federal - PRODASEN
Fone: 61 3303.3924
________________________________
De: midPoint <midpoint-bounces at lists.evolveum.com> em nome de Andrea Picconi via midPoint <midpoint at lists.evolveum.com>
Enviado: quinta-feira, 19 de novembro de 2020 13:42
Para: midpoint at lists.evolveum.com
Cc: Andrea Picconi; Marianna De Biasio; Jacopo Giuliano
Assunto: [midPoint] Convert from gregorian calendar to Oracle Timestamp
Hi all,
I need to convert a date format from gregorian calendar to Oracle Timestamp.
By now I'm using this script that does the opposite (inside an output mapping):
<expression>
<script xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<http://www.w3.org/2001/XMLSchema-instance%22> xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"<http://midpoint.evolveum.com/xml/ns/public/common/common-3%22> xsi:type="c:ScriptExpressionEvaluatorType">
<code>
import java.text.SimpleDateFormat;
import java.text.DateFormat;
DateFormat dtf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if (input!=null) {
Date dt = dtf.parse(input);
log.info("convertedValidFrom = " + dt);
return com.evolveum.midpoint.util.MiscUtil.asXMLGregorianCalendar(dt);
} else {
return null;
}
</code>
</script>
</expression>
How could I convert it to make it do the opposite?
Regards,
Andrea Picconi
IAM (Identity Access Management)
[Innovery]
Skype: precons
T: +39 06 51963439 (int. 196)
Strada Quattro Palazzina A6 c/o Centro Direzionale Milanofiori, 20057 Assago (MI).
www.innovery.net<http://www.innovery.net/> | T: +39 06 519 63 439
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20201120/f4601331/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 8058 bytes
Desc: image003.png
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20201120/f4601331/attachment-0001.png>
More information about the midPoint
mailing list