In my JMeter DSL (http://forum.jetbrains.com/message/Meta-Programming-System-4911-2
) I want to have some constraints to prevent nodes being created in the non-proper positions.
I think the best way to express the constraints is to use "traits".
For instance: "a Sampler can't have another Sampler as a child". "Configuration can't have another configuration as a child". "Sampler should have ThreadGroup ancestor".
I thought I could factor out those kind of constraints into ConceptInterfaces and add those interfaces to the "implements" list as required.
My "constraint concept interfaces" are IRequiresThreadGroup
(parentNode.ancestor<concept = ThreadGroup, +>.isNotNull
(parentNode.ancestor<concept = ILeafSampler, +>.isNull
), etc. In the actual concept I just implement the required interfaces.
However, this does not work since MPS uses just the very first constraint method it sees when it walks the hierarchy.
Is that intentional?
What is the MPS way of composing constraints?
Should I file an issue for that?