There are situations in which you might want to change a schema of a source or target. Changes to a schema can affect the validity of your mapping and result in several faulty connections. This topic explains how to fix such connections after you have changed the schema file. Follow the instructions in the example below to understand how to deal with faulty connections.
1.Open Tut-ExpReport.mfd available in the Tutorial folder. The portion of this mapping is shown below.
2.Open ExpReport-Target.xsd in an editor (e.g., Altova XMLSpy) and change the Company root element in the target schema to Company-EU. You do not need to close MapForce.
3.After you have edited the root element of the target schema, the Changed files prompt appears in MapForce. Click the Reload button. Since the root element has been changed, the component displays multiple faulty nodes.
4.Click Select new root element at the top of the component (see screenshot below). You can also change the root element by right-clicking the component header and selecting Change Root Element from the context menu.
5.Select Company-EU as the new root element and click OK. The Company-EU root element is now visible at the top of the component.
6.Now you need to move the connection from the faulty Company node to the new root element. Press and hold the thick section (see red arrow below) of Company's connection. Then drag the connection to the Company-EU root element.
A notification dialog box will ask whether you would like to move all the matching connected child nodes. You can choose between moving only the selected connection or the selected connection with its child nodes that match the child nodes in the new root element. In our example, we have chosen the option Include descendent connections. As soon as you click this button, all the faulty nodes will disappear from the component.
|Note:||If the node to which you are mapping has the same name as the source node but a different namespace, the notification dialog box will have an additional button Include descendants and map namespace. Clicking this button moves child connections of the same namespace as the source parent node to the same child nodes under the different namespace node.|
An alternative solution to the problem discussed above could be deleting the faulty nodes you may no longer need in your mapping. For example, when you delete the connection between the concat function and Name, the Name node will disappear from the ExpReport-Target component.
Faulty connections in databases (Professional and Enterprise editions)
If your database component has faulty connections, you will need to change the component settings. Clicking the Change button in the Component Settings dialog box allows you to select a different database or change tables in your database component. All valid/correct connections and relevant database data will be kept if you select a database with the same structure.