Problem
The import of a record that has a subtype indicator for a subtype S with value 'Y' automatically causes the Rules Engine to insert also a record for S itself. This second insert fails if S has a mandatory column without default, since the value for that column is required but not supplied at the time the record is created. A column is "without default" if its Default Value attribute is empty, and the Default Value attribute of its Domain is also empty, and there is also no constraint that allows the Rules Engine to supply a default value.
This problem occurs if the supertype record appears earlier in the import document than the record for S, or if the document contains no record for S at all. It also occurs if S has a sibling subtype and a record for this sibling subtype appears earlier in the document than the record for S. If S and the sibling subtype each have a mandatory column without default, then the problem occurs regardless of document order.
The problem occurs independently of whether the "Create Separate Table" attribute of S is set to Yes or to No.
Solution 1
This solution works only if the receiving repository does NOT have 'Y' as the default value for the subtype indicator.
Make sure that the import document does not contain subtype indicators. The Rules Engine in the receiving repository will not set the 'Y' indicator until the subtype record comes in, at which time the mandatory value is supplied.
To strip subtype indicators, you can call the XML.MultiExportTables export method. It automatically suppresses all subtype indicators from the document. In USoft Delivery Manager, you can execute the "Export metadata" action. It has the same effect.
Solution 2
Make sure that supertype sections in the import document list only supertype records for instances that are not also a subtype (or more than one subtype).
To suppress supertype records for instances that are also a subtype, you can call the XML.MultiExportTables export method with the RestrictiveSupertypeListing parameter set to 'yes'.
|