Task Mode Behavior for XML Data Sources (Magic xpa 4.x)
When the main file is XML, all of the initial task modes are allowed.
An inserted record may contain, in any sequence, fields of an existing parent record, or the Parent-ID column.
If you try and refer to a parent that does not exist, a new parent will not be created, but rather a message will appear stating that this is a "non-existing Parent ID".
There are two stages for working in Create mode:
-
Selecting the Parent
The Parent-ID can be set in one of two ways:
-
-
Explicitly: Update the Parent-ID variable.
-
Implicitly (only if not set explicitly), according to the modified elements. The runtime engine will try to decide to which parent the inserted record belongs to, according to the modified fields in the inserted record that belong to ancestor compounds. The locating algorithm will use all modified fields belonging to compounds above the view, and will try to fetch the parent record using these values.
-
Executing the Insert
Based on the Parent-ID that was selected (explicitly or implicitly) and validated in the previous phase:
-
-
Magic xpa will insert the record under the Parent record, located either explicitly using the Parent-ID or implicitly using other modified fields in the inserted record.
-
Records will be inserted at the end of the view.
-
Magic xpa will not validate XMLs implicitly.
For example, ‘A.E’ or ‘A.D’ might have a restricting maxOccurs attribute. To ensure validity, the XMLValidate function will have to be called explicitly by developers.
The View Main Element controls which simple elements can be modified:
-
Only simple elements / attributes contained within the View Main Element can be modified in the Record Suffix.
-
Simple elements / attributes of ancestors are not modifiable.
This means that relocations are not allowed.
To move an element, you need to erase it in one place and then enter it in another place.
-
Developers cannot modify the Parent-ID of an existing record. Such modifications will be an error.
Deleting a compound’s record will delete records of its descendants.