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 » UNRESOLVED CHOICE

Post new topic  Reply to topic Goto page Previous  1, 2
 UNRESOLVED CHOICE « View previous topic :: View next topic » 
Author Message
kimbert
PostPosted: Fri Jan 09, 2004 6:00 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Felipe : You must be thinking of CWF (or maybe untagged TDS). The TDS parser is definitely able to handle choices of different lengths, and multipart would be an over-complicated solution here.

Gopal: I've tried out the message model which I posted. It took a while to get it working, because I had to tweak it a bit. Here's the structure which I used. It correctly parses the bitstream which you supplied (with any number of repeats)

Code:

MYIND Composition=sequence DataElementSeparation=FixedLength
  -- RepeatingChoiceType Composition=Choice DataElementSeparation==TaggedFixedLength TagLength=1 minOccurs=1 maxOccurs=-1
      -- ElementA  Tag='P' (and based on compound type TypeA)
          -- Elem1
          -- Elem2
      -- ElementA  Tag='L' (and based on compound type TypeB)
          -- Elem3
          -- Elem4


Note that you need to set the Tag Length on the repeating choice type.
I'm using v5.0, but the TDS parsing code has not changed much since v2.1 CSD3.

Note : You may find a problem with the Trace node - I'm not sure that mine is behaving properly, so if you get a crash, try removing the trace node(s).
Back to top
View user's profile Send private message
Gopal
PostPosted: Sun Jan 11, 2004 9:46 pm    Post subject: Reply with quote

Novice

Joined: 22 Jan 2003
Posts: 19
Location: Bangalore

Kimbert, I tried like this
My MRM is
Code:

TDSType (Type Composition=Choice, Tagged Fixed Length, Length of Tag 1)
  |_TypeA (Ordered Set, Fixed Length)
  |  |_Elm1 (Tag 'L' Length 5)
  |  |_Elm2 (Tag ''(blank) Length 5)
  |_TypeB (Ordered Set, Fixed Length)
     |_Elm3 (Tag 'P' Length 4)
     |_Elm4 (Tag ''(blank) Length 4)


Code:
Set OutputRoot.XML.Root.Field1 = "InputBody"."Elm1";
Set OutputRoot.XML.Root.Field2 = "InputBody"."Elm2";

Set OutputRoot.XML.Root.Field3 = "InputBody"."Elm3";
Set OutputRoot.XML.Root.Field4 = "InputBody"."Elm4";


The flow with the MRM was deployed successfully. When I entered data L123451234 it works well.
But it fails when I give data P1234123 saying
Quote:
( MQSI.default ) The bitstream of a TDF message contains less data than expected


If I give P123451234 data then it still goes to Field1 and Field2 only instead of going to Field3 and Field4 as in the code. Am I doing anything wrong here? It never goes to 'P' tag part of it.

Now also note that data in above line. It is 1 byte lesser than what it was earlier. This data now includes the Tag byte also.

Kimbert, would you please mind sending me the code and the MRM that you have created to make this work?
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Jan 12, 2004 1:53 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Felipe : You must be thinking of CWF, or non-tagged TDS. TDS certainly can handle a choice which has branches of different lengths, as long as the members of the choice are tagged.

Gopal: I've got a working solution. I had to change the message model slightly, because I forgot that the choice repeats. Here's the correct, working model:

Code:
MYIND Composition=sequence DataElementSeparation=FixedLength
    Embedded compound type Composition=Choice  DataElementSeparation==TaggedFixedLength minOccurs=0 maxOccurs=-1 TagLength=1
      -- ElementA  Tag='P' (and based on compound type TypeA)
          -- Elem1
          -- Elem2
      -- ElementA  Tag='L' (and based on compound type TypeB)
          -- Elem3
          -- Elem4


I've tested this with your example bitstream, and it parses and writes correctly. I'm using v5.0, but I'm fairly sure the same solution will work for v2.1.
Don't forget to set the Tag Length field on the embeded choice, and don't forget to set maxOccurs to -1 (unbounded repeat).
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Jan 12, 2004 2:06 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Sorry about the last post, which was a duplicate of my previous one. I thought my earlier reply had been lost.

