Author |
Message
|
jamesyu |
Posted: Mon Apr 13, 2009 7:24 am Post subject: TDS Modelling: Min Occurrences = 0 vs. Length Constraints |
|
|
Acolyte
Joined: 31 Jan 2007 Posts: 70
|
I have turned on the validation on my MQOutput node to validate TDS output messages. I have a question in my TDS output message definition regarding how to set both min occurrs = 0 and the length constraints on one simple type field.
The field X is a simple type of xsd:string. I put the length constraints like min=8 and max=8 for this field. I also specified the min occurs to 0 since this field is optional.
But the parser complains. All what I am trying to tell the parser is, if this field X is present, make sure the length is always 8. If not present, please do not validate this field on the length.
Can this be modelled with TDS, meaning can I have both min occurrs = 0 and length constraints on one field? |
|
Back to top |
|
 |
smdavies99 |
Posted: Mon Apr 13, 2009 7:37 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Quote: |
But the parser complains. |
How does it complain? Please let us know. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
jamesyu |
Posted: Mon Apr 13, 2009 9:01 am Post subject: |
|
|
Acolyte
Joined: 31 Jan 2007 Posts: 70
|
smdavies99 wrote: |
Quote: |
But the parser complains. |
How does it complain? Please let us know. |
Oh, I forgot to check this Nillable for the field X. In the message definition file, if I specify Min Occurrs = 0 with a Length constraints on a specific numbe of bytes for the field X, I also need to check this Nillable. Then in ESQL, I also need to say SET X VALUE = NULL if the input is nothing.
Am I right? |
|
Back to top |
|
 |
kimbert |
Posted: Mon Apr 13, 2009 1:00 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Yes, it is possible. I suggest that you switch off validation until you get the correct message tree for all types of valid input. Then enable validation to check the length constraints ( you did know that TDS will not even look at the length constraints, or at any other facet? Those are for the validation engine only ).
If you need help with getting the correct message tree, then you need to supply a lot more detail about your input message style and how it can vary. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Apr 13, 2009 4:19 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
kimbert wrote: |
Yes, it is possible. |
OI!
You're on leave!
Take it! |
|
Back to top |
|
 |
|