"A child row has multiple parents" error

In a load data step of a workflow I get an error message “A child row has multiple parents.” I have no idea what could be the problem…?

Spoiler: Check your entity relation IsParentChild and change it to false


You are trying to enforce nested XML in case where nesting would introduce repeating of the same data. This can happen basically anytime you set IsParentChild = True in cases where the relation is actually NOT a parent child but more a foreign key.


Order Data Structure

  • OrderEntity
    • BusinessPartnerEntity

Business partner is obviously a foreign key, let’s say OrderEntity.refBusinessPartnerEntityId.

If you set IsParentChild = True on the BusinessPartnerEntity relation you would get the following XML:

<OrderEntity Id="ord1">
   <!-- there will be just 1 BusinessPartnerEntity because it is not acutally a child but a foreign key of OrderEntity -->
   <BusinessPartnerEntity Id="bp1"/>
<OrderEntity Id="ord2">
   <!-- Second order has the same business partner assigned -->
   <BusinessPartnerEntity Id="bp1"/>

As you can see BusinessPartnerEntity Id=“bp1” is now duplicated in the XML.

Duplicating data in XML is forbidden (see https://www.origam.com/doc/display/architect/Relationships). It would make updating a problem (which of the XML elements would be used to update the data?).


So the solution is to turn off IsParentChild on the “foreign key” kind of relationship.


If you really MUST have nested relations repeating (e.g. for outputting to an API call or exporting data to a different system, where you will not need data updates, you need to transform the data using an XSLT transformation and you must do it through an XSD Data Structure (e.g. _any from the Root package).

1 Like