script — Defines a script generator.
<script language="sourceLanguage
">
... script language source code ...
</script>
This element defines a generator that executes a script to
create the next value. Every time the application needs
a new value, it will execute the script source code that it is
inside this element. For now, only a javascript engine is
available. The code execution must set the value
variable to the result of the calculation.
The javascript engine used is the JDK 1.6 scripting engine, see JSR 223 specification for details.
Inside the script you will find the following variables already set by the application:
The randomSeed used to generate the data.
An object with several methods to generate
random data initialized with the randomSeed
(**TODO** insert the function descriptions).
Example 29. Script generator.
<project name="postgresqlTest"> <metadata> <table name="table0"> <generator row-count="10000" /> ... <column name="some_phone" ds-type="varchar" size="20"> <generator> <script language="javascript"> var val = randomData.nextInt(0, 40) * randomSeed; value = "Hello World!"; </script> </generator> </column> ... </table> ... </metadata> ... </project>