Gopal: I think I know what your problem is. Your message set is not the same as the one I posted. You need an embedded type between TDSType and elementA/B. The embedded type is a repeating choice, and it contains ElementA and ElementB. TDSType is no longer a choice - it is now a sequence with DataElementSeparation=FixedLength.

Its difficult to send you my solution, because I'm using v5.0, and you need an mrp file (which v5.0 does not produce). Can you try out my solution first. If you still get problems, let me know, and I'll find a way of getting an mrp file to you.
Back to top
View user's profile Send private message
Gopal
PostPosted: Tue Jan 13, 2004 1:19 am    Post subject: Reply with quote

Novice

Joined: 22 Jan 2003
Posts: 19
Location: Bangalore

Kimbert, I'm still not getting it. I tried to make the MRM like this as
Code:
TestType (Composition=sequence Data Element Separation=Fixed Length)
  |_TDSType (Type Composition=Choice, Tagged Fixed Length, Length of Tag 1)
    |_TypeA (Ordered Set, Fixed Length)
    |  |_Elm1 (Tag 'L' Length 5)
    |  |_Elm2 (Tag ''(blank) Length 5)
    |_TypeB (Ordered Set, Fixed Length)
       |_Elm3 (Tag 'P' Length 4)
       |_Elm4 (Tag ''(blank) Length 4)


But it failed at the deployment saying

ERROR: TDSValidator::ValidateTypeMemberType:
Children of parent type with Data Element Separation attribute = Fixed Length
cannot have Data Element Separation attribute = Tagged Fixed Length.
(Parent Type ID: TestType)
(Child Type ID: TDSType)
Return Code: -80

Now what is the problem here? And also is my setting of the Compound Types A and B to 'L' and 'P' correct as per your suggestion?
It doesnt allow me to set maxOccurs to -1.
This is just going on and on and on.....
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Jan 13, 2004 2:35 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
This is just going on and on and on.....

You have my sympathy. TDS is a very tricky domain to set up, because it is so flexible.

However you are only one step away now. You need to use exactly the same structure as me. At the moment,
1. You have got TypeA instead of ElementA
2. You have set the Tag on Elm1 instead of on ElementA.

so...you need to do the following:

1. Create a compound element 'ElementA', based on TypeA
2. Create a compound element 'ElementB', based on TypeB
3. Add ElementA and ElementB to TDSType
4. Remove (not Delete!) TypeA and TypeB from TDSType.
5. Remove the Tag on Elm1 and Elm2
6. Set the Tag on ElementA to 'L'
7. Set the Tag on ElementB to 'P'
8. Set the minOccurs on TDSType to 1
9. Set the maxOccurs on TDSType blank(sorry, -1 is not possible)
10. Set the DataElementSeparation on TestType to 'TaggedFixedLength' (to get rid of the error)
11. Set the 'Type Content' on TestType, TDSType, TypeA and TypeB to 'Closed'.

That is 11 steps, not 1, but I've now tried this out on a 2.1 system, so I'm sure it works.
Back to top
View user's profile Send private message
Gopal
PostPosted: Tue Jan 13, 2004 3:31 am    Post subject: Reply with quote

Novice

Joined: 22 Jan 2003
Posts: 19
Location: Bangalore

Hurrrrrrrrrayyyyy!!!!
Kimbert, it worked exactly the way I wanted.
Thanks so much for this.
Atlast light at the end of the tunnel.

Thanks,
Gopal
Back to top
View user's profile Send private message
wooda
PostPosted: Wed Jan 14, 2004 6:41 am    Post subject: Reply with quote

Master

Joined: 21 Nov 2003
Posts: 265
Location: UK

Gopal -

By the way you needn't have added an extra level of elements if you instead used Group Indicators defined on Both TypeA and Type B to resolve the choice.
eg.

TestType (Composition=sequence Data Element Separation=Fixed Length)
|_TDSType (Type Composition=Choice,
|_TypeA (Ordered Set, Fixed Length) Group Indicator = 'L'
| |_Elm1 (Length 5)
| |_Elm2 (Length 5)
|_TypeB (Ordered Set, Fixed Length) Group Indicator = 'P'
|_Elm3 (Length 4)
|_Elm4 (Length 4)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » UNRESOLVED CHOICE
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.