Author |
Message
|
drajib |
Posted: Wed Jun 11, 2003 10:03 am Post subject: CWF-TDS transformation [Resolved] |
|
|
 Apprentice
Joined: 25 Mar 2003 Posts: 42 Location: India
|
Hi,
I've the following TDS Message
Code: |
PROTO.CWF.2.TDS
+ s1 s1_TYPE
+ s2 s2_TYPE
+ s3 s3_TYPE
|
which is based on the following Type s
Code: |
s s_TYPE
- s1 s1_TYPE (Fixed length)
f1_1 String (4)
f1_2 String (5)
- s2 s2_TYPE (Fixed length)
f2_1 String (9)
f2_2 String (5)
- s3 s3_TYPE (Fixed length)
f3_1 String (2)
f3_2 String (2)
|
The actual data is of CWF format e.g.
Code: |
!1234abcde|123456789abcde*12ab |
where
Code: |
'!', '|' and '*' are the Group Indicators for s1, s2 and s3 respectively.
|
The MRM parser is parsing it perfectly as
Code: |
s
- s1
f1_1 (1234)
f1_2 (abcde)
- s2
f2_1 (123456789)
f2_2 (abcde)
- s3
f3_1 (12)
f3_2 (ab)
|
My question is could we handle a scenario where s2 is optional and repeating! Is there any other way (may be not with Group Indicators)?
Or, it can't be done due to current limitations with MRM.
I'm using WMQI 2.1 CSD4.
Thanks in advance
Last edited by drajib on Thu Jun 19, 2003 8:32 am; edited 4 times in total |
|
Back to top |
|
 |
skn |
Posted: Wed Jun 11, 2003 10:09 am Post subject: |
|
|
 Centurion
Joined: 21 May 2003 Posts: 112 Location: Dallas
|
you can set the REPEAT property to YES in the compound type member properties and set the MIN OCCURS to 0. |
|
Back to top |
|
 |
drajib |
Posted: Wed Jun 11, 2003 10:24 am Post subject: |
|
|
 Apprentice
Joined: 25 Mar 2003 Posts: 42 Location: India
|
I tried that, however in that scenario, the segment 's3' is not getting populated. This is from the Control Center Debugger
Code: |
MRM
s1
f1_1 1234
f1_2 abcde
s2
f2_1 123456789
f2_2 abcde
|
when I send the same message |
|
Back to top |
|
 |
skn |
Posted: Wed Jun 11, 2003 3:11 pm Post subject: |
|
|
 Centurion
Joined: 21 May 2003 Posts: 112 Location: Dallas
|
u sure u put the min occurence to 0. |
|
Back to top |
|
 |
drajib |
Posted: Wed Jun 11, 2003 11:50 pm Post subject: |
|
|
 Apprentice
Joined: 25 Mar 2003 Posts: 42 Location: India
|
Definitely sure that I'm definitely doing that |
|
Back to top |
|
 |
skn |
Posted: Thu Jun 12, 2003 5:13 am Post subject: |
|
|
 Centurion
Joined: 21 May 2003 Posts: 112 Location: Dallas
|
i think u need change the group indicators.
try it with someting like this
!1234abcde*123456789abcde
i am presuming u are using
!1234abcde|123456789abcde
That should work. |
|
Back to top |
|
 |
drajib |
Posted: Thu Jun 12, 2003 5:42 am Post subject: |
|
|
 Apprentice
Joined: 25 Mar 2003 Posts: 42 Location: India
|
Thanks for all your efforts. But have you tried it yourself to see that the output is as expected?
s2 being the optional repeating segment, I have tried out with the following set of input messages & viewed the corresponding results in Control Center Debugger adding a breakpoint just after the input node
Code: |
No s2 -
!1234abcde*12ab |
Code: |
Single s2 -
!1234abcde|123456789abcde*12ab |
Code: |
Multiple s2 -
!1234abcde|123456789abcde|987654321mnopq*12ab |
|
|
Back to top |
|
 |
