Jack,
I don’t believe it makes sense to actually attach the violation to a property. Property is potentially used with many instances – it is not in itself violating anything. If you attach a violation to a property, you wouldn’t know what resource has a problem – that what resource has more than allowed number of values for this property.
You can’t attach the violation to the values either. First, in this case, they are literals. Secondly, even if they were resources, which of the three is in violation and in what context – any of them could be also a value for some other resource where there are only two values.
So, in this particular example, I don’t see how a violation could be usefully attached to anything but edispin:Variable1.
Having said this, if you wanted to attach it to eddl:constantUnit, you could by using a CONSTRUCT template.
You may be confusing the resource that has a violation raised against it with the UI, where a warning sign may appear in a resource's form next to some property widget.
This is not because the violation is “attached” to the property, it is is just a UI presentation of the violation that is found for edispin:Variable1. In case of CONSTRUCT templates, the property next to which we display a warning signal on a form is set using spin:violationPath. In case of ASK templates, I believe that the code tries to figure it out itself. It may be that it is not smart enough to know which property is being used when this is going through a template. I am not sure. I also don’t know how exactly you are declaring the template.
However, I do know that if you use a CONSTRUCT template, you can provide the spin:violationPath property, and then the display should work just fine. You should use any of the spl templates as an example. For example, take a look at spl:RangePropertyConstraint.