<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi Eduard,</p>
    <p>the error message states that the "input" property is not
      declared in the mapping context. midPoint does not know which
      attribute is the source of the mapping "by default". In inbound
      mapping, the attribute in <ref> corresponds to "input"
      property. In outbound, you typically define source(s).<br>
    </p>
    <p>My example from DatabaseTable connector resource outbound for
      Oracle db table's BIRTHDATE column:</p>
    <p>           <attribute><br>
                      <ref>ri:BIRTHDATE</ref><br>
                      <outbound><br>
                          <strength>strong</strength><br>
                          <source><br>
                              <path><b>extension/birthDate</b></path><br>
                          </source><br>
                          <expression><br>
                              <script><br>
                                  <code><br>
                                      return
      basic.formatDateTime("yyyy-MM-dd HH:mm:ss.S", <b>birthDate</b>)</p>
    <p>                                <!-- birthDate is
      extension/birthDate --><br>
    </p>
    <p>                            </code><br>
                              </script><br>
                          </expression><br>
                      </outbound><br>
                  </attribute><br>
    </p>
    <p>The mapping will take midPoint's extension/birthDate of the
      currently processed focus object (e.g. user) and convert it to the
      format which my database (Oracle) needs for DBTable connector.</p>
    <p>So first, you need to use proper property, which is declared as a
      source in the mapping.</p>
    <p>Second, you need to convert the date from midPoint's format
      (XMLGregorianCalendar) to whatever the database and/or connector
      requires. I think the DBTable connector does not support xsd:date
      and uses xsd:string - you can check that in the schema that is
      returned from the target system and stored in the resource
      <schema> element for BIRTHDATE attribute. Other connectors
      may have different types.<br>
    </p>
    <p>Best regards,</p>
    <p>Ivan<br>
    </p>
    <div class="moz-cite-prefix">On 6. 8. 2020 1:06, Eduard Stan wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:DB8PR09MB4264A596EBFE186F6772531B904B0@DB8PR09MB4264.eurprd09.prod.outlook.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color:#1F497D">Hi,<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">I’m using the
            following expression for importing date from DATABASE to
            MIDPOINT, and it works:<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D"><script
            xmlns:org=<a class="moz-txt-link-rfc2396E" href="http://midpoint.evolveum.com/xml/ns/public/common/org-3">"http://midpoint.evolveum.com/xml/ns/public/common/org-3"</a>><o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">    <code><o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">      import
            java.text.SimpleDateFormat;<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">      import java.text.DateFormat;<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">      <o:p>
            </o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">      DateFormat dtf = new
            SimpleDateFormat("yyyy-MM-dd HH:mm:ss");<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">      <o:p>
            </o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">      if (input!=null) {<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">        Date dt = dtf.parse(input);<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">        log.info("convertedValidFrom =
            " + dt);<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">        return
            com.evolveum.midpoint.util.MiscUtil.asXMLGregorianCalendar(dt);<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">      } else {<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">        return null;<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">      }<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">    </code><o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D"></script><o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Using the same
            expression for outbound throws the following error:<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span
            style="color:#1F497D">No such property: input for class:
            expression_in_mapping_in_inbound_expression_for_DATA
            _in_resource_67952a4d-218b-4b1d-952d-7e1fe1a9d58b(HR) in
            expression in mapping in outbound mapping for
            {.../resource/instance-3}DATA in
            <a class="moz-txt-link-freetext" href="resource:28d3861d-df87-494b-8c65-597ca787ba08(Users)(null">resource:28d3861d-df87-494b-8c65-597ca787ba08(Users)(null</a>
            (focus, user)=user:1056841c-1dc9-489b-bead-3054bfa1882a();
configuration=systemConfiguration:00000000-0000-0000-0000-000000000001(SystemConfiguration);
resource=<a class="moz-txt-link-freetext" href="resource:28d3861d-df87-494b-8c65-597ca787ba08(Users)">resource:28d3861d-df87-494b-8c65-597ca787ba08(Users)</a>;
            iterationToken=;
            actor=user:00000000-0000-0000-0000-000000000002(administrator);
            DATA
            =PPV(XMLGregorianCalendarImpl:1979-11-10T12:00:00.000+01:00);
            legal=true; iteration=0; assigned=true; projection (shadow,
            account)=null; operation=add; ) in expression in mapping in
            outbound mapping for {.../resource/instance-3}DATA in
            <a class="moz-txt-link-freetext" href="resource:28d3861d-df87-494b-8c65-597ca787ba08(Users)">resource:28d3861d-df87-494b-8c65-597ca787ba08(Users)</a><o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Can anyone
            advise?<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Thank you.</span><b><span
              style="font-size:8.0pt;color:black">
            </span></b><span style="font-size:8.0pt;color:#1F497D"
            lang="EN-GB"><o:p></o:p></span></p>
        <p class="MsoNormal"><o:p> </o:p></p>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
midPoint mailing list
<a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a class="moz-txt-link-freetext" href="https://lists.evolveum.com/mailman/listinfo/midpoint">https://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Ivan Noris
Senior Identity Engineer
evolveum.com
</pre>
  </body>
</html>