Velocity Templates

ESM supports the use of velocity templates or scripts as defined by the Apache Velocity Project (http://velocity.apache.org/). Velocity templates are a means of specifying dynamic or variable inputs to, or outputs from, underlying Java code.

There are a number of places where a person familiar with Velocity templates can specify inputs using Velocity, instead of a literal value, to greatly enhance the results.

Caution: Velocity templates are for advanced users

  • You must be experienced in using Velocity templates.

    Because Velocity templates have such wide-ranging and intricate possibilities, mis-application or inappropriate application is entirely possible. Micro Focus cannot assume responsibility for adverse results caused by user-supplied Velocity templates.

  • ESM does not provide error checking or error messaging for user-created velocity expressions. Refer to the Apache Velocity Project web page at http://velocity.apache.org/ for more information on using velocity templates.

  • Velocity template based variables are held only in memory and, therefore, can be used only in Rules, Filters, and Data Monitors. Velocity template based variables cannot be used in resources like Reports, which rely on persisted data. (There is a set of velocity references specifically for use in Reports. See Velocity References for Reports for more information.)

  • Referencing Variables and Fields in Velocity Expressions. Any variable that a velocity expression references must be local to the resource. You can refer to local variables and fields in a velocity expression.

    If you have a global variable that you want to use in a velocity expression, use the +/-Global Variable button on the Common Conditions Editor (CCE) to make it available in the resource. For more information, see Adding or Removing Global Variables Using the CCE.

    For more information on variables in general, see Variables and Global Variables.