For each product specified as {pid}, a ProductVariationModel instance is created and returned as an element of the "ProductVariationModels" HashMap output parameter. The pipelet processes variation attributes in their defined order and ignores attributes or values not defined for a variation. The pipelet returns a map of ProductVariationModels with the product instance as the key and the ProductVariationModel as the value.
For backwards compatibility reasons, the pipelet accepts an optional Product instance as input parameter. The product may either be a master or a variant. If specified, the pipelet returns the ProductVariationModel for this product as "ProductVariationModel" and also as element of the "ProductVariationModels" HashMap parameter. Also, the system tries to find a variant which matches the attributes selected in the HttpParameterMap as closely as possible. The matching product is returned under the key "SelectedProduct". If the passed product is neither a master or a variant, then the product itself is simply returned under the key "SelectedProduct". No value will be set under the "SelectedProduct" key unless a Product instance was passed to the pipelet.