Allowing a property to allow any integer or a specific string

I have a concept with a property that I want to be any integer or the keyword "all". So when the user fills in the value of the corresponding node in the sandbox, it should only allow an integer or "all".

Right now I can only make it be an integer or a specific string but not both.

I checked out creating primitive declarations but I do not see any way of creating a type that allows integers and a specific string.

How can I achieve this?
1 comment
Comment actions Permalink
I'm afraid you will not be able to such a type in MPS.

I'm not familiar with your use-case, but you could consider using a string type and leverage the constraints aspect to restrict the values to integers and the string "all".

A more generic approach would be to use a child concept instead of a property - one child concept would represent a numeric value (and would hold an integer property), a second concept would represent the "all" value (and would have no property). Both would descend from a common abstract super-concept.

Please sign in to leave a comment.