Automatically Add a Product: Define as a Separate Constraint

To automatically add a product and also set attributes on the product, define these procedures as separate constraints.

If you need to automatically add a product, and also set attributes on the product, define these procedures as separate constraints, as in this example.

1constraint(laptop[Laptop] > 0, warranty[Warranty] > 0);
2constraint(warranty[Warranty] > 0, warranty[Warranty].type == “Premium”);

Avoid this example, which automatically adds a product and sets attributes on the product, in the same constraint.

1constraint(laptop[Laptop] > 0, warranty[Warranty] > 0 && warranty[Warranty].type == "Premium");