Error while setting null for date value

The new implementation must not be used to avoid unnecessary effort. The behavior will be changed again with EAI 5.11.1.

XR-853 which offers a safer way of setting the values to null, since the old value is still present in the xml and it cannot be triggered by unintentional changes to the xml structure.

Old Behavior

In case a null value will be set for a date attribute, you will get a "Unparsable date" exception

 2021-11-16 13:24:35,511 [importThreadPool-11] ERROR d.a.o.e.i.p.PeoTypeValuesCreationProcessor - Skipping value for attribute: 'PFG_SUBSKRIPTIONSDATUM_BIS_IMPORT', reason:  Value: '' cannot parsed to 'DATE' type.
de.apollon.omn.eai.importer.exception.ImportException: Value: '' cannot parsed to 'DATE' type.
        at de.apollon.omn.eai.importer.processor.PeoTypeValuesCreationProcessor.convertAndSetAttributeValue(PeoTypeValuesCreationProcessor.java:646)
        at de.apollon.omn.eai.importer.processor.PeoTypeValuesCreationProcessor.createValue(PeoTypeValuesCreationProcessor.java:619)
        at de.apollon.omn.eai.importer.processor.PeoTypeValuesCreationProcessor.createValue(PeoTypeValuesCreationProcessor.java:593)
        at de.apollon.omn.eai.importer.processor.PeoTypeValuesCreationProcessor.createSingleValue(PeoTypeValuesCreationProcessor.java:588)
        at de.apollon.omn.eai.importer.processor.PeoTypeValuesCreationProcessor.createValues(PeoTypeValuesCreationProcessor.java:396)
        at de.apollon.omn.eai.importer.processor.PeoTypeValuesCreationProcessor.getXmlValueMap(PeoTypeValuesCreationProcessor.java:300)
        at de.apollon.omn.eai.importer.processor.PeoTypeValuesCreationProcessor.createOrUpdateAttributeValues(PeoTypeValuesCreationProcessor.java:142)
        at de.apollon.omn.eai.importer.processor.PeoTypeValuesCreationProcessor.process(PeoTypeValuesCreationProcessor.java:121)
        at de.apollon.omn.eai.importer.processor.PeoTypeProcessor.processPeoType(PeoTypeProcessor.java:95)
        at de.apollon.omn.eai.importer.processor.PeoTypeProcessor.process(PeoTypeProcessor.java:78)
        at de.apollon.omn.eai.importer.processor.PeosTypeProcessor$CreatePeoTask.call(PeosTypeProcessor.java:134)
        at de.apollon.omn.eai.importer.processor.PeosTypeProcessor$CreatePeoTask.call(PeosTypeProcessor.java:120)
        at com.meylemueller.suite.core.execute.ExecuteTask.call(ExecuteTask.java:54)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.text.ParseException: Unparseable date: ""
        at java.text.DateFormat.parse(DateFormat.java:366)
        at de.apollon.omn.eai.common.helper.impl.DateHelperImpl.convertToDate(DateHelperImpl.java:19)
        at de.apollon.omn.eai.importer.processor.PeoTypeValuesCreationProcessor.convertAndSetAttributeValue(PeoTypeValuesCreationProcessor.java:637)
        ... 16 common frames omitted

Example XML part:

     <peo tid="DE_DE_7973785755_893_JP_023_M_232477_A_232477730_1637064918409" product="M_232477_A_232477730" template="Print" default="false">
      <name>Bademantel Frottee-dunkel marine-702388-730-JP 1880</name>
      <nodes>
        <node>DE_DE_7973785755_893_JP_023</node>
      </nodes>
      <vals>
        <val attr="PFG_SUBSKRIPTIONSDATUM_BIS_IMPORT">
          <itm/>
        </val>
      </vals>
    </peo>

New Behavior

To explicitly set a value to null/empty

<val mode="FULL" tid="attr">
    <items>
        <item/>
    </items>
</val>

To explicitly delete a value

<val mode="FULL" tid="attr">
    <items/>
</val>

Welcome to the AI Chat!

Write a prompt to get started...