The Business Rule Generator, formerly called the Functional Generator, generates values using a custom code rule authored by a user or AI. The rule body is stored in the configuration and executed by a remote executor service during generation. Use this framework when standard generators cannot produce the logic or format you need.
Business Rule supports single-value generation (default) and multi-value generation. In single-value mode, the rule runs once per row and produces the value for a field.
For more information on creating a generator, see Create a generator.
Configuration fields
| Field | Description |
|---|---|
| Language | Python. Rules are executed in a restricted Python environment with access only to supported libraries. |
| Source | The rule body to execute. This can be customer-authored or AI-generated. The content is treated as opaque text by the system and executed as-is by the remote executor. |
| Multi-Value Output | Controls execution mode. Disabled: single-value mode (one generated value per row). Enabled: multi-value mode (one rule call generates a list of values for the full column). |
| Inputs | In single-value mode, inputs can be mapped from Field values, Seed List values, or a STATIC literal value. Inputs are not supported in multi-value mode. Reusable global templates resolve their bindings independently for each assigned field. |
Single-value mode
Single-value mode is the default mode. The rule runs once per row and returns a single generated value.
def generate(seed_value):
return seed_value.upper()
Multi-value mode
When Multi-Value Output is enabled, the rule must accept one ctx argument and return a list of generated values.
def generate(ctx):
return np.random.normal(0, 1, ctx.rowSize).tolist()
| ctx property | Description |
|---|---|
| ctx.rowSize | Total number of rows to generate for the column. |
| ctx.rowIdx | Placeholder property for row-index-based logic where a rule uses row offsets. |
np.random.seed(...)) inside the rule body. The platform seeds random generation before execution to keep output reproducible across runs.Business Rule functions can return a statistically distributed list of values for a batch of rows in multi-value mode. A multi-value reusable template supports only STATIC inputs.
The execution sandbox restricts unsupported functions such as hasattr. Approved builtins include ord and chr.
Supported libraries for output formatting
Business Rule can return JSON or XML string output.
-
JSON: Use
jsonlibrary methods likejson.dumps(...). -
XML: Use the pre-available
EThelper object to construct XML output. XML parsing and file reads are not supported.def generate(name): root = ET.Element("customer") ET.SubElement(root, "name").text = name return ET.tostring(root, encoding="unicode")
Terminology
Business Rule input terminology uses Field instead of Column, Structure instead of Table, and Connector instead of Schema.