Constraining dynamic array size with reusable policy class

In reply to Juhi_Patel:

You need to declare item as a rand variable.

Also it is a good idea to place a constraint on the size of the array in case no policies get added. You can either use a soft constraint as suggested, or a maximum hard constraint.