|
Processing errors
You have wide capabilities concerning processing specific
situations and errors during import.
All top level elements have the onerror attribute with
the following possible values: skip (by default) or
break.
If the attribute onerror="skip" is set for a element
and an error occurs while this element is being processed, the corresponding
message will be added to the log, the program will interrupt processing the
element and start processing the next element in the XML file.
If the attribute onerror="break" is set for a element
and an error occurs while this element is being processed, the corresponding
message will be added to the log, the program will interrupt processing the
element and the current XML file and start processing the next XML file.
The following events are considered as errors:
-
XML errors
-
errors that
occur while calling DM API (for example, not all required fields were
specified in the FIELD element of the
PROFILE element)
-
errors in
SQL queries
-
errors
explicitly initiated by the import logic (see below)
The DOCUMENT and
FOLDER elements have the
ifexists attribute
(used only when a new document is created, i.e. action="create") whose value
allows you to interpret the event when documents with certain attributes exist
in the library in different ways, including interpreting it as an error. You can
search using the SEARCH element. If one or several results have been returned as
the result of the query, you can implement different logic with the help of the
ifexists attribute.
For example, if there is an order with the same number in the
library already, you can consider is as an error (ifexists="error") and you can
either interrupt importing the XML file (if onerror="break") or continue
importing other documents from this XML file just leaving a message in the log
(if onerror="skip").
If it is not an error when a document with the specified
parameter exists, you can just skip processing the current element (ifexists="skip"),
or update the attributes of the found document(s) (ifexists="apply"), or do
nothing, but save the ID of the found document to be able to refer to it later (ifexists="use").
See the more detailed description of the
ifexists attribute for more
information.
|