VelocityServices.invokeTemplateFromFile

Invokes the Velocity template contained in the file specified by fileName. This provides integration with the Velocity template engine supplied by Apache.

Only a file name can be specified for the template location, not a complete file path. All templates must be located in the directory specified in parameter file.resource.loader.path of properties file velocity.properties.

The logging level controls the level of generated messages, and any such messages are written to the designer execution log (View > Execution log). Available log levels are:

  • 0 debug (constant LOG_LEVEL_DEBUG)
  • 1 info (constant LOG_LEVEL_INFO)
  • 2 warn (constant LOG_LEVEL_WARN)
  • 3 error (constant LOG_LEVEL_ERROR)
Further documentation.

Javascript example:

 fields.F1.value = VelocityServices.invokeTemplateFromFile("template1.vm", VelocityServices.LOG_LEVEL_DEBUG);
 

returns java.lang.String

Parameters

java.lang.String  fileName,  int  logLevel,