|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Unexpected results using mapping |
« View previous topic :: View next topic » |
Author |
Message
|
drivett |
Posted: Tue Dec 21, 2004 4:21 am Post subject: Unexpected results using mapping |
|
|
Newbie
Joined: 03 Apr 2002 Posts: 7 Location: Gimlet e-solutions
|
Hi All,
Doing my first WMB-BI (v5) modeling project, have used the product so far
with success, but that was using ESQL (which was fine)
Our next brief is to be able to take an input file (csv format), and convert
essentially to fixed space format (will be for EDI transmission). We need to
use the GUI tools to model the message mapping (client pre-requisite)
The message format is like this....
INPUT
fieldOneDataOne, fieldTwoDataOne, fieldThreeDataOne
fieldOneDataTwo, fieldTwoDataTwo, fieldThreeDataTwo
OUTPUT
A:fieldOneDataOne
B:fieldTwoDataOne
C:fieldThreeDataOne
A:fieldOneDataTwo
B:fieldTwoDataTwo
C:fieldThreeDataTwo
I've created my message definitions and setup the mapping between the [All] elements (using TDS)
what i get on the output is...
A:fieldOneDataOne
B:
C:
A:fieldOneDataTwo
B:fieldTwoDataOne fieldTwoDataTwo
C:fieldThreeDataOne fieldThreeDataTwo
...which is kind of throwing me! I tried do a fixed mapping from elements [1] and [2] to the corresponding ones and I get the same! My target message definition has essentially 3 groups, one for each line with the element in each, using the group indicator as A: / B: / C: and the group terminator as <CR><LF> . These then sit in another group where I have min / max to be set to 1 and 2 at present.
Any ideas where i'm going wrong would be greatly appreciated!!!
dave |
|
Back to top |
|
 |
wooda |
Posted: Tue Dec 21, 2004 5:00 am Post subject: |
|
|
 Master
Joined: 21 Nov 2003 Posts: 265 Location: UK
|
By using trace nodes befor and after your mapping node it would be helpful if you could post the incoming and outgoing message tree here (eg. use ${Root} in your trace nodes).
If you consider just the two logical trees it will be easier to see what your mapping is doing. If you can get the right shape of your logical message after mapping then you know your mapping is ok and can then look at the output message format. |
|
Back to top |
|
 |
drivett |
Posted: Tue Dec 21, 2004 5:40 am Post subject: |
|
|
Newbie
Joined: 03 Apr 2002 Posts: 7 Location: Gimlet e-solutions
|
thanks for this tip, I shall add the trace nodes and post the results |
|
Back to top |
|
 |
