cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

The PTC Community email address has changed to community-mailer@ptc.com. Learn more.

How to use valid range constraint for string??

Gucio
14-Alexandrite

How to use valid range constraint for string??

Hi All,

 

I would like to know, how to use "valid range" constraint for String attribute.

I've defined: From aa To bb.

As a result, I'm able to create business object that has 'ac' as a value of attribute, but 'ca' isn't acceptable.

 

Could somebody explain it in simple words?

Many thanks in advance.

 

Krzysztof
1 ACCEPTED SOLUTION

Accepted Solutions
HelesicPetr
21-Topaz I
(To:Gucio)

Hi @Gucio 

it is similar to numbers.

range from 11 to 22  is not just 11, 12, 21, 22 but it is 11-19 and 20 - 22

 

an alphabet range is a-z for one position of a character. same as a number 0-9. 

 

Is it more clear? 

 

With range "aaa - ccc" you can still write "cbz" because it is in specific range. 

 

PetrH

 

View solution in original post

4 REPLIES 4
HelesicPetr
21-Topaz I
(To:Gucio)

Hi @Gucio 

What do you expect?

 

Your result definition is from aa to az and from ba to bb 

 

if you expect a range aa, ab, ba, bc then you should use different constraint for example the Legal value list

HelesicPetr_0-1655275184048.png

 

Hope this help

 

PetrH

Gucio
14-Alexandrite
(To:HelesicPetr)

Hi Petr,

 

I'm still not able to catch it.

I was expected to achieve result similar to your example with Legal Value.

 

I was thought, that giving boundaries starting from 'aa' and finishing at 'bb' will allow user to fill one of four options: 'aa' or 'ab' or 'ba' or bb'. Why 'az' and 'ba' did you mention as result?
Going deeper, making valid range form 'aaa' to 'ccc' in my mind should allow typing 'aaa' or 'aab' ..... up to 'ccc'.

Would you be so kind as to clarify the answer?

 

Thx in advance.

Krzysztof
HelesicPetr
21-Topaz I
(To:Gucio)

Hi @Gucio 

it is similar to numbers.

range from 11 to 22  is not just 11, 12, 21, 22 but it is 11-19 and 20 - 22

 

an alphabet range is a-z for one position of a character. same as a number 0-9. 

 

Is it more clear? 

 

With range "aaa - ccc" you can still write "cbz" because it is in specific range. 

 

PetrH

 

Gucio
14-Alexandrite
(To:HelesicPetr)

@Petr

 

now it is clear 🙂 

 

Many thanks for your patience.

 

Regards.

Krzysztof
Top Tags