|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Design Suggestions for Dynamic Variable Message |
« View previous topic :: View next topic » |
Author |
Message
|
pfaulkner |
Posted: Thu Sep 25, 2003 8:26 am Post subject: Design Suggestions for Dynamic Variable Message |
|
|
Master
Joined: 18 Mar 2002 Posts: 241 Location: Colorado, USA
|
I have a message I need to be able to parse and convert from XML to Cobol.
The message is made up of the following:
TransmissionHeader - fixed content and size
SegmentData1
SegmentData2
SegmentData3
....
where Segment DataX can:
occur in any order
upto 25 Segment Data occurances
each occurance of SegmentData is a unique structure but fixed
So I can create individual MessageSets for each SegmentData but not one complete MessageSet because until I receive the input message I don't know which one's or what order they will arrive.
I am using XML(XML) for my input message.
I thought about using logic something like this:
1. Parse input message and determine which Segments I need to build
2. Creating a loop within my Flow that loops around a compute node, the node determine which segment to build next and then uses a RouteTo Node to route to a path that:
2.1 Build segment using an MRM message set
2.2 Appends the segment message to the complete message
2.3 Returns to the Compute node Loop
3. The loop would exit when all the segments have been built and then writes the complete message to the output node
This sounds like it would work but not sure about using such a loop withing a Message Flow, also I would imagine performance wouldn't be great.
Any thought on this design or different suggestions how I could create the output message would be greatly appreciated.
thanks |
|
Back to top |
|
 |
kirani |
Posted: Thu Sep 25, 2003 4:25 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Do you want single combined output message for each segment in the input message on the output queue or do you want to create separate messages for each segment? Is the COBOL record length for each segment of the same length? _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
pfaulkner |
Posted: Thu Sep 25, 2003 4:56 pm Post subject: |
|
|
Master
Joined: 18 Mar 2002 Posts: 241 Location: Colorado, USA
|
One combined message output to the destination queue. The length of each segment varies. |
|
Back to top |
|
 |
kirani |
Posted: Wed Oct 01, 2003 12:30 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Since you don't have fixed number of occurances or OCCURS depending on for your output COBOL record, you can model your message using TDS Fixed Length. You can set the repeat property for these elements to Yes, you need not specify min and max occurances here.
Message Model:
Code: |
DataSegment1 -> Repeat: Yes, Data Element Sepration: Fixed Length
DataSegment2 -> Repeat: Yes, Data Element Sepration: Fixed Length
DataSegment3 -> Repeat: Yes, Data Element Sepration: Fixed Length
.
.
.
DataSegmentn -> Repeat: Yes, Data Element Sepration: Fixed Length
|
Your code for transformation would look something like this,
Code: |
DECLARE 1CNT INT 1;
WHILE ( 1CNT <= CARDINALITY(InputRoot.XML.Data.Segment1[]) DO
SET OutputRoot.MRM.DataSegment1[1CNT].FIELD1 = InputRoot.XML.Data.Segment1[1CNT].FIELD1;
SET 1CNT = 1CNT + 1;
END WHILE;
SET ICNT=1;
WHILE ( 1CNT <= CARDINALITY(InputRoot.XML.Data.Segment2[]) DO
SET OutputRoot.MRM.DataSegment2[1CNT].FIELD2 = InputRoot.XML.Data.Segment2[1CNT].FIELD2;
SET 1CNT = 1CNT + 1;
END WHILE;
and so on ...
|
I hope this helps. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|