Example Step 5: Modify the Class-to-Pipeline Mapping
This topic describes how to update the mapping between runtime objects and the dictionary that pipelines use.
To update the OrderPipelineMappings.xml file
Create a copy of the OrderPipelineMappings.xml file if you want to be able to revert to your original configuration. Edit the OrderPipelineMappings.xml file to perform the rest of this procedure.
Change the name of the OrderForm class to "MyOrderForm".
The Class element for the MyOrderForm class will look as follows:
<Class Name="MyOrderForm"> ... </Class>
Add the GiftCertificates property to the MyOrderForm class. Since the GiftCertificates property represents a collection of VirtualGiftCertificate objects, use the Collection element.
The Class element for the MyOrderForm class will look as follows:
<Class Name="MyOrderForm"> <Collection Name="GiftCertificates" DictionaryKey="gift_certificates" KeyType="SimpleList" ReferTo="VirtualGiftCertificate" /> ... </Class>
Define the VirtualGiftCertificate class.
The Class element for the VirtualGiftCertificate class will look as follows:
<Class Name="VirtualGiftCertificate"> <Property Name="VirtualGiftCertificateId" DictionaryKey="VirtualGiftCertificateId" ClassKey="true" /> ... </Class>
Save the OrderPipelineMappings.xml file.