Author |
Message
|
cyvwmb |
Posted: Thu Jun 20, 2013 3:36 am Post subject: Reg: Fixed String Input to Xml Output..Doubt in Message set. |
|
|
Newbie
Joined: 18 Mar 2013 Posts: 9
|
Hi everyone,
This is my requirement for Fixed String Input to Xml Output...
Sample Input message:
001Fname Mname Lname Cname<CR><LF>
002Fname Mname Lname Cname<CR><LF>
003Fname Mname Lname Cname<CR><LF>
004Fname Mname Lname Cname<CR><LF>
Sample Output message:
<Message>
<Header>....</Header>
<Body>
<Rows>
<Row>
<Employee>001</Employee>
<FirstName>Fname</FirstName>
<MiddleName>Mname</MiddleName>
<LastName>Lname</LastName>
<CompanyName>Cname</CompanyName>
</Row>
<Row>
<Employee>002</Employee>
<FirstName>Fname</FirstName>
<MiddleName>Mname</MiddleName>
<LastName>Lname</LastName>
<CompanyName>Cname</CompanyName>
</Row>
<Row>
<Employee>003</Employee>
<FirstName>Fname</FirstName>
<MiddleName>Mname</MiddleName>
<LastName>Lname</LastName>
<CompanyName>Cname</CompanyName>
</Row>
<Row>
<Employee>004</Employee>
<FirstName>Fname</FirstName>
<MiddleName>Mname</MiddleName>
<LastName>Lname</LastName>
<CompanyName>Cname</CompanyName>
</Row>
</Rows>
</Body>
</Message>
------------------------------------------------------------------------------------------------
For this i created CWF input message set,but it worked for first row of input message..(May be is there any properties need to change to get below Rows? please tell me how to get multiple row in flow.. )
but my requirement : every Input message can contain multiple rows..
Looking forward for your help,
Thanks in an advance..  |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Jun 20, 2013 3:40 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Why did you use CWF?
Why did you use MRM and not DFDL?
What property of the message model indicates that there is one row? Why haven't you tried changing that property?
The requirement belongs to you. |
|
Back to top |
|
 |
cyvwmb |
Posted: Thu Jun 20, 2013 3:56 am Post subject: |
|
|
Newbie
Joined: 18 Mar 2013 Posts: 9
|
mqjeff wrote: |
Why did you use CWF?
Why did you use MRM and not DFDL?
What property of the message model indicates that there is one row? Why haven't you tried changing that property?
The requirement belongs to you. |
Hi,
I am sorry...
I am using MB v6.1.
Message flow:
MQinput---->ComputeNode--->MQoutput
So input is coming via MQ...
Quote: |
What property of the message model indicates that there is one row? |
Directly i given length to dividing elements..
Quote: |
"Why haven't you tried changing that property?".. |
I tried all the Properties for CWF... no use..
---------------------------------------------------------------------------
Is it any possible TDS Message set..because it contain <CR><LF> options.
but i don't how to use this properties |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Jun 20, 2013 4:04 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
So you have a set of fields.
You then have a structure that holds all of those fields and identifies that this set of fields is a "row".
You want to indicate that this structure repeats.
If you *don't* have that structure, then all you have is a structure that says "This set of fields is a message".
Then you want to create a structure that says "This message consists of a set of rows, each row having this set of fields". That is, you want to create the structure that holds the set of fields, and make it repeat.
Tell the person who's asking you to do anything with v6.1 that they should send you to training and let you use v8. |
|
Back to top |
|
 |
cyvwmb |
Posted: Thu Jun 20, 2013 10:18 pm Post subject: |
|
|
Newbie
Joined: 18 Mar 2013 Posts: 9
|
mqjeff wrote: |
So you have a set of fields.
You then have a structure that holds all of those fields and identifies that this set of fields is a "row".
You want to indicate that this structure repeats.
If you *don't* have that structure, then all you have is a structure that says "This set of fields is a message".
Then you want to create a structure that says "This message consists of a set of rows, each row having this set of fields". That is, you want to create the structure that holds the set of fields, and make it repeat.
Tell the person who's asking you to do anything with v6.1 that they should send you to training and let you use v8. |
Hi, i am again...
After looking you poster, i got a idea to create a message definition file ... Please check below steps..
First i created only one Global Element (For Example : STR_FS)and i reference to one Complex Type..there i kept Max Occurs [-1]...
I given Data length=93..(each Row length contain 93) ..
So Here my STR_FS will take multiple rows...That i seen in my debug mode as well...
So i can separate fields which i want to generate in ESQL code by using Substring Function ..
------------------ But here i got one more problem -------------------
When i saw that data in debug mode it contains "\n\r" (New line)
Due to this "\n\r" Data alignment is distributed .... So i cannot use substring function for particular field..
For Example ....please have a look into below ..
Here you can see first line taking good...But rest of the rows distributed
MRM
STR_FS:CHARACTER:91062418120100D5510211117903001HEX SOCK. SCREW000000001.00 83110D551 081230TMGACO33
STR_FS:CHARACTER:\n\r
91062418120100D5510211118003001SCREW 000000001.00 831 0D551 08123
STR_FS:CHARACTER:0TMGACO33 \n\r
91062418120100D5510211118003001SCREW 000000001.00 831 0D551
STR_FS:CHARACTER:081230TMGACO33 \n\r
91062418120100D5510211118003001SCREW 000000001.00 831 0D5
STR_FS:CHARACTER:51 081230TMGACO33 \n\r
91062418120100D5510211118003001SCREW 000000001.0
STR_FS:CHARACTER:0 831 0D551 081230TMGACO33 \n\r
91062418120100D5510211118003001SCREW 00
STR_FS:CHARACTER:0000001.00 831 0D551 081230TMGACO33 \n\r
91062418120100D5510211118003001SCREW
STR_FS:CHARACTER:000000001.00 831 0D551 081230TMGACO33 \n\r
91062418120100D551021111800300
My intention is to Kill \n\r...
Please tell me how to trim this \n\r...Looking forward your  |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Jun 21, 2013 3:00 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Don't use substring.
You need a structure something like
Code: |
Message
Row
Field1
Field2
..
|
You now have a structure that looks like
All of the things you are trying to do are basic message modelling. All of your questions - how to handle repeating elements, how to handle line endings - are handled in the message model.
Review the samples. Ask the person sitting next to you who is also using Broker. |
|
Back to top |
|
 |
cyvwmb |
Posted: Fri Jun 21, 2013 3:34 am Post subject: |
|
|
Newbie
Joined: 18 Mar 2013 Posts: 9
|
mqjeff wrote: |
Don't use substring.
You need a structure something like
Code: |
Message
Row
Field1
Field2
..
|
You now have a structure that looks like
All of the things you are trying to do are basic message modelling. All of your questions - how to handle repeating elements, how to handle line endings - are handled in the message model.
Review the samples. Ask the person sitting next to you who is also using Broker. |
Hi,
Yes your right ..
I got this link from this same MQSerices.net
https://github.com/chids/archived-wmb-message-modelling-tutorials/tree/master/tagged-fixed-length
Right now i am implement which explained into above link...
Once again Thank you very much..to advising and helping  |
|
Back to top |
|
 |
|