Precisely Enterworks

 View Only
  • 1.  How to Use VTL Tools: StringTools, MathTools, etc.

    Posted 06-03-2021 09:06
    Is there a trick to activating Tools in VTL? I can't seem to get this to work in 8.2. I'm just in the beginning stages of testing our new 10.3 system and wanted to see if there was anything that I was missing when trying to use MathTools and StringTools.

    Thanks!

    ------------------------------
    Jonathan Varo | PIM Lead
    Fender Musical Instruments | 480-845-5823
    ------------------------------


  • 2.  RE: How to Use VTL Tools: StringTools, MathTools, etc.

    Posted 06-04-2021 21:18
    Hi Jonathan. Where do you encounter MathTools and StringTools? Sounds cool but never seen them :)

    ------------------------------
    Sidd Shenoy | Sr Dir Enterprise Master Data
    Thomson Reuters Corporation | (646) 540-2371
    ------------------------------



  • 3.  RE: How to Use VTL Tools: StringTools, MathTools, etc.

    Employee
    Posted 06-07-2021 00:08
    Jon,

    The application VTL is the Apache Velocity project.  The version of Velocity being used is found here:

    http://velocity.apache.org/engine/1.7/vtl-reference.html


    The Java classes for the various tools can be found at: 

    https://velocity.apache.org/tools/1.4/javadoc/org/apache/velocity/tools/generic/package-summary.html

    Here's an example of invoking the Math tool:

    ######################

    ## Calculate cubic volume

    ######################

    #set($String="test")##

    #set ($MathTool = $String.getClass().forName("org.apache.velocity.tools.generic.MathTool").newInstance())##

    #set($result = (${SKUUOM_STG.Packaging Height}* ${SKUUOM_STG.Packaging Length} *${SKUUOM_STG.Packaging Width})/ 1728)##

    #set($result = $MathTool.roundTo(2,$result))##

    $result##



    -Brian

    ------------------------------
    Brian Zupke | Senior Technical Support Engineer
    Winshuttle North America | 9099009179
    ------------------------------