App Connect

App Connect

Join this online user group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#Applicationintegration
#App Connect
#AppConnect
#Integration
#Automation
 View Only

Configuring an else if conditional transform

  • 1.  Configuring an else if conditional transform

    Posted 01/21/25 04:12 AM

    I need to use the if else conditional transform on the mapping node. The logic is as follows:-

    If CharacteristicQuantityTypeCode = 'LENGTH' map CharacteristicQuantityto packLength field

    else If CharacteristicQuantityTypeCode= 'HEIGHT' map CharacteristicQuantityto packHeight field

    else If CharacteristicQuantityTypeCode= 'WIDTH' map CharacteristicQuantityto packWidth field

    else If CharacteristicQuantityTypeCode= 'GROSS WT' map CharacteristicQuantityto packWeight field

    The screen dump show what I have done in the mapping node. 

    The mapping node 

     <foreach>
                    <input path="$ProductMDMReplicateRequestMessage/Product/QuantityCharacteristic" var="QuantityCharacteristic2"/>
                    <output path="itemPack"/>
                    <condition>
                        <if>
                            <input path="$QuantityCharacteristic2/CharacteristicQuantity/text()" var="value"/>
                            <input path="$QuantityCharacteristic2/CharacteristicQuantityTypeCode/text()" var="value1"/>
                            <output path="packLength"/>
                            <test lang="xpath">$value1 = 'LENGTH'</test>
                            <move>
                                <input path="$value/." var="value2"/>
                                <output path="."/>
                            </move>
                        </if>
                        <elseif>
                            <input path="$QuantityCharacteristic2/CharacteristicQuantity/text()" var="value3"/>
                            <input path="$QuantityCharacteristic2/CharacteristicQuantityTypeCode/text()" var="value4"/>
                            <output path="packHeight"/>
                            <test lang="xpath">$value4 = 'HEIGHT'</test>
                            <move>
                                <input path="$value3/." var="value5"/>
                                <output path="."/>
                            </move>
                        </elseif>
                        <elseif>
                            <input path="$QuantityCharacteristic2/CharacteristicQuantity/text()" var="value6"/>
                            <input path="$QuantityCharacteristic2/CharacteristicQuantityTypeCode/text()" var="value7"/>
                            <output path="packWidth"/>
                            <test lang="xpath">$value7 = 'WIDTH'</test>
                            <move>
                                <input path="$value6/." var="value8"/>
                                <output path="."/>
                            </move>
                        </elseif>
                        <elseif>
                            <input path="$QuantityCharacteristic2/CharacteristicQuantity/text()" var="value15"/>
                            <input path="$QuantityCharacteristic2/CharacteristicQuantityTypeCode/text()" var="value16"/>
                            <output path="packWeight"/>
                            <test lang="xpath">$value16 = 'GROSS WT'</test>
                            <move>
                                <input path="$value15/." var="value17"/>
                                <output path="."/>
                            </move>
                        </elseif>
                    </condition>
                </foreach>
    

    When I run the message flow I get the following error

     The processing for mapping routine ''{gen}:ProductMDMBulkReplicateRequest_Out_Request_Mapping'' has failed, with the following details: ''If: $value1 = 'LENGTH'''.   
     
    The processing of the specified map has failed.   
     
    Review and resolve the problems indicated in the message from the map processing.  
     An error occurred during the processing of a message. The error message is ''Use of default: in switch() is unexpected.''.   
     
    An error occurred during message processing. Additional diagnostic information might be written to the user trace.   
     
    Inspect the diagnostic information, and check the user trace for further information. 

    What am I doing wrong ?



    ------------------------------
    Nokuthula Mpofu
    ------------------------------