Craig B |
Posted: Thu Jun 19, 2003 3:26 am Post subject: |
|
|
Partisan
Joined: 18 Jun 2003 Posts: 316 Location: UK
|
Unfortunately in the MRM-TDS layer it is not possible to control repetitions using the Group Indicators. In this particular case, when the S2 structure is set to repeating then the TDS parser will enter this structure, but because the number of repeats is unbounded and unspecified then the presence of a group indicator for the following structure (S3) is not enough to terminate the repetitions.
I would actually model this message in a slightly different way if repetitions are required. I would remove the Group Indicators from S1 ,S2 and S3, and change the Data Element Separation of the parent message to be "Tagged Fixed Length". The length of Tag could be set to one, and then the the child structures (S1, S2 and S3) can have there Tags set as !, | and * respectively. Now the TDS parser will use these tags to identify the structures instead of group indicators. However, this now gives the advantage that repetitions can be used.
The difference comes in that with a Fixed length parent and Group Indicators, allocated to the fields is still done sequentially. Where as with Tagged environments the parser extracts the Tag and asks the high level parents if one of its children has a tag of this name, and if so allocates it to that.
This change should allow you to parse the message, but it does change the nature of your message such that before S1 had to occur before S2, and S2 before S3. However, in the Tagged model, S2 would be allowed before S1 which may not give you what you require. However, you should be able to set other settings to stop this from occurs, by defining the parent as a 'Sequence' along with possible other settings.
Hope this helps. _________________ Regards
Craig |
|
Back to top |
|
 |
drajib |
Posted: Thu Jun 19, 2003 8:31 am Post subject: Resolved CWF-TDS transformation |
|
|
 Apprentice
Joined: 25 Mar 2003 Posts: 42 Location: India
|
Worked like a charm! Thanks a lot Craig.
Please continue to share with us your insights in this forum.
Best regards
PS> Could I carry this a bit further! Going by the solution, the specific tags are getting lost. What if there is a need to carry them forward as a part of the message?
Anyone/Craig again?  |
|
Back to top |
|
 |
Craig B |
Posted: Thu Jun 19, 2003 9:47 am Post subject: |
|
|
Partisan
Joined: 18 Jun 2003 Posts: 316 Location: UK
|
When you say that the tags are lost then what do you mean? Do you mean that within the message tree fields you do not see the tags? When you specify mark up characters in TDS such as the Group Indicators, terminators, delimiters and tags etc, then you are saying that these characters separate your data in the message. Therefore these are absorbed by the parser and the real data that was extracted in populated in your message. There is one exception to this when using Tagged Delimited. This data element separation allows fields that are not in the message definition and therefore the field name becomes whatever the tag is.
When writing a new output message then the TDS writer will take the message tree constructed and then form a bitstream based on this. During this process, the TDS 'mark up' characters will be inserted into the bitstream appropriately to separate the data again.
Therefore these will always appear in the message but not in message tree. Do you need these characters in the message tree? If so, then they are data and not separation characters. If this is the case then you may need to use TDS Data Patterns as the separation technique. _________________ Regards
Craig |
|
Back to top |
|
 |
drajib |
Posted: Fri Jun 20, 2003 12:07 am Post subject: |
|
|
 Apprentice
Joined: 25 Mar 2003 Posts: 42 Location: India
|
Craig,
Understood! Thanks for clearing it up again.
Best regards,
Rajib. |
|
Back to top |
|
 |
drajib |
Posted: Fri Jun 20, 2003 2:25 am Post subject: |
|
|
 Apprentice
Joined: 25 Mar 2003 Posts: 42 Location: India
|
I've searched for references/examples of working with TDS Data Patterns but could not come up with anything significant. Any pointers!
Thanks in advance.
Last edited by drajib on Tue Jun 24, 2003 6:19 am; edited 1 time in total |
|
Back to top |
|
 |
Craig B |
Posted: Fri Jun 20, 2003 3:28 am Post subject: |
|
|
Partisan
Joined: 18 Jun 2003 Posts: 316 Location: UK
|
This functionality was introduced in WMQI V2.1 CSD03 and therefore is documented in the latest Working with messages book. There is a section called "Using regular expressions to parse data elements" in the "Working with Tagged Delimited string messages" chapter. This documents the functionality with some examples. _________________ Regards
Craig |
|
Back to top |
|
 |
drajib |
Posted: Fri Jun 20, 2003 4:54 am Post subject: |
|
|
 Apprentice
Joined: 25 Mar 2003 Posts: 42 Location: India
|
And you bet, all this time I was following the earlier version !!!
Thanks Craig. |
|
Back to top |
|
 |
|