ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Usage of Use Data Pattern

Post new topic  Reply to topic
 Usage of Use Data Pattern « View previous topic :: View next topic » 
Author Message
mqlearner
PostPosted: Thu Feb 12, 2004 2:22 pm    Post subject: Usage of Use Data Pattern Reply with quote

Newbie

Joined: 12 Feb 2004
Posts: 4

Hi All

I am facing some problem using the Use Data Pattern of TDS and I am not sure whether WMQI is supposed to work like this only or it is a bug. Could anyone help me out?

I have got my message set defined as follows -

Input_Message (Type - Input_Message, DES - Use Data Pattern, TComp - Sequence, TCont - Closed)
- Header (Type - Header_type, DES - Use Data Pattern, TComp - Ordered Set, TCont - Closed, Data Pattern - .{4}, R - No)
- Element1(R - No, Length - 1, Data Pattern - .{1})
- Element2 (R - No, Length - 3, Data Pattern - .{3})
- Detail (Type - Header_type, DES - Use Data Pattern, TComp - Sequence, TCont - Closed, Data Pattern - (D.{8}){1,}, R - Yes, Min - 1, Max - <blank>)
- Element3(R - No, Length - 9, Data Pattern - .{9})
- Element4(R - No, Length - 9, Data Pattern - .{9})

With the above configuration, if I pass an input like HhdrD12345678D12345678, the message is successfully parsed, with the logical structure looking like
Header
- Element1 H
- Element2 hdr
Details
- Element3 D12345678
- Element4 D12345678

Whereas if I pass an input like HhdrD12345678D12345678D12345678D12345678, I am still getting the same format as the above. Though the Details is set to Repeat, I am not getting the second instance of the Details populated. It seems to behave as if No repeat property is set. I am expecting an output like this

Header
- Element1 H
- Element2 hdr
Details
- Element3 D12345678
- Element4 D12345678
Details
- Element3 D12345678
- Element4 D12345678


Can anyone guide me in achieving this? Once this is solved, I need to add more element after the Details again repeating variable number of times.

Thanks
Back to top
View user's profile Send private message
wooda
PostPosted: Fri Feb 13, 2004 1:16 am    Post subject: Reply with quote

Master

Joined: 21 Nov 2003
Posts: 265
Location: UK

Hi

What you are doing looks basically ok (although not entirely sure why you need data pattern everywhere given that most can be done with fixed length.) did you know that data pattern performs much worse than fixed length for obvious reasons.

Your notes say that you are using the pattern (D.{8}){1,} on the detail type. Is this correct or is there a typo here ?
Surely it should be (D.{8}){2}

Which version of are you using. In v2.1 and v5.0 you use a value of -1 in Max Occurs to signify unbounded repeats. <blank> does not mean this. Maybe this is your problem.
Back to top
View user's profile Send private message
mqlearner
PostPosted: Fri Feb 13, 2004 6:21 am    Post subject: Reply with quote

Newbie

Joined: 12 Feb 2004
Posts: 4

Hi

Sorry, I had forgotten to mention in my post that my requirement is that the Details portion need to repeaat n number of times. This is the reason why I had gone for Use Data Pattern instead of Fixed Width wherein I would have to give the MaxOccurs value.

And by the pattern (D.{8}){1,} I want the parser to pick up a field of 9 length starting with D. And also I want to get all the occurances of data of this pattern.

I am not able to understand why this is not working.

What I am seeing with these properties set is that though parser is able to pick up all the occurances of this pattern, but it expects that many fields defined under the Details Type to map on the value.

For example

if my input is HhdrD12345678D12345678D12345678D12345678, what the parser seem to do is it gets all the occurance of Details i.e. D12345678D12345678D12345678D12345678 and then tries to map on to the elements defined under that type. So in my case, parser would expect 4 elements to be defined alreadey which means my Details type will have

Details
-Element1
-Element2
-Element3
-Element4

But my requirement is completely different and also since I don;t know how many occurances will be there, i don;t know what to do. I want the parser to pick up all the occurances, but if gets datas for 4 fields and if only 2 fields are defined, then since the repeat is set for Details, parser has to create that many details as many times as it is occuring.

Please help me in understanding how this data pattern works at different level i,e at Element of Compound Type and at Elements of simple type.

Thanks
Back to top
View user's profile Send private message
wooda
PostPosted: Mon Feb 16, 2004 2:29 am    Post subject: Reply with quote

Master

Joined: 21 Nov 2003
Posts: 265
Location: UK

From looking at your expected output

Header
- Element1 H
- Element2 hdr
Details
- Element3 D12345678
- Element4 D12345678
Details
- Element3 D12345678
- Element4 D12345678

then you appear to be saying that Details can repeat n times. From your recent reply you appear to be also saying details can contain unbounded numbers of elements ?

This cannot work. How do you know if a D.{8} element is the end of one details structure or the start of the next.

With your model you cannot repeat both the Details structure and the element within it an unbounded number of times.

