Share this link

    Home / Tradeshift Documentation / Tradeshift Partner Apps / Babelway / Chapter 4. Channels

    Drag and Drop transformation properties

    1170 0 Created on 2021-01-19 07:52:11; Last updated on 2022-07-01 13:01:37

    The following properties are available :

     Mapping definition 

     This file is the definition of the visual mapping. You normally edit it via the mapping tree editor. 

     Xslt 

     This file is the xslt transformation that will be applied on the internal xml representation of your incoming message to transform it into the outgoing message. It is generated from the mapping definition file. 

     You can only edit this file via the mapping definition file. If you directly want to write an advanced xslt transformation, you have to use an xslt transformation instead of a visual transformation. 

     Xslt includes 

     Xslt files that will be included in the generated xslt. It allows you to define some custom xslt functions, and use them in the mapping. The uploaded file must contain all of your functions. It must looks like :

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="2.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:bfn="http://xmlns.babelway.com/2007/function"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:common="http://exslt.org/common"
    xmlns:math="http://exslt.org/math"
    xmlns:sets="http://exslt.org/sets"
    xmlns:dates-and-times="http://exslt.org/dates-and-times"
    xmlns:random="http://exslt.org/random"
    xmlns:saxon="http://saxon.sf.net/"
    >
    
    <xsl:function name="bfn:xml-parse" >
    <xsl:param name="xmlString"/>
    <xsl:sequence select="saxon:parse($xmlString)"/>
    </xsl:function>
    
    </xsl:stylesheet>

     Transformation mode 

     Allows you to use special transformation modes. The available modes are :

    • Normal : transformation reads content and metadata of the incoming message, and its result will affect content and metadata of the outgoing message. 

    • Metadata only for outgoing message : only the metadata of the outgoing message will be updated. The content of the outgoing message will be the same as the input. This mode can be used in special situations where the transformation must only generate some additional metadata. 

    • Metadata only for incoming message : only the metadata of the incoming message will be used, not its content. This mode can be used in special situations where the transformation only operated on the metadata of the incoming message. A dummy message in will be used instead of the incoming content. 

    • Metadata only : the transformation only operates on the metadata of the incoming message, and can only update metadata of the outgoing message. Content will not be updated by the transform. 

     

    Note: If you want to extract some information from the input message and then save the extracted information in a user defined metadata, you must select the correct "Transformation mode" depending on your case.

    Below is an example to show what will happen for the output message when the input message is processed by a channel whose "Message In" is of type "XML" and the "Message Out" is of type "Not Defined".

    In this case the transformation will extract the status of the message from the input message and save it in a user defined metadata.

    Status field from the "Message In" in the transformation is mapped to "MessageStatus" user defined metadata in the "Message Out". Moreover, the "Transformation mode" is "Normal".

    Test_Channel.png

    Test Channel

    Now when the message will be processed by this channel it will be empty, as shown below:

    Empty Output Message

    To fix this issue, you will need to change the "Transformation mode" to be "Metadata only for outgoing message (does not change content)." to make sure that the output message is not empty.

    Transformation_Mode.png

    Transformation Mode

    Now when the message will be processed by this channel it will be generated properly, as shown below:

    Output Message

    

    0 people found this helpful.

    Related Articles