Author |
Message
|
recallsunny |
Posted: Fri Jul 29, 2005 6:44 am Post subject: Repeat Count in CWF message |
|
|
 Disciple
Joined: 15 Jun 2005 Posts: 163 Location: Massachusetts
|
I have a message set which is defined from a Copy book. I use this to generate a cwf message from an XML input.
Code: |
Structure Type MinOccurs MaxOccurs
----------------------------------------------------------------------
My_Msg ComplexType1 1 1
+ Hdr1 Header 1 1
+ Detail1 Detail 1 -1
|
The detail structure is a repeating 'n' times. If I dont mention the CWF Properties Repeat Count or Repeat reference , it always writes a single Detail to output even if I map multiple details into it.
If i use the Repeat reference, by inserting an Integer(to hold the count of details) before the Detail structure, then the length of my message gets altered by the number of bytes of that Integer.
Is there a way, I can give a unbounded Repeat count like -1 or some number, to make this a dynamic value. The Max Occurs = -1 doesn;t seem to help here.
Does anyone get the same problem...?
 |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Jul 29, 2005 6:50 am Post subject: Re: Repeat Count in CWF message |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
recallsunny wrote: |
Is there a way, I can give a unbounded Repeat count like -1 or some number, to make this a dynamic value. |
Not with CWF, no. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
recallsunny |
Posted: Fri Jul 29, 2005 7:07 am Post subject: |
|
|
 Disciple
Joined: 15 Jun 2005 Posts: 163 Location: Massachusetts
|
Hmm...
That means, you will have to know the exact number of detail records upfront to Code it into your message set, or use a Reference field by accomodating that into your message structure. Sounds to me like a major drawback...
Anyway Thanks Jeff for quick reply, I will start looking at other options to make this scenario work. Do let me know if you know of any..
|
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Jul 29, 2005 7:10 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
recallsunny wrote: |
Sounds to me like a major drawback... |
With CWF, yes.
TDS is a lot more flexible. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
JT |
Posted: Fri Jul 29, 2005 7:30 am Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
If you can extract the 'Detail' repeating structure, as a string, from the input message and then determine the number of occurrences in that repeating structure, you should be able to insert the number of occurrences at the start of the string, and re-parse the data using the CREATE function with the DOMAIN & PARSE clauses, referencing a specific MRM format that defines the Detail segment and using a Repeating Reference.
* Update *
Sorry, just noticed you were trying to output this structure, not receive it. |
|
Back to top |
|
 |
Fuzzy_mq |
Posted: Sat Jul 30, 2005 6:53 pm Post subject: |
|
|
Apprentice
Joined: 27 May 2004 Posts: 31 Location: US
|
The way I do, Add an extra element as Count before the data in XML. Then use it as repeat reference. Remove the count before putting the CWF in the output queue.
Thanks,
Scht |
|
Back to top |
|
 |
recallsunny |
Posted: Mon Aug 01, 2005 6:19 am Post subject: |
|
|
 Disciple
Joined: 15 Jun 2005 Posts: 163 Location: Massachusetts
|
Thats exactly, how i've managed to get this working... Thanks anyway.  |
|
Back to top |
|
 |
kimbert |
Posted: Tue Aug 09, 2005 1:40 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
This is a known requirement, and is being worked on. |
|
Back to top |
|
 |
|