cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Query

Former Member
0 Kudos

How would I go about implementing the following mapping requirement? I have 3 fields in the source document that I wish to concatenate to populate a field in the target document. If the source nodes always existed then this would be a simple concatenation. However, each of the source nodes is optional and hence the concat function does not get called when the source nodes do not exist.

<b>Source Document Segment</b>

<PhysicalAddress>

<POBoxID>xyz</POBoxID>

<RoomID>123</RoomID>

<BuildingID>B1</BuildingID>

</PhysicalAddress>

<b>Target Document Segment</b>

<ADDRLINE>xyz 123 B1</ADDRLINE>

This can be acheived in the graphical mapping editor by checking the existence of each node and concatenating only the source nodes that exist. However, this gets very messy when considering all of the possible combinations. I was wondering if it is possible to acheive the result by using an advanced user defined mapping rule.

Any suggestions on how I would structure such a rule would be much appreciated.

Regards

Mark Briggs

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

The use of the standard function "mapWithDefault"(it is a node function) will help your case without doing any check.....

The inputs to the concat function should be the individuals elements passed through "mapWithDefault"...

so the mapping would be like...

POBoxID -- mapWithDefault(default space)
                                                                                concat
                                        /      
RoomID --  mapWithDefault(default space)        
                                                 concat --- addrline
                                                /
BuildingID --    mapWithDefault(defaultspace)      

Thanks,

Renjith

Answers (2)

Answers (2)

Former Member
0 Kudos

Renjith

mapWithDefault is exactly what I was missing.

Thanks

Mark

Former Member
0 Kudos

Glad I Could help..

Regards,

Renjith

Former Member
0 Kudos

Hi Mark,

If one one of the field doesnot exit than also you want to continue with concatenating fields.

If so,

than use If with else standard function after checking fields exists or not if not pass Constant(without any value)than concatenate function..

Repeat this for all fields...

Hope it helps,

Regards,

satish