Waht I though you meant the first time (and what you may still mean) is that.

Details structure contains 2 elements element3 and element4.
Details structure repeats n times.

if this IS what you mean then what you do is what I mentioned in my first note.

This is.

Set data pattern for Details as (D.{8}){2}
Set max occurs for details as -1

this will give n number of details each containing the same two elements.
Back to top
View user's profile Send private message
mqlearner
PostPosted: Mon Feb 16, 2004 7:04 am    Post subject: Reply with quote

Newbie

Joined: 12 Feb 2004
Posts: 4

Hi

Sorry Zanda, for the confusion... your understanding is perfectly right. Details structure will be having only 2 elements and the strucutre has such will be repeating n number of times..

Also, I tried giving the values of maxOccurs as -1, but the control center gui says it as not a valid value for this property.. where do i specify this value -1.

Also the Data pattern you had mentioned (D.{8}){2}, does this meant tha pareser will pick first 87 byets and map it to first field and the next 8 to the second field. In that case what if the field sizes are the not same, how do i give the pattern....

the examples documented are for pattern at field level and not at the elements of compound type..

please tell me how to meet my requirements..

thanks
Back to top
View user's profile Send private message
wooda
PostPosted: Mon Feb 16, 2004 8:12 am    Post subject: Reply with quote

Master

Joined: 21 Nov 2003
Posts: 265
Location: UK

Hi ,

The pattern on the type (D.{8}){2} is equivilent to D.{8}D.{8}
This will match a portion of bitstream and then pass this down for further parsing agsint the element definitions inside.
The only purpose of the pattern on the type is to separate the content of one instance of the type from the content of the next instance.

So as long as a single instance of detail can be represented by a pattern which will separate it from the next instance. then you can use this technique.

Ok if you cannot input maxOccurs = -1 this must mean you are not on a level of the product which allows this.

This is unfortunate but not a serious problem.

What you can do is set the value of maxOccurs to a very large value which you will never meet.

eg. 99999 or something similar.

So the TDS parser will continue to match repeats of Detail until the pattern on Detail fails to match. (or you meet the maxOccurs value).
Back to top
View user's profile Send private message
mqlearner
PostPosted: Mon Feb 16, 2004 9:49 am    Post subject: Reply with quote

Newbie

Joined: 12 Feb 2004
Posts: 4

Hi

Thanks for the prompt reply Zanda...

But I am not able to understand how the parser works when it comes across the pattern mentioned at the Element of Compound type level.

If I take the same problem as an example, when I give the Data pattern as (D(.{17})){1,} at the Element of Compound type level, I would expect the parser to get 18 bytes from my bit stream with the first byte always matching 'D' and also that there can be n number of repeatition of this structure.

So if I pass an Input say, HhdrD123456712345678D123456712345678D123456712345678, my parser should parse the data as

Header
Element1 - H
Element2 - hdr
Detail[1] (D123456712345678 - and further parser to Element/Field level)
Element3 - D1234567
Element4 - 12345678
Detail[2]
Element3 - D1234567
Element4 - 12345678
Detail[3]
Element3 - D1234567
Element4 - 12345678

Because I don;t see any problem with the data pattern mentioned.

But what seems to happen is , i.e. how the data is parsed is

Header
Element1 - H
Element2 - hdr
Detail[1] (D123456712345678D123456712345678D123456712345678)
Element3 - D1234567
Element4 - 12345678


In the above case, the parse picks up the entire data from the bit stream matching the Data pattern and further parser it to the Element level, but fails to create further instances of Details with the remaining bit stream. But if I had another 2 element (of same definition and with same data pattern) say Element5 and Element6 of the same defintion to the Details strucutre, then that get populated as

Data Pattern at Element of Compound level still as (D(.{17})){1,}, the output I get is

Detail[1] (D123456712345678D123456712345678D123456712345678)
Element3 - D1234567
Element4 - 12345678
Element5 - D1234567
Element6 - 12345678


Could some one let me know how the parser should parse the bit stream for the Data pattern (D(.{17})){1,}

thanks
Back to top
View user's profile Send private message
wooda
PostPosted: Tue Feb 17, 2004 4:08 am    Post subject: Reply with quote

Master

Joined: 21 Nov 2003
Posts: 265
Location: UK

If you use the pattern

D(.{17})){1,}

this will always behave like this.

you are telling the parser that a SINGLE instance of Details contains n repeats of D.17
Yet the elements inside Details contain only two .{9} patterns

So the parser matches the entire remainder of the bitstream on the first repeat of Details because the pattern you set told it to.
Then it parses out the two elements find no more elements inside Details and then it throws the rest away and finds no more repeats of detail as you have NO more bitstream left.

As I have said twice before the pattern on Details should be

(D.{8}){2}

This will match only the 18 characters needed for ONE repeat of Details.

then the parser will iterate (due to Max Occurs) and find another repeat of Details and another and another etc. etc.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Usage of Use Data Pattern
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.