This is the third stage of the scenario to
perform complex message enrichment. This
topic demonstrates how to develop a message flow to map target fields from
multiple other fields and also involves developing corresponding message models
and instance documents.
In the COMPLEX message definition, in namespace www.complex.net,
create a message called addev2, which has the following structure:
addev2
firstname (xsd:string) local element
lastname (xsd:string) local element
branch (xsd:string) local element
accountno (xsd:string) local element
balance (xsd:decimal) local element
transvalue local complex element, base type xsd:decimal
transdir (xsd:string) local attribute
In the message set MAPPING3_COMPLEX_messages, create a new message
definition file called COMP2, which has the target namespace www.comp2.net,
with prefix c2.
In the COMP2 message definition, create a message called addev2out,
which has the structure:
addev2out
accountdetails (xsd:string) local element
transvalue (xsd:decimal) local element
balance (xsd:decimal) local element
Create a message flow called addev2, which contains the following
mapping: MQInput -> Mapping -> MQOutput.
Open the map and select addev2 as the source and addev2out as the
target.
In the Spreadsheet pane, expand Properties and set the following
values:
MessageType | 'addev2out'
Set the accountdetails target to fn:concat($source/comp:addev2/accountno,
$source/comp:addev2/branch, $source/comp:addev2/lastname, $source/comp:addev2/firstname).
Right-click the target transvalue and click If.
Change the condition from fn:true() to $source/comp:addev2/transvalue/@transdir
= 'DEBIT'.
Select transvalue and set its value to $source/comp:addev2/transvalue
* (-1).
Right-click the condition and click Else.
Right-click the target balance and click If.
Change the condition from fn:true() to $source/comp:addev2/transvalue/@transdir
= 'DEBIT'.
Select balance and set its value to $source/comp:addev2/balance
- $source/comp:addev2/transvalue.
Right-click the condition and click Condition.
Change the condition from fn:true() to $source/comp:addev2/transvalue/@transdir
= 'CREDIT'.
Select balance following the second condition and set its Value
to $source/comp:addev2/balance + $source/comp:addev2/transvalue.
Create two instance messages with the appropriate RFH2 headers:
a message called addev2 in the message definition called COMPLEX
a message called addev2out in the message definition called COMP2
a message flow called addev2, which contains the mapping file addev2_Mapping.msgmap
files that contain instance messages for test
Now deploy the message set and message flow
Deploy the message set and message flow
This is the fourth stage of the scenario to
perform complex message enrichment.
This topic demonstrates how to deploy the message set and message flow and
run the instance messages through the broker.
Create a bar file called addev2.
Add the message set MAPPING3_COMPLEX_messages and the message flow
addev2 to the bar file.