<as:Rules>
<as:default>
<as:context>
<as:constraint action="makeRepeatable(//asm1:Arguments/asm1:Argument)" />
<as:constraint action="restrictValues(//asm1:Arguments/asm1:Argument/@Name,'MerchantId'|
'AssociateTag'| 'ItemId'| 'ContentType'| 'Service'| 'SubscriptionId'|
'ResponseGroup'| 'Operation'| 'IdType'| 'Version')"
/>
<as:constraint action="makeRepeatable(//asm1:ItemLookupRequest/asm1:ItemId)" />
<as:constraint action="makeRepeatable(//asm1:ItemLookupRequest/asm1:ResponseGroup)" />
<as:constraint action="makeRepeatable(//asm1:Items/asm1:Item)" />
<as:constraint action="makeRepeatable(//asm1:Offers/asm1:Offer)" />
<as:constraint action="makeRepeatable(//asm1:Offers/asm1:Offer/asm1:Merchant)" />
<as:constraint action="makeRepeatable(//asm1:EditorialReviews/asm1:EditorialReview)" />
<as:constraint action="makeOptional(//asm1:OfferAttributes/asm1:ConditionNote)" />
<as:constraint action="makeOptional(//asm1:ItemAttributes/asm1:UPC)" />
<as:constraint action="makeOptional(//asm1:ItemAttributes/asm1:DeweyDecimalNumber)" />
<as:constraint action="makeOptional(//asm1:Offer/asm1:Seller)" />
<as:constraint action="makeOptional(//asm1:Offer/asm1:Merchant)" />
<as:constraint action="makeOptional(//asm1:OfferListing/asm1:ExchangeId)" />
<as:constraint action="makeOptional(//asm1:Item/asm1:EditorialReviews)" />
<as:constraint action="makeOptional(//asm1:ItemAttributes/asm1:Creator)" />
<as:constraint action="makeOptional(//asm1:ItemAttributes/asm1:NumberOfPages)" />
<as:constraint action="makeOptional(//asm1:ItemAttributes/asm1:PublicationDate)" />
<as:constraint action="makeOptional(//asm1:ItemAttributes/asm1:ISBN)" />
<as:constraint action="makeOptional(//asm1:ItemAttributes/asm1:Author)" />
<as:constraint action="makeOptional(//asm1:ItemAttributes/asm1:BatteriesIncluded)" />
<as:constraint action="makeOptional(//asm1:ItemAttributes/asm1:ESRBAgeRating)" />
<as:constraint action="makeOptional(//asm1:ItemAttributes/asm1:Feature)" />
<as:constraint action="makeOptional(//asm1:ItemAttributes/asm1:Format)" />
<as:constraint action="makeOptional(//asm1:ItemAttributes/asm1:Model)" />
<as:constraint action="makeOptional(//asm1:ItemAttributes/asm1:Platform)" />
<as:constraint action="makeOptional(//asm1:ItemAttributes/asm1:ReleaseDate)" />
<as:constraint action="makeOptional(//asm1:OfferSummary/asm1:LowestUsedPrice)" />
<as:constraint action="makeOptional(//asm1:OfferSummary/asm1:LowestCollectiblePrice)" />
<as:constraint action="makeOptional(//asm1:Item/asm1:LargeImage)" />
<as:constraint action="makeOptional(//asm1:ItemAttributes/asm1:NumberOfItems)" />
</as:context>
</as:default>
</as:Rules>
It is evident that all of these aspects can be applied to Amazon.com AWS XML responses and structures. Furthermore, specific rules can then be added that relate to each type of product (such as DVDs, books, toys, clothing, electronics, and so on) that trigger different sets of rules related to each product type. What this then does is provide a roadmap that clarifies the use patterns without requiring trial-and-error style learning curves for partners integrating with your systems. Not only does it eliminate the guesswork on initial testing and setup, it also greatly simplifies the process of version changes (as discussed in the upcoming section).
<TransmissionData>
<DocumentID>%DocumentID0%</DocumentID>
<CreatedDateTime>%2006-05-04T18:13:51.0Z%</CreatedDateTime>
<DocumentTypeCode>%Request%</DocumentTypeCode>
<TransmissionType>%Original%</TransmissionType>
<Source>
<as:include>pesc-organization.xml</as:include>
<NoteMessage>%NoteMessage%</NoteMessage>
</Source>
<Destination>
<as:include>pesc-organization.xml</as:include>
<NoteMessage>%NoteMessage%</NoteMessage>
</Destination>
<DocumentProcessCode>%TEST%</DocumentProcessCode>
<DocumentOfficialCode>%Official%</DocumentOfficialCode>
<DocumentCompleteCode>%Partial%</DocumentCompleteCode>
<RequestTrackingID>%RequestTrackingID0%</RequestTrackingID>
<NoteMessage>%NoteMessage14%</NoteMessage>
</TransmissionData>
These techniques in CAM are designed to allow multiple structure definitions and selective structure models based on the context of use patterns. So in the example shown above the Source and Destination structures can be modified using CAM structure selection rules to suit particular differences in the use models. Note that each individual organization definition is itself 52 lines long and contains over ten structure choices.