- From the Broker Application Development
perspective, create the
following resources:
- a message set project and a message set called MAPPING3_COMPLEX_messages,
ensuring that the message set is namespace enabled with XML wire format
- a message definition file called COMPLEX, which has a target namespace
www.complex.net, with prefix comp
- Create messages addev1, addev1s and addev1n with the following
structures:
addev1
bool (xsd:boolean) local element
bin (xsd:hexBinary) local element
dat (xsd:dateTime) local element
dec (xsd:decimal) local element
dur (xsd:duration) local element
flt (xsd:float) local element
int (xsd:int) local element
str (xsd:string) local element
addev1s
bin (xsd:hexBinary) local element
dat (xsd:dateTime) local element
dur (xsd:duration) local element
str (xsd:string) local element
addev1n
dec (xsd:decimal) local element
flt (xsd:float) local element
int (xsd:int) local element
- Create a message flow project called MAPPING3_COMPLEX_flows.
- Create a message flow called addev1 which contains:
MQInput ->Filter -> Mapping -> Compute
\ \ --> RCD -> MQOutput
\-> Mapping1-----------/
- In the Filter node, set the following ESQL:
IF Body.bool THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
- In the Mapping node that is connected to the Filter true terminal
(Mapping1), open the map and select addev1 as source and addev1s as target.
- Wire the source to target as shown:
bin --- bin
dat --- dat
dur --- dur
str --- str
- In the Spreadsheet pane, expand Properties and set the following
values:
MessageType | 'addev1s'
- Right-click the target dat and click If.
- Replace the condition fn:true() with $source/comp:addev1/str
= 'dat'.
- Set the value for dat to $source/comp:addev1/dat + xs:duration("P3M").
- Right-click the condition and click Else.
- Right-click the target dur and click If.
- Replace the condition fn:true() with $source/comp:addev1/str
= 'dur'.
- Set the value for dur to $source/comp:addev1/dur + xs:duration("P1Y").
- Right-click the condition and click Else.
- Open the map for the node that is connected to the false terminal
of the Filter node (Mapping) and select addev1 as source and addev1n as target.
- Wire the source to target as shown:
dec --- dec
flt --- flt
int --- int
- In the Spreadsheet pane, expand Properties and set the following
values:
MessageType | 'addev1n'
- Set the ESQL in the Compute node to:
CALL CopyMessageHeaders();
SET OutputRoot.MRM.dec = InputBody.dec * 10;
SET OutputRoot.MRM.flt = InputBody.flt * 10;
SET OutputRoot.MRM.int = InputBody.int * 10;
- In the ResetContentDescriptor node, set the Message Domain to XMLNS
and select the Reset Message Domain check box.
- Create three instance messages with the appropriate RFH2 headers:
<comp:addev1 xmlns:comp="http://www.complex.net">
<bool>1</bool>
<bin><![CDATA[010203]]></bin>
<dat>2005-05-06T00:00:00+00:00</dat>
<dec>19.34</dec>
<dur>P2Y4M</dur>
<flt>3.245E+2</flt>
<int>2104</int>
<str>dat</str>
</comp:addev1>
<comp:addev1 xmlns:comp="http://www.complex.net">
<bool>1</bool>
<bin><![CDATA[010203]]></bin>
<dat>2005-05-06T00:00:00+00:00</dat>
<dec>19.34</dec>
<dur>P2Y4M</dur>
<flt>3.245E+2</flt>
<int>2104</int>
<str>dur</str>
</comp:addev1>
<comp:addev1 xmlns:comp="http://www.complex.net">
<bool>0</bool>
<bin><![CDATA[010203]]></bin>
<dat>2005-05-06T00:00:00+00:00</dat>
<dec>19.34</dec>
<dur>P2Y4M</dur>
<flt>3.245E+2</flt>
<int>2104</int>
<str>dat</str>
</comp:addev1>
Now deploy the message set and message flow.