drivett |
Posted: Tue Dec 21, 2004 5:54 am Post subject: |
|
|
Newbie
Joined: 03 Apr 2002 Posts: 7 Location: Gimlet e-solutions
|
Ok, sorry about the expanse of data here, here gos....
TRACE NODE IMMEDIATLEY BEFORE MAPPING NODE
START>>>
(
(0x01000000):Properties = (
(0x03000000):MessageSet = 'P9SAPP4002001'
(0x03000000):MessageType = 'Simple3Field'
(0x03000000):MessageFormat = 'TDS1'
(0x03000000):Encoding = 546
(0x03000000):CodedCharSetId = 437
(0x03000000):Transactional = FALSE
(0x03000000):Persistence = FALSE
(0x03000000):CreationTime = GMTTIMESTAMP '2004-12-21 13:48:57.750'
(0x03000000):ExpirationTime = -1
(0x03000000):Priority = 0
(0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000000'
(0x03000000):ReplyProtocol = 'MQ'
(0x03000000):Topic = NULL
)
(0x01000000):MQMD = (
(0x03000000):SourceQueue = 'TestIn'
(0x03000000):Transactional = FALSE
(0x03000000):Encoding = 546
(0x03000000):CodedCharSetId = 437
(0x03000000):Format = ' '
(0x03000000):Version = 2
(0x03000000):Report = 0
(0x03000000):MsgType = 8
(0x03000000):Expiry = -1
(0x03000000):Feedback = 0
(0x03000000):Priority = 0
(0x03000000):Persistence = 0
(0x03000000):MsgId = X'414d5120514d5f6472776465736b746fddfbc64120000d08'
(0x03000000):CorrelId = X'000000000000000000000000000000000000000000000000'
(0x03000000):BackoutCount = 0
(0x03000000):ReplyToQ = ' '
(0x03000000):ReplyToQMgr = 'QM_drwdesktop '
(0x03000000):UserIdentifier = 'db2admin '
(0x03000000):AccountingToken = X'1601051500000092511d434b986589449960bff303000000000000000000000b'
(0x03000000):ApplIdentityData = ' '
(0x03000000):PutApplType = 11
(0x03000000):PutApplName = 'C:\RfhUtil\rfhutil.exe '
(0x03000000):PutDate = DATE '2004-12-21'
(0x03000000):PutTime = GMTTIME '13:48:57.750'
(0x03000000):ApplOriginData = ' '
(0x03000000):GroupId = X'000000000000000000000000000000000000000000000000'
(0x03000000):MsgSeqNumber = 1
(0x03000000):Offset = 0
(0x03000000):MsgFlags = 0
(0x03000000):OriginalLength = -1
)
(0x01000021):MRM = (
(0x0300000B):f1 = 'fieldOneData'
(0x0300000B):f2 = 'fieldTwoData'
(0x0300000B):f3 = 'fieldThreeData'
(0x0300000B):f1 = 'fieldOneData2'
(0x0300000B):f2 = 'fieldTwoData2'
(0x0300000B):f3 = 'fieldThreeData2
'
)
)
(
(0x01000000):Properties = (
(0x03000000):MessageSet = 'P9SAPP4002001'
(0x03000000):MessageType = 'Simple3Field'
(0x03000000):MessageFormat = 'TDS1'
(0x03000000):Encoding = 546
(0x03000000):CodedCharSetId = 437
(0x03000000):Transactional = FALSE
(0x03000000):Persistence = FALSE
(0x03000000):CreationTime = GMTTIMESTAMP '2004-12-21 13:50:38.400'
(0x03000000):ExpirationTime = -1
(0x03000000):Priority = 0
(0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000000'
(0x03000000):ReplyProtocol = 'MQ'
(0x03000000):Topic = NULL
)
(0x01000000):MQMD = (
(0x03000000):SourceQueue = 'TestIn'
(0x03000000):Transactional = FALSE
(0x03000000):Encoding = 546
(0x03000000):CodedCharSetId = 437
(0x03000000):Format = ' '
(0x03000000):Version = 2
(0x03000000):Report = 0
(0x03000000):MsgType = 8
(0x03000000):Expiry = -1
(0x03000000):Feedback = 0
(0x03000000):Priority = 0
(0x03000000):Persistence = 0
(0x03000000):MsgId = X'414d5120514d5f6472776465736b746fddfbc64120000d09'
(0x03000000):CorrelId = X'000000000000000000000000000000000000000000000000'
(0x03000000):BackoutCount = 0
(0x03000000):ReplyToQ = ' '
(0x03000000):ReplyToQMgr = 'QM_drwdesktop '
(0x03000000):UserIdentifier = 'db2admin '
(0x03000000):AccountingToken = X'1601051500000092511d434b986589449960bff303000000000000000000000b'
(0x03000000):ApplIdentityData = ' '
(0x03000000):PutApplType = 11
(0x03000000):PutApplName = 'C:\RfhUtil\rfhutil.exe '
(0x03000000):PutDate = DATE '2004-12-21'
(0x03000000):PutTime = GMTTIME '13:50:38.400'
(0x03000000):ApplOriginData = ' '
(0x03000000):GroupId = X'000000000000000000000000000000000000000000000000'
(0x03000000):MsgSeqNumber = 1
(0x03000000):Offset = 0
(0x03000000):MsgFlags = 0
(0x03000000):OriginalLength = -1
)
(0x01000021):MRM = (
(0x0300000B):f1 = 'fieldOneData'
(0x0300000B):f2 = 'fieldTwoData'
(0x0300000B):f3 = 'fieldThreeData'
(0x0300000B):f1 = 'fieldOneData2'
(0x0300000B):f2 = 'fieldTwoData2'
(0x0300000B):f3 = 'fieldThreeData2'
)
)
END>>>
TRACE NODE IMMEDIATLEY AFTER MAPPING NODE
START>>>
(
(0x01000000):Properties = (
(0x03000000):MessageSet = 'Test_Multi_Message_Set'
(0x03000000):MessageType = 'SimpleOut'
(0x03000000):MessageFormat = 'TDS1'
(0x03000000):Encoding = 546
(0x03000000):CodedCharSetId = 437
(0x03000000):Transactional = FALSE
(0x03000000):Persistence = FALSE
(0x03000000):CreationTime = GMTTIMESTAMP '2004-12-21 13:48:57.750'
(0x03000000):ExpirationTime = -1
(0x03000000):Priority = 0
(0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000000'
(0x03000000):ReplyProtocol = 'MQ'
(0x03000000):Topic = NULL
)
(0x01000000):MQMD = (
(0x03000000):SourceQueue = 'TestIn'
(0x03000000):Transactional = FALSE
(0x03000000):Encoding = 546
(0x03000000):CodedCharSetId = 437
(0x03000000):Format = ' '
(0x03000000):Version = 2
(0x03000000):Report = 0
(0x03000000):MsgType = 8
(0x03000000):Expiry = -1
(0x03000000):Feedback = 0
(0x03000000):Priority = 0
(0x03000000):Persistence = 0
(0x03000000):MsgId = X'414d5120514d5f6472776465736b746fddfbc64120000d08'
(0x03000000):CorrelId = X'000000000000000000000000000000000000000000000000'
(0x03000000):BackoutCount = 0
(0x03000000):ReplyToQ = ' '
(0x03000000):ReplyToQMgr = 'QM_drwdesktop '
(0x03000000):UserIdentifier = 'db2admin '
(0x03000000):AccountingToken = X'1601051500000092511d434b986589449960bff303000000000000000000000b'
(0x03000000):ApplIdentityData = ' '
(0x03000000):PutApplType = 11
(0x03000000):PutApplName = 'C:\RfhUtil\rfhutil.exe '
(0x03000000):PutDate = DATE '2004-12-21'
(0x03000000):PutTime = GMTTIME '13:48:57.750'
(0x03000000):ApplOriginData = ' '
(0x03000000):GroupId = X'000000000000000000000000000000000000000000000000'
(0x03000000):MsgSeqNumber = 1
(0x03000000):Offset = 0
(0x03000000):MsgFlags = 0
(0x03000000):OriginalLength = -1
)
(0x01000021):MRM = (
(0x01000000):fout1 =
(0x01000000):fout1 =
(0x01000000):fout2 =
(0x01000000):fout2 =
(0x01000000):fout3 =
(0x01000000):fout3 =
)
)
(
(0x01000000):Properties = (
(0x03000000):MessageSet = 'Test_Multi_Message_Set'
(0x03000000):MessageType = 'SimpleOut'
(0x03000000):MessageFormat = 'TDS1'
(0x03000000):Encoding = 546
(0x03000000):CodedCharSetId = 437
(0x03000000):Transactional = FALSE
(0x03000000):Persistence = FALSE
(0x03000000):CreationTime = GMTTIMESTAMP '2004-12-21 13:50:38.400'
(0x03000000):ExpirationTime = -1
(0x03000000):Priority = 0
(0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000000'
(0x03000000):ReplyProtocol = 'MQ'
(0x03000000):Topic = NULL
)
(0x01000000):MQMD = (
(0x03000000):SourceQueue = 'TestIn'
(0x03000000):Transactional = FALSE
(0x03000000):Encoding = 546
(0x03000000):CodedCharSetId = 437
(0x03000000):Format = ' '
(0x03000000):Version = 2
(0x03000000):Report = 0
(0x03000000):MsgType = 8
(0x03000000):Expiry = -1
(0x03000000):Feedback = 0
(0x03000000):Priority = 0
(0x03000000):Persistence = 0
(0x03000000):MsgId = X'414d5120514d5f6472776465736b746fddfbc64120000d09'
(0x03000000):CorrelId = X'000000000000000000000000000000000000000000000000'
(0x03000000):BackoutCount = 0
(0x03000000):ReplyToQ = ' '
(0x03000000):ReplyToQMgr = 'QM_drwdesktop '
(0x03000000):UserIdentifier = 'db2admin '
(0x03000000):AccountingToken = X'1601051500000092511d434b986589449960bff303000000000000000000000b'
(0x03000000):ApplIdentityData = ' '
(0x03000000):PutApplType = 11
(0x03000000):PutApplName = 'C:\RfhUtil\rfhutil.exe '
(0x03000000):PutDate = DATE '2004-12-21'
(0x03000000):PutTime = GMTTIME '13:50:38.400'
(0x03000000):ApplOriginData = ' '
(0x03000000):GroupId = X'000000000000000000000000000000000000000000000000'
(0x03000000):MsgSeqNumber = 1
(0x03000000):Offset = 0
(0x03000000):MsgFlags = 0
(0x03000000):OriginalLength = -1
)
(0x01000021):MRM = (
(0x01000000):fout1 =
(0x01000000):fout1 =
(0x01000000):fout2 =
(0x01000000):fout2 =
(0x01000000):fout3 =
(0x01000000):fout3 =
)
)
END>>>
MESSAGE DEFINITION
START>>>
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:group name="simple3Field">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsStructRep
dataElementSeparation="AllElementsDelimited"
delimiter="," messageSetDefaultRep="TDS1"/>
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="f1" type="xsd:string"/>
<xsd:element name="f2" type="xsd:string"/>
<xsd:element name="f3" type="xsd:string"/>
</xsd:sequence>
</xsd:group>
<xsd:complexType name="simple3Field">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsStructRep
dataElementSeparation="AllElementsDelimited"
delimiter="<CR><LF>" messageSetDefaultRep="TDS1"/>
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:group maxOccurs="2" ref="simple3Field">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsInclRep messageSetDefaultRep="TDS1" repeatingElementDelimiter="<CR><LF>"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:group>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="Simple3Field" type="simple3Field">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<MRMessage messageDefinition="/Simple3Field;XSDElementDeclaration/"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:group name="simple3Out">
<xsd:sequence>
<xsd:group ref="lineOut1"/>
<xsd:group ref="lineOut2"/>
<xsd:group ref="lineOut3"/>
</xsd:sequence>
</xsd:group>
<xsd:group name="lineOut1">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsStructRep groupIndicator="A:"
groupTerminator="<CR><LF>" messageSetDefaultRep="TDS1"/>
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element default=" " name="fout1" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsElemRep justification="leftJustify"
length="20" messageSetDefaultRep="TDS1" precision="-1"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:group>
<xsd:group name="lineOut2">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsStructRep groupIndicator="B:"
groupTerminator="<CR><LF>" messageSetDefaultRep="TDS1"/>
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element default=" " name="fout2" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsElemRep justification="leftJustify"
length="20" messageSetDefaultRep="TDS1" precision="-1"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:group>
<xsd:group name="lineOut3">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsStructRep groupIndicator="C:"
groupTerminator="<CR><LF>" messageSetDefaultRep="TDS1"/>
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element default=" " name="fout3" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsElemRep justification="leftJustify"
length="20" messageSetDefaultRep="TDS1" precision="-1"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:group>
<xsd:complexType name="simpleOut">
<xsd:sequence>
<xsd:group maxOccurs="2" ref="simple3Out">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<tdsInclRep messageSetDefaultRep="TDS1" repeatingElementDelimiter=""/>
</xsd:appinfo>
</xsd:annotation>
</xsd:group>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="SimpleOut" type="simpleOut">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<MRMessage messageDefinition="/SimpleOut;XSDElementDeclaration=1/"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:schema>
END>>>
MAPPING
START>>>
<?xml version="1.0" encoding="UTF-8"?>
<mfmap:MappingRoutineCollection xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:mfmap="mfmap.xmi" xmi:id="MappingRoutineCollection_1" nodeSchema="">
<routines xmi:id="MappingRoutine_1" name="Simple3FieldMapping" type="message">
<outputResources xmi:type="mfmap:OutputMessageBody" xmi:id="OutputMessageBody_1" uri="Test_Multi_Message_Set/Simple3Field.mxsd#/SimpleOut;XSDElementDeclaration=1/$MRMessage" nameInMappings="SimpleOut" messageName="SimpleOut" messageType="simpleOut" parserDomain="MRM" messageSetID="Test_Multi_Message_Set">
<referencedSymbols xmi:id="BuilderSymbol_1" uri="mset:message#{}SimpleOut"/>
<referencedSymbols xmi:id="BuilderSymbol_2" uri="mset:complexType#{}simpleOut"/>
<mappings xmi:id="TransformMapping_1">
<helper xmi:id="TransformMappingHelper_1">
<statement xmi:type="mfmap:ConditionalAssignmentStatement" xmi:id="ConditionalAssignmentStatement_1" expression="s_Simple3Field.f1["#I"]">
<condition>s_Simple3Field.f1["#I"] IS NOT NULL</condition>
<target xmi:id="TransformMappingItem_1" parentPath="t_SimpleOut.simple3Out[All].lineOut1" name="fout1" esqlPath="t_SimpleOut.fout1["#I"]"/>
<repeatBounds xmi:id="TransformMappingItem_2" parentPath="s_Simple3Field.simple3Field[All]" name="f1[]" esqlPath="s_Simple3Field.f1[]"/>
</statement>
</helper>
<inputItems xmi:id="TransformMappingItem_3" parentPath="s_Simple3Field.simple3Field[All]" name="f1" esqlPath="s_Simple3Field.f1["#I"]"/>
</mappings>
<mappings xmi:id="TransformMapping_2">
<helper xmi:id="TransformMappingHelper_2">
<statement xmi:type="mfmap:ConditionalAssignmentStatement" xmi:id="ConditionalAssignmentStatement_2" expression="s_Simple3Field.f2["#I"]">
<condition>s_Simple3Field.f2["#I"] IS NOT NULL</condition>
<target xmi:id="TransformMappingItem_4" parentPath="t_SimpleOut.simple3Out[All].lineOut2" name="fout2" esqlPath="t_SimpleOut.fout2["#I"]"/>
<repeatBounds xmi:id="TransformMappingItem_5" parentPath="s_Simple3Field.simple3Field[All]" name="f2[]" esqlPath="s_Simple3Field.f2[]"/>
</statement>
</helper>
<inputItems xmi:id="TransformMappingItem_6" parentPath="s_Simple3Field.simple3Field[All]" name="f2" esqlPath="s_Simple3Field.f2["#I"]"/>
</mappings>
<mappings xmi:id="TransformMapping_3">
<helper xmi:id="TransformMappingHelper_3">
<statement xmi:type="mfmap:ConditionalAssignmentStatement" xmi:id="ConditionalAssignmentStatement_3" expression="s_Simple3Field.f3["#I"]">
<condition>s_Simple3Field.f3["#I"] IS NOT NULL</condition>
<target xmi:id="TransformMappingItem_7" parentPath="t_SimpleOut.simple3Out[All].lineOut3" name="fout3" esqlPath="t_SimpleOut.fout3["#I"]"/>
<repeatBounds xmi:id="TransformMappingItem_8" parentPath="s_Simple3Field.simple3Field[All]" name="f3[]" esqlPath="s_Simple3Field.f3[]"/>
</statement>
</helper>
<inputItems xmi:id="TransformMappingItem_9" parentPath="s_Simple3Field.simple3Field[All]" name="f3" esqlPath="s_Simple3Field.f3["#I"]"/>
</mappings>
</outputResources>
<inputResources xmi:type="mfmap:InputMessageResource" xmi:id="InputMessageResource_1" uri="Test_Multi_Message_Set/Simple3Field.mxsd#/Simple3Field;XSDElementDeclaration/$MRMessage" nameInMappings="Simple3Field" messageName="Simple3Field" messageType="simple3Field" parserDomain="MRM">
<referencedSymbols xmi:id="BuilderSymbol_3" uri="mset:message#{}Simple3Field"/>
<referencedSymbols xmi:id="BuilderSymbol_4" uri="mset:complexType#{}simple3Field"/>
</inputResources>
</routines>
</mfmap:MappingRoutineCollection>
END>>> |
|
Back to top |
|
 |
wooda |
Posted: Tue Dec 21, 2004 7:58 am Post subject: |
|
|
 Master
Joined: 21 Nov 2003 Posts: 265 Location: UK
|
Hi -
Your trace output (I see you ran it twice ) ) shows that none of your output fields have been set in the tree. This is contradictory to the output bitstream in your first post. Do you really get that output and this trace on the same run ?
Anyway. Looking at your message defintion and try to decipher what your mapping is doing my best guess as to your problem is that you are mapping repeating groups.
You ought to be able to do this but it is fraught with problems since groups have no effect on the shape of the message tree. So it is very difficult (and in ESQL) to map different levels of repeating groups easily.
Looking at your data I'd say that your best chance for success would be to model your data a little differently.
I'd replace the groups with elements. This will give you more structure to your tree and therefore the mapping node will more easiliy be able to map between messages.
BTW i'd also replace your GI's with TAGS in the outgoing message. |
|
Back to top |
|
 |
drivett |
Posted: Tue Dec 21, 2004 9:18 am Post subject: |
|
|
Newbie
Joined: 03 Apr 2002 Posts: 7 Location: Gimlet e-solutions
|
Thanks for the reply on this. Yeah it's a weird one isn't it, sent stuff to an IBM'er who got the same result, in a trace node no message tree, but you get the output as stated. He reckons this could be a bug, so not good news! i'll try your suggestion of not using groups, but using elements. In your opinon what's the best way of getting from data format A to data format B as below then?
data format A
f11,f21,f31
f12,f13,f14
data format B
A:f11
B:f21
C:f31
A:f12
B:f13
C:f14
many thanks,
Dave |
|
Back to top |
|
 |
javaforvivek |
Posted: Tue Dec 28, 2004 2:52 am Post subject: |
|
|
 Master
Joined: 14 Jun 2002 Posts: 282 Location: Pune,India
|
Hi,
I have done something that might be useful to you. I have taken your input and output messages for my working.
I created two message sets in separate projects as follows:
Message Set for Data Format B:
messageset.mset contains one TDS format = TDS1
the msg def contains
1. Five global elements: A (string),B(string),C(string),FieldGroup(type = FieldGroup) and ItemGroup (type = ItemGroup).
2. Two Complex Types :
a) FieldGroup : which has global element references for A,B and C
TDS1 physical properties are: DES = 'Tagged Delimited', delim = <CR><LF> and Tag-Data separator = :
b) ItemGroup : which has global element reference for FieldGroup (maxOccurs = -1, TDS1 repeating element delim = <CR><LF>)
TDS1 physical properties for ItemGroup are: DES = 'AED', delim = *
(I have assumed that * will never appear in your message. You can give any special character)
3. Message from global element ItemGroup.
Message Set for Data Format A:
messageset.mset contains one TDS format = TDS1
the msg def contains
1. Five global elements: A (string),B(string),C(string),Line(type = Line) and LineGroup (type = LineGroup).
2. Two Complex Types :
a) Line : which has global element references for A,B and C
TDS1 physical properties are: DES = 'AED', delim = ','
b) LineGroup : which has global element reference for Line (maxOccurs = -1, TDS1 repeating element delim = <CR><LF>)
TDS1 physical properties for LineGroup are: DES = 'AED', delim = *
(I have assumed that * will never appear in your message. You can give any special character)
3. Message from global element LineGroup.
Then I created a message flow, with Data Format B as input, so I configured my MQInput Node accordingly with
msg domain = MRM, msg type = ItemGroup and msg format = TDS1
I used mapping node to map data from DataFormat B to DataFormatA as follows:
1. First I added source as ItemGroup, and target as LineGroup
2. It showed me FieldGroup[],FieldGroup[All] and FieldGroup[1] in source panel
and Line[],Line[All] and Line[1] in target panel.
3. Then I right clicked on Line[All] and selected 'Create Loop Mapping')
4. Created a loop mapping in new mapping routine.
5. Here I mapped FieldGroup.A --> Line.A and so on.
Then I deployed the two msg sets and msg flow and run it.
Here is the sample Input message:
A:Item1
B:Item2
C:Item3
A:Item11
B:Item21
C:Item31
A:Item12
B:Item22
C:Item32
A:Item13
B:Item23
C:Item33
and here is the output I got:
Item1,Item2,Item3
Item11,Item21,Item31
Item12,Item22,Item32
Item13,Item23,Item33
Hope this helps you. If I have missed something, pls post it here. _________________ Vivek
------------------------------------------------------
...when you have eliminated the impossible, whatever remains, however improbable, must be the truth. |
|
Back to top |
|
 |
drivett |
Posted: Tue Dec 28, 2004 5:58 am Post subject: |
|
|
Newbie
Joined: 03 Apr 2002 Posts: 7 Location: Gimlet e-solutions
|
thanks, that worked a treat! my problem was at the mapping level, wasn't doing the two levels of mapping! All ok now, many thanks |
|
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
|
|
|
|