Portal Community

How Jint Is Used

Project: BizFirst.Ai.ProcessEngine.JS.Services

Class: ExpressionEvaluator (implements IExpressionEvaluator)

The evaluator creates a Jint Engine instance per evaluation call, injects the context variables as named properties, then calls engine.Evaluate(expression).

// Internal Jint evaluation flow (ExpressionEvaluator.cs)
var engine = JintSecurityConfiguration.CreateEngine(isolationMode);

// Inject context variables into the engine scope
foreach (var variable in executionVariables)
{
    engine.SetValue(variable.Key, variable.Value);
}

// Evaluate and extract result
var result = engine.Evaluate(expression);
return result?.ToObject();

Isolation Modes

The Jint engine runs in one of two security modes determined by the node's certification status:

ModeWhenConstraints
High Isolation Uncertified nodes (user-defined or untrusted) No file/network access, timeout enforced (default 5s), restricted APIs
Low Isolation Certified nodes (platform-signed, verified safe) Longer timeout, some additional APIs permitted

Expression Examples (Jint)

// Simple field reference — resolved by directive system, not Jint
@{output:http-request-1.statusCode}

// JavaScript expression in @{js:...} directive — evaluated by Jint
@{js: $output['http-request-1'].statusCode === 200 ? 'ok' : 'error'}

// String concatenation
@{js: $output['form-1'].firstName + ' ' + $output['form-1'].lastName}

// Arithmetic
@{js: Math.round($output['calc-1'].amount * 1.1)}

// Conditional (ternary)
@{js: $var.retryCount > 3 ? 'exhausted' : 'retry'}

Jint Limitations

LimitationDetail
TimeoutDefault 5 seconds per expression — complex computations may be rejected
No async/awaitJint evaluates synchronously — expressions cannot await promises
No require / importCannot import external modules — only built-in JS globals available
No file/network accessSandboxed — XmlHttpRequest, fetch, FileSystem APIs are disabled
ES2020 supportJint supports ES2020 spec — older and newer features may vary
Use Directive Syntax for Simple References For simple field references (@{output:nodeId.field}), the directive resolver handles resolution directly without invoking Jint. Reserve @{js:...} for cases where computation is needed. Directive-based resolution is faster and does not consume the Jint timeout budget.