feat(workflow & platform): optimize complex workflow orchestration, code node debug summary, MVEL simulation and entity/feetype helpers
- feat(feetype): add --subtree and --ids-only flags to listFeeTypes for direct array export - feat(platform): add platform gen-props command to generate MVEL/JS entity field constants and templates - feat(workflow): show code node return value summaries in workflow test and job first screen - feat(workflow): add workflow node map sub-command and --mapping-file for deep declarative field mutations - feat(workflow): add executeMvelSandbox for local offline simulation of MVEL code nodes - test: add comprehensive test cases across feetype, platform gen-props, node map, and MVEL sandbox Closes #140
This commit is contained in:
1 parent
1739daacf2
commit
ad771e92e0
18 files changed
+591
-29
No files matched your search
@@ -5,6 +5,7 @@ import {
|
||||
lintMvelCode,
|
||||
lintWorkflowScripts,
|
||||
executeJavaScriptSandbox,
|
||||
executeMvelSandbox,
|
||||
} from "./index.js";
|
||||
import type { WorkflowDetail } from "../../types.js";
|
||||
|
||||
@@ -275,4 +276,30 @@ describe("isolated script runtime boundaries", () => {
|
||||
expect((await executeJavaScriptSandbox('return Promise.resolve(1);')).success).toBe(false);
|
||||
expect((await executeJavaScriptSandbox('return 1;')).returnValue).toBe(1);
|
||||
});
|
||||
|
||||
describe("executeMvelSandbox", () => {
|
||||
it("executes basic MVEL variable assignments, collections and return statements", async () => {
|
||||
const mvel = [
|
||||
'String planCode = "AMORT-001";',
|
||||
'int periods = 3;',
|
||||
'Map row = new HashMap();',
|
||||
'row.put("code", planCode);',
|
||||
'row.put("periods", periods);',
|
||||
'return row;',
|
||||
].join("\n");
|
||||
const result = await executeMvelSandbox(mvel);
|
||||
expect(result.success).toBe(true);
|
||||
expect(result.returnValue).toEqual({ code: "AMORT-001", periods: 3 });
|
||||
});
|
||||
|
||||
it("accesses inputs in MVEL code", async () => {
|
||||
const mvel = [
|
||||
'int total = amount * 2;',
|
||||
'return total;',
|
||||
].join("\n");
|
||||
const result = await executeMvelSandbox(mvel, { amount: 50 });
|
||||
expect(result.success).toBe(true);
|
||||
expect(result.returnValue).toBe(100);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user