-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.ts
More file actions
33 lines (25 loc) · 699 Bytes
/
index.ts
File metadata and controls
33 lines (25 loc) · 699 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { DecisionTable } from './DecisionTable';
import { Condition,Expression } from './Expression';
export * from './common';
export async function ExecuteCondition(script, variable, context) {
const cond = new Condition(script, variable);
return await cond.evaluate(context);
}
export async function ExecuteExpression(script,context) {
const expr = new Expression(script);
return await expr.evaluate(context);
}
export function ExecuteDecisionTable(
{ definition,
data,
options,
loadFrom
}) {
console.log(definition);
console.log(data);
console.log(options);
console.log(loadFrom);
const dt = new DecisionTable(definition);
const res = dt.evaluate(data);
return res;
}