Moving Connections and Child Connections

www.altova.com Print this Topic Previous Page Up One Level Next page

Home >  Common Tasks > Working with Connections >

Moving Connections and Child Connections

When you move a connection to a different component, MapForce automatically matches identical child connections and will prompt you whether it should move them to the new location as well. A common use of this feature is if you have an existing mapping and then change the root element of the target schema. Normally, when this happens, you would need to remap all descending connections manually. This feature helps you prevent such situations.

 

This example uses the Tut-ExpReport.mfd file available in the <Documents>\Altova\MapForce2019\MapForceExamples\Tutorial\ folder.

tut-ExpReport-bas

Tut-ExpReport.mfd (MapForce Basic Edition)

To understand how it works, do the following:

 

1.Open the Tut-ExpReport.mfd sample mapping.
2.Edit the ExpReport-Target.xsd schema outside MapForce so as to change the Company root element of the target schema to Company-EU. You do not need to close MapForce.
3.After you have changed the Company root element of the target schema to Company-EU, a "Changed files" prompt appears in MapForce.

dlg_changed_files

4.Click the Reload button to reload the updated Schema. Since the root element was deleted, the component displays multiple missing nodes.

tut-ExpReport-detail01-BAS

5.Click Select new root element at the top of the component. (You can also change the root element by right clicking the component header and selecting Change Root Element from the context menu.)

tut-ExpReport-detail02-BAS

6.Select Company-EU as new root element and click OK to confirm. The Company-EU root element is now visible at the top of the component.

tut-ExpReport-detail03-BAS

7.Click the target stub of the connection that exists between the expense-report item of the source component and the Company item of the target component, and then drag-and-drop it on the Company-EU root element of the target component.

tut-ExpReport-detail03a-ENT

A notification dialog box appears.

tut-ExpReport-detail04-BAS

8.Click Include descendent connections. This instructs MapForce to re-map the correct child items under the new root element, and the mapping becomes valid again.

 

Note:If the node to which you are mapping has the same name as the source node but is in a different namespace, then the notification dialog box will contain an additional button: "Include descendants and map namespace". Clicking this button moves the child connections of the same namespace as the source parent node to the same child nodes under the different namespace node.

© 2019 Altova